mirror of
https://github.com/systemd/systemd
synced 2024-07-21 18:24:38 +00:00
boot: Constify PE sections type
This commit is contained in:
parent
008f47f139
commit
6028dd6d8e
|
@ -1806,7 +1806,7 @@ static void config_title_generate(Config *config) {
|
|||
|
||||
static bool is_sd_boot(EFI_FILE *root_dir, const char16_t *loader_path) {
|
||||
EFI_STATUS err;
|
||||
const char *sections[] = {
|
||||
static const char * const sections[] = {
|
||||
".sdmagic",
|
||||
NULL
|
||||
};
|
||||
|
@ -2082,7 +2082,7 @@ static void config_entry_add_unified(
|
|||
continue;
|
||||
|
||||
/* look for .osrel and .cmdline sections in the .efi binary */
|
||||
err = pe_file_locate_sections(linux_dir, f->FileName, (const char **) sections, offs, szs);
|
||||
err = pe_file_locate_sections(linux_dir, f->FileName, sections, offs, szs);
|
||||
if (err != EFI_SUCCESS || szs[SECTION_OSREL] == 0)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ static inline UINTN section_table_offset(const struct DosFileHeader *dos, const
|
|||
static void locate_sections(
|
||||
const struct PeSectionHeader section_table[],
|
||||
UINTN n_table,
|
||||
const char **sections,
|
||||
const char * const sections[],
|
||||
UINTN *addrs,
|
||||
UINTN *offsets,
|
||||
UINTN *sizes) {
|
||||
|
@ -247,7 +247,7 @@ EFI_STATUS pe_alignment_info(
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS pe_memory_locate_sections(const void *base, const char **sections, UINTN *addrs, UINTN *sizes) {
|
||||
EFI_STATUS pe_memory_locate_sections(const void *base, const char * const sections[], UINTN *addrs, UINTN *sizes) {
|
||||
const struct DosFileHeader *dos;
|
||||
const struct PeFileHeader *pe;
|
||||
UINTN offset;
|
||||
|
@ -279,7 +279,7 @@ EFI_STATUS pe_memory_locate_sections(const void *base, const char **sections, UI
|
|||
EFI_STATUS pe_file_locate_sections(
|
||||
EFI_FILE *dir,
|
||||
const char16_t *path,
|
||||
const char **sections,
|
||||
const char * const sections[],
|
||||
UINTN *offsets,
|
||||
UINTN *sizes) {
|
||||
_cleanup_freepool_ struct PeSectionHeader *section_table = NULL;
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
|
||||
EFI_STATUS pe_memory_locate_sections(
|
||||
const void *base,
|
||||
const char **sections,
|
||||
const char * const sections[],
|
||||
UINTN *addrs,
|
||||
UINTN *sizes);
|
||||
|
||||
EFI_STATUS pe_file_locate_sections(
|
||||
EFI_FILE *dir,
|
||||
const char16_t *path,
|
||||
const char **sections,
|
||||
const char * const sections[],
|
||||
UINTN *offsets,
|
||||
UINTN *sizes);
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
|
|||
if (err != EFI_SUCCESS)
|
||||
return log_error_status_stall(err, L"Error getting a LoadedImageProtocol handle: %r", err);
|
||||
|
||||
err = pe_memory_locate_sections(loaded_image->ImageBase, (const char **) sections, addrs, szs);
|
||||
err = pe_memory_locate_sections(loaded_image->ImageBase, sections, addrs, szs);
|
||||
if (err != EFI_SUCCESS || szs[SECTION_LINUX] == 0) {
|
||||
if (err == EFI_SUCCESS)
|
||||
err = EFI_NOT_FOUND;
|
||||
|
|
Loading…
Reference in a new issue