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>
This commit is contained in:
Ard Biesheuvel
2019-12-24 16:10:11 +01:00
committed by Ingo Molnar
parent e8bd5ddf60
commit 960a8d0183
7 changed files with 28 additions and 18 deletions

View File

@@ -382,7 +382,11 @@ union efi_pci_io_protocol {
void *allocate_buffer;
void *free_buffer;
void *flush;
void *get_location;
efi_status_t (*get_location)(efi_pci_io_protocol_t *,
unsigned long *segment_nr,
unsigned long *bus_nr,
unsigned long *device_nr,
unsigned long *function_nr);
void *attributes;
void *get_bar_attributes;
void *set_bar_attributes;
@@ -730,6 +734,8 @@ typedef struct {
u32 tables;
} efi_system_table_32_t;
typedef union efi_simple_text_output_protocol efi_simple_text_output_protocol_t;
typedef union {
struct {
efi_table_hdr_t hdr;
@@ -738,7 +744,7 @@ typedef union {
unsigned long con_in_handle;
unsigned long con_in;
unsigned long con_out_handle;
unsigned long con_out;
efi_simple_text_output_protocol_t *con_out;
unsigned long stderr_handle;
unsigned long stderr;
efi_runtime_services_t *runtime;
@@ -1337,8 +1343,6 @@ struct efivar_entry {
bool deleting;
};
typedef union efi_simple_text_output_protocol efi_simple_text_output_protocol_t;
union efi_simple_text_output_protocol {
struct {
void *reset;