boot: Use void for base pointer

This commit is contained in:
Jan Janssen 2022-06-20 13:10:41 +02:00
parent 3ed785e591
commit 008f47f139
2 changed files with 10 additions and 10 deletions

View file

@ -247,11 +247,7 @@ EFI_STATUS pe_alignment_info(
return EFI_SUCCESS; return EFI_SUCCESS;
} }
EFI_STATUS pe_memory_locate_sections( EFI_STATUS pe_memory_locate_sections(const void *base, const char **sections, UINTN *addrs, UINTN *sizes) {
const char *base,
const char **sections,
UINTN *addrs,
UINTN *sizes) {
const struct DosFileHeader *dos; const struct DosFileHeader *dos;
const struct PeFileHeader *pe; const struct PeFileHeader *pe;
UINTN offset; UINTN offset;
@ -261,17 +257,21 @@ EFI_STATUS pe_memory_locate_sections(
assert(addrs); assert(addrs);
assert(sizes); assert(sizes);
dos = (const struct DosFileHeader*)base; dos = (const struct DosFileHeader *) base;
if (!verify_dos(dos)) if (!verify_dos(dos))
return EFI_LOAD_ERROR; return EFI_LOAD_ERROR;
pe = (const struct PeFileHeader*)&base[dos->ExeHeader]; pe = (const struct PeFileHeader *) ((uint8_t *) base + dos->ExeHeader);
if (!verify_pe(pe, /* allow_compatibility= */ false)) if (!verify_pe(pe, /* allow_compatibility= */ false))
return EFI_LOAD_ERROR; return EFI_LOAD_ERROR;
offset = section_table_offset(dos, pe); offset = section_table_offset(dos, pe);
locate_sections((struct PeSectionHeader*)&base[offset], pe->FileHeader.NumberOfSections, locate_sections((struct PeSectionHeader *) ((uint8_t *) base + offset),
sections, addrs, NULL, sizes); pe->FileHeader.NumberOfSections,
sections,
addrs,
NULL,
sizes);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View file

@ -5,7 +5,7 @@
#include <uchar.h> #include <uchar.h>
EFI_STATUS pe_memory_locate_sections( EFI_STATUS pe_memory_locate_sections(
const char *base, const void *base,
const char **sections, const char **sections,
UINTN *addrs, UINTN *addrs,
UINTN *sizes); UINTN *sizes);