summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2019-12-24 16:10:11 +0100
committerIngo Molnar <mingo@kernel.org>2019-12-25 10:49:18 +0100
commit960a8d01834eabc4549928c60f8ce0300ad08519 (patch)
tree5b8c71ad5a440efa45c4ea145aab52fe7ecf3330 /arch/x86/boot/compressed
parente8bd5ddf60eedd6d584fa1e98d0cfe45abe95043 (diff)
efi/libstub: Use stricter typing for firmware function pointers
We will soon remove another level of pointer casting, so let's make sure all type handling involving firmware calls at boot time is correct. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Cc: Arvind Sankar <nivedita@alum.mit.edu> Cc: Borislav Petkov <bp@alien8.de> Cc: James Morse <james.morse@arm.com> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-efi@vger.kernel.org Link: https://lkml.kernel.org/r/20191224151025.32482-12-ardb@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/boot/compressed')
-rw-r--r--arch/x86/boot/compressed/eboot.c10
-rw-r--r--arch/x86/boot/compressed/eboot.h9
2 files changed, 12 insertions, 7 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 990b93379965..2733bc263c04 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -70,7 +70,8 @@ preserve_pci_rom_image(efi_pci_io_protocol_t *pci, struct pci_setup_rom **__rom)
size = romsize + sizeof(*rom);
- status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom);
+ status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size,
+ (void **)&rom);
if (status != EFI_SUCCESS) {
efi_printk(sys_table, "Failed to allocate memory for 'rom'\n");
return status;
@@ -195,9 +196,9 @@ static void retrieve_apple_device_properties(struct boot_params *boot_params)
struct setup_data *data, *new;
efi_status_t status;
u32 size = 0;
- void *p;
+ apple_properties_protocol_t *p;
- status = efi_call_early(locate_protocol, &guid, NULL, &p);
+ status = efi_call_early(locate_protocol, &guid, NULL, (void **)&p);
if (status != EFI_SUCCESS)
return;
@@ -212,7 +213,8 @@ static void retrieve_apple_device_properties(struct boot_params *boot_params)
do {
status = efi_call_early(allocate_pool, EFI_LOADER_DATA,
- size + sizeof(struct setup_data), &new);
+ size + sizeof(struct setup_data),
+ (void **)&new);
if (status != EFI_SUCCESS) {
efi_printk(sys_table, "Failed to allocate memory for 'properties'\n");
return;
diff --git a/arch/x86/boot/compressed/eboot.h b/arch/x86/boot/compressed/eboot.h
index de13865dc7d2..b8d11928f528 100644
--- a/arch/x86/boot/compressed/eboot.h
+++ b/arch/x86/boot/compressed/eboot.h
@@ -12,9 +12,12 @@
#define DESC_TYPE_CODE_DATA (1 << 0)
-typedef union {
+typedef union efi_uga_draw_protocol efi_uga_draw_protocol_t;
+
+union efi_uga_draw_protocol {
struct {
- void *get_mode;
+ efi_status_t (*get_mode)(efi_uga_draw_protocol_t *,
+ u32*, u32*, u32*, u32*);
void *set_mode;
void *blt;
};
@@ -23,6 +26,6 @@ typedef union {
u32 set_mode;
u32 blt;
} mixed_mode;
-} efi_uga_draw_protocol_t;
+};
#endif /* BOOT_COMPRESSED_EBOOT_H */