Skip to content

Commit e8bd5dd

Browse files
ardbiesheuvelIngo Molnar
authored andcommitted
efi/libstub: Drop explicit 32/64-bit protocol definitions
Now that we have incorporated the mixed mode protocol definitions into the native ones using unions, we no longer need the separate 32/64 bit struct definitions, with the exception of the EFI system table definition and the boot services, runtime services and configuration table definitions. So drop the unused ones. Signed-off-by: Ard Biesheuvel <[email protected]> Cc: Arvind Sankar <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: James Morse <[email protected]> Cc: Matt Fleming <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent f958efe commit e8bd5dd

File tree

3 files changed

+1
-266
lines changed

3 files changed

+1
-266
lines changed

arch/x86/boot/compressed/eboot.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@
1212

1313
#define DESC_TYPE_CODE_DATA (1 << 0)
1414

15-
typedef struct {
16-
u32 get_mode;
17-
u32 set_mode;
18-
u32 blt;
19-
} efi_uga_draw_protocol_32_t;
20-
21-
typedef struct {
22-
u64 get_mode;
23-
u64 set_mode;
24-
u64 blt;
25-
} efi_uga_draw_protocol_64_t;
26-
2715
typedef union {
2816
struct {
2917
void *get_mode;

drivers/firmware/efi/libstub/random.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@
1111

1212
typedef union efi_rng_protocol efi_rng_protocol_t;
1313

14-
typedef struct {
15-
u32 get_info;
16-
u32 get_rng;
17-
} efi_rng_protocol_32_t;
18-
19-
typedef struct {
20-
u64 get_info;
21-
u64 get_rng;
22-
} efi_rng_protocol_64_t;
23-
2414
union efi_rng_protocol {
2515
struct {
2616
efi_status_t (*get_info)(efi_rng_protocol_t *,

include/linux/efi.h

Lines changed: 1 addition & 244 deletions
Original file line numberDiff line numberDiff line change
@@ -264,54 +264,6 @@ typedef struct {
264264
u32 create_event_ex;
265265
} __packed efi_boot_services_32_t;
266266

267-
typedef struct {
268-
efi_table_hdr_t hdr;
269-
u64 raise_tpl;
270-
u64 restore_tpl;
271-
u64 allocate_pages;
272-
u64 free_pages;
273-
u64 get_memory_map;
274-
u64 allocate_pool;
275-
u64 free_pool;
276-
u64 create_event;
277-
u64 set_timer;
278-
u64 wait_for_event;
279-
u64 signal_event;
280-
u64 close_event;
281-
u64 check_event;
282-
u64 install_protocol_interface;
283-
u64 reinstall_protocol_interface;
284-
u64 uninstall_protocol_interface;
285-
u64 handle_protocol;
286-
u64 __reserved;
287-
u64 register_protocol_notify;
288-
u64 locate_handle;
289-
u64 locate_device_path;
290-
u64 install_configuration_table;
291-
u64 load_image;
292-
u64 start_image;
293-
u64 exit;
294-
u64 unload_image;
295-
u64 exit_boot_services;
296-
u64 get_next_monotonic_count;
297-
u64 stall;
298-
u64 set_watchdog_timer;
299-
u64 connect_controller;
300-
u64 disconnect_controller;
301-
u64 open_protocol;
302-
u64 close_protocol;
303-
u64 open_protocol_information;
304-
u64 protocols_per_handle;
305-
u64 locate_handle_buffer;
306-
u64 locate_protocol;
307-
u64 install_multiple_protocol_interfaces;
308-
u64 uninstall_multiple_protocol_interfaces;
309-
u64 calculate_crc32;
310-
u64 copy_mem;
311-
u64 set_mem;
312-
u64 create_event_ex;
313-
} __packed efi_boot_services_64_t;
314-
315267
/*
316268
* EFI Boot Services table
317269
*/
@@ -399,11 +351,6 @@ typedef struct {
399351
u32 write;
400352
} efi_pci_io_protocol_access_32_t;
401353

402-
typedef struct {
403-
u64 read;
404-
u64 write;
405-
} efi_pci_io_protocol_access_64_t;
406-
407354
typedef union efi_pci_io_protocol efi_pci_io_protocol_t;
408355

409356
typedef
@@ -422,46 +369,6 @@ typedef struct {
422369
efi_pci_io_protocol_cfg_t write;
423370
} efi_pci_io_protocol_config_access_t;
424371

425-
typedef struct {
426-
u32 poll_mem;
427-
u32 poll_io;
428-
efi_pci_io_protocol_access_32_t mem;
429-
efi_pci_io_protocol_access_32_t io;
430-
efi_pci_io_protocol_access_32_t pci;
431-
u32 copy_mem;
432-
u32 map;
433-
u32 unmap;
434-
u32 allocate_buffer;
435-
u32 free_buffer;
436-
u32 flush;
437-
u32 get_location;
438-
u32 attributes;
439-
u32 get_bar_attributes;
440-
u32 set_bar_attributes;
441-
u64 romsize;
442-
u32 romimage;
443-
} efi_pci_io_protocol_32_t;
444-
445-
typedef struct {
446-
u64 poll_mem;
447-
u64 poll_io;
448-
efi_pci_io_protocol_access_64_t mem;
449-
efi_pci_io_protocol_access_64_t io;
450-
efi_pci_io_protocol_access_64_t pci;
451-
u64 copy_mem;
452-
u64 map;
453-
u64 unmap;
454-
u64 allocate_buffer;
455-
u64 free_buffer;
456-
u64 flush;
457-
u64 get_location;
458-
u64 attributes;
459-
u64 get_bar_attributes;
460-
u64 set_bar_attributes;
461-
u64 romsize;
462-
u64 romimage;
463-
} efi_pci_io_protocol_64_t;
464-
465372
union efi_pci_io_protocol {
466373
struct {
467374
void *poll_mem;
@@ -523,22 +430,6 @@ union efi_pci_io_protocol {
523430
#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000
524431
#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000
525432

526-
typedef struct {
527-
u32 version;
528-
u32 get;
529-
u32 set;
530-
u32 del;
531-
u32 get_all;
532-
} apple_properties_protocol_32_t;
533-
534-
typedef struct {
535-
u64 version;
536-
u64 get;
537-
u64 set;
538-
u64 del;
539-
u64 get_all;
540-
} apple_properties_protocol_64_t;
541-
542433
struct efi_dev_path;
543434

544435
typedef union apple_properties_protocol apple_properties_protocol_t;
@@ -566,26 +457,6 @@ union apple_properties_protocol {
566457
} mixed_mode;
567458
};
568459

569-
typedef struct {
570-
u32 get_capability;
571-
u32 get_event_log;
572-
u32 hash_log_extend_event;
573-
u32 submit_command;
574-
u32 get_active_pcr_banks;
575-
u32 set_active_pcr_banks;
576-
u32 get_result_of_set_active_pcr_banks;
577-
} efi_tcg2_protocol_32_t;
578-
579-
typedef struct {
580-
u64 get_capability;
581-
u64 get_event_log;
582-
u64 hash_log_extend_event;
583-
u64 submit_command;
584-
u64 get_active_pcr_banks;
585-
u64 set_active_pcr_banks;
586-
u64 get_result_of_set_active_pcr_banks;
587-
} efi_tcg2_protocol_64_t;
588-
589460
typedef u32 efi_tcg2_event_log_format;
590461

591462
typedef union efi_tcg2_protocol efi_tcg2_protocol_t;
@@ -913,38 +784,6 @@ struct efi_fdt_params {
913784
u32 desc_ver;
914785
};
915786

916-
typedef struct {
917-
u32 revision;
918-
u32 parent_handle;
919-
u32 system_table;
920-
u32 device_handle;
921-
u32 file_path;
922-
u32 reserved;
923-
u32 load_options_size;
924-
u32 load_options;
925-
u32 image_base;
926-
__aligned_u64 image_size;
927-
unsigned int image_code_type;
928-
unsigned int image_data_type;
929-
u32 unload;
930-
} efi_loaded_image_32_t;
931-
932-
typedef struct {
933-
u32 revision;
934-
u64 parent_handle;
935-
u64 system_table;
936-
u64 device_handle;
937-
u64 file_path;
938-
u64 reserved;
939-
u32 load_options_size;
940-
u64 load_options;
941-
u64 image_base;
942-
__aligned_u64 image_size;
943-
unsigned int image_code_type;
944-
unsigned int image_data_type;
945-
u64 unload;
946-
} efi_loaded_image_64_t;
947-
948787
typedef union efi_loaded_image efi_loaded_image_t;
949788

950789
union efi_loaded_image {
@@ -991,34 +830,6 @@ typedef struct {
991830
efi_char16_t filename[1];
992831
} efi_file_info_t;
993832

994-
typedef struct {
995-
u64 revision;
996-
u32 open;
997-
u32 close;
998-
u32 delete;
999-
u32 read;
1000-
u32 write;
1001-
u32 get_position;
1002-
u32 set_position;
1003-
u32 get_info;
1004-
u32 set_info;
1005-
u32 flush;
1006-
} efi_file_handle_32_t;
1007-
1008-
typedef struct {
1009-
u64 revision;
1010-
u64 open;
1011-
u64 close;
1012-
u64 delete;
1013-
u64 read;
1014-
u64 write;
1015-
u64 get_position;
1016-
u64 set_position;
1017-
u64 get_info;
1018-
u64 set_info;
1019-
u64 flush;
1020-
} efi_file_handle_64_t;
1021-
1022833
typedef union efi_file_handle efi_file_handle_t;
1023834

1024835
union efi_file_handle {
@@ -1054,16 +865,6 @@ union efi_file_handle {
1054865
} mixed_mode;
1055866
};
1056867

1057-
typedef struct {
1058-
u64 revision;
1059-
u32 open_volume;
1060-
} efi_file_io_interface_32_t;
1061-
1062-
typedef struct {
1063-
u64 revision;
1064-
u64 open_volume;
1065-
} efi_file_io_interface_64_t;
1066-
1067868
typedef union efi_file_io_interface efi_file_io_interface_t;
1068869

1069870
union efi_file_io_interface {
@@ -1076,7 +877,7 @@ union efi_file_io_interface {
1076877
u64 revision;
1077878
u32 open_volume;
1078879
} mixed_mode;
1079-
} ;
880+
};
1080881

1081882
#define EFI_FILE_MODE_READ 0x0000000000000001
1082883
#define EFI_FILE_MODE_WRITE 0x0000000000000002
@@ -1536,18 +1337,6 @@ struct efivar_entry {
15361337
bool deleting;
15371338
};
15381339

1539-
typedef struct {
1540-
u32 reset;
1541-
u32 output_string;
1542-
u32 test_string;
1543-
} efi_simple_text_output_protocol_32_t;
1544-
1545-
typedef struct {
1546-
u64 reset;
1547-
u64 output_string;
1548-
u64 test_string;
1549-
} efi_simple_text_output_protocol_64_t;
1550-
15511340
typedef union efi_simple_text_output_protocol efi_simple_text_output_protocol_t;
15521341

15531342
union efi_simple_text_output_protocol {
@@ -1586,24 +1375,6 @@ typedef struct {
15861375
u32 pixels_per_scan_line;
15871376
} efi_graphics_output_mode_info_t;
15881377

1589-
typedef struct {
1590-
u32 max_mode;
1591-
u32 mode;
1592-
u32 info;
1593-
u32 size_of_info;
1594-
u64 frame_buffer_base;
1595-
u32 frame_buffer_size;
1596-
} efi_graphics_output_protocol_mode_32_t;
1597-
1598-
typedef struct {
1599-
u32 max_mode;
1600-
u32 mode;
1601-
u64 info;
1602-
u64 size_of_info;
1603-
u64 frame_buffer_base;
1604-
u64 frame_buffer_size;
1605-
} efi_graphics_output_protocol_mode_64_t;
1606-
16071378
typedef union efi_graphics_output_protocol_mode efi_graphics_output_protocol_mode_t;
16081379

16091380
union efi_graphics_output_protocol_mode {
@@ -1625,20 +1396,6 @@ union efi_graphics_output_protocol_mode {
16251396
} mixed_mode;
16261397
};
16271398

1628-
typedef struct {
1629-
u32 query_mode;
1630-
u32 set_mode;
1631-
u32 blt;
1632-
u32 mode;
1633-
} efi_graphics_output_protocol_32_t;
1634-
1635-
typedef struct {
1636-
u64 query_mode;
1637-
u64 set_mode;
1638-
u64 blt;
1639-
u64 mode;
1640-
} efi_graphics_output_protocol_64_t;
1641-
16421399
typedef union efi_graphics_output_protocol efi_graphics_output_protocol_t;
16431400

16441401
union efi_graphics_output_protocol {

0 commit comments

Comments
 (0)