From: Ard Biesheuvel <ardb@kernel.org>
To: linux-efi@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
Hans de Goede <hdegoede@redhat.com>,
Matthew Garrett <matthewgarrett@google.com>,
Ingo Molnar <mingo@kernel.org>, Andy Lutomirski <luto@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Arvind Sankar <nivedita@alum.mit.edu>
Subject: [PATCH v2 07/21] efi/libstub: drop explicit 32/64-bit protocol definitions
Date: Wed, 18 Dec 2019 19:01:25 +0200 [thread overview]
Message-ID: <20191218170139.9468-8-ardb@kernel.org> (raw)
In-Reply-To: <20191218170139.9468-1-ardb@kernel.org>
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 <ardb@kernel.org>
---
arch/x86/boot/compressed/eboot.h | 12 -
drivers/firmware/efi/libstub/random.c | 10 -
include/linux/efi.h | 233 +-------------------
3 files changed, 1 insertion(+), 254 deletions(-)
diff --git a/arch/x86/boot/compressed/eboot.h b/arch/x86/boot/compressed/eboot.h
index 26f1f2635f64..de13865dc7d2 100644
--- a/arch/x86/boot/compressed/eboot.h
+++ b/arch/x86/boot/compressed/eboot.h
@@ -12,18 +12,6 @@
#define DESC_TYPE_CODE_DATA (1 << 0)
-typedef struct {
- u32 get_mode;
- u32 set_mode;
- u32 blt;
-} efi_uga_draw_protocol_32_t;
-
-typedef struct {
- u64 get_mode;
- u64 set_mode;
- u64 blt;
-} efi_uga_draw_protocol_64_t;
-
typedef union {
struct {
void *get_mode;
diff --git a/drivers/firmware/efi/libstub/random.c b/drivers/firmware/efi/libstub/random.c
index d92cd640c73d..1a5a4a9db2a7 100644
--- a/drivers/firmware/efi/libstub/random.c
+++ b/drivers/firmware/efi/libstub/random.c
@@ -11,16 +11,6 @@
typedef union efi_rng_protocol efi_rng_protocol_t;
-typedef struct {
- u32 get_info;
- u32 get_rng;
-} efi_rng_protocol_32_t;
-
-typedef struct {
- u64 get_info;
- u64 get_rng;
-} efi_rng_protocol_64_t;
-
union efi_rng_protocol {
struct {
efi_status_t (*get_info)(efi_rng_protocol_t *,
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 2c33841d0d4a..d09ce1cea130 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -264,54 +264,6 @@ typedef struct {
u32 create_event_ex;
} __packed efi_boot_services_32_t;
-typedef struct {
- efi_table_hdr_t hdr;
- u64 raise_tpl;
- u64 restore_tpl;
- u64 allocate_pages;
- u64 free_pages;
- u64 get_memory_map;
- u64 allocate_pool;
- u64 free_pool;
- u64 create_event;
- u64 set_timer;
- u64 wait_for_event;
- u64 signal_event;
- u64 close_event;
- u64 check_event;
- u64 install_protocol_interface;
- u64 reinstall_protocol_interface;
- u64 uninstall_protocol_interface;
- u64 handle_protocol;
- u64 __reserved;
- u64 register_protocol_notify;
- u64 locate_handle;
- u64 locate_device_path;
- u64 install_configuration_table;
- u64 load_image;
- u64 start_image;
- u64 exit;
- u64 unload_image;
- u64 exit_boot_services;
- u64 get_next_monotonic_count;
- u64 stall;
- u64 set_watchdog_timer;
- u64 connect_controller;
- u64 disconnect_controller;
- u64 open_protocol;
- u64 close_protocol;
- u64 open_protocol_information;
- u64 protocols_per_handle;
- u64 locate_handle_buffer;
- u64 locate_protocol;
- u64 install_multiple_protocol_interfaces;
- u64 uninstall_multiple_protocol_interfaces;
- u64 calculate_crc32;
- u64 copy_mem;
- u64 set_mem;
- u64 create_event_ex;
-} __packed efi_boot_services_64_t;
-
/*
* EFI Boot Services table
*/
@@ -399,11 +351,6 @@ typedef struct {
u32 write;
} efi_pci_io_protocol_access_32_t;
-typedef struct {
- u64 read;
- u64 write;
-} efi_pci_io_protocol_access_64_t;
-
typedef union efi_pci_io_protocol efi_pci_io_protocol_t;
typedef
@@ -428,46 +375,6 @@ typedef struct {
efi_pci_io_protocol_cfg_t write;
} efi_pci_io_protocol_config_access_t;
-typedef struct {
- u32 poll_mem;
- u32 poll_io;
- efi_pci_io_protocol_access_32_t mem;
- efi_pci_io_protocol_access_32_t io;
- efi_pci_io_protocol_access_32_t pci;
- u32 copy_mem;
- u32 map;
- u32 unmap;
- u32 allocate_buffer;
- u32 free_buffer;
- u32 flush;
- u32 get_location;
- u32 attributes;
- u32 get_bar_attributes;
- u32 set_bar_attributes;
- u64 romsize;
- u32 romimage;
-} efi_pci_io_protocol_32_t;
-
-typedef struct {
- u64 poll_mem;
- u64 poll_io;
- efi_pci_io_protocol_access_64_t mem;
- efi_pci_io_protocol_access_64_t io;
- efi_pci_io_protocol_access_64_t pci;
- u64 copy_mem;
- u64 map;
- u64 unmap;
- u64 allocate_buffer;
- u64 free_buffer;
- u64 flush;
- u64 get_location;
- u64 attributes;
- u64 get_bar_attributes;
- u64 set_bar_attributes;
- u64 romsize;
- u64 romimage;
-} efi_pci_io_protocol_64_t;
-
union efi_pci_io_protocol {
struct {
void *poll_mem;
@@ -529,22 +436,6 @@ union efi_pci_io_protocol {
#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000
#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000
-typedef struct {
- u32 version;
- u32 get;
- u32 set;
- u32 del;
- u32 get_all;
-} apple_properties_protocol_32_t;
-
-typedef struct {
- u64 version;
- u64 get;
- u64 set;
- u64 del;
- u64 get_all;
-} apple_properties_protocol_64_t;
-
struct efi_dev_path;
typedef union apple_properties_protocol apple_properties_protocol_t;
@@ -572,26 +463,6 @@ union apple_properties_protocol {
} mixed_mode;
};
-typedef struct {
- u32 get_capability;
- u32 get_event_log;
- u32 hash_log_extend_event;
- u32 submit_command;
- u32 get_active_pcr_banks;
- u32 set_active_pcr_banks;
- u32 get_result_of_set_active_pcr_banks;
-} efi_tcg2_protocol_32_t;
-
-typedef struct {
- u64 get_capability;
- u64 get_event_log;
- u64 hash_log_extend_event;
- u64 submit_command;
- u64 get_active_pcr_banks;
- u64 set_active_pcr_banks;
- u64 get_result_of_set_active_pcr_banks;
-} efi_tcg2_protocol_64_t;
-
typedef u32 efi_tcg2_event_log_format;
typedef union efi_tcg2_protocol efi_tcg2_protocol_t;
@@ -921,38 +792,6 @@ struct efi_fdt_params {
u32 desc_ver;
};
-typedef struct {
- u32 revision;
- u32 parent_handle;
- u32 system_table;
- u32 device_handle;
- u32 file_path;
- u32 reserved;
- u32 load_options_size;
- u32 load_options;
- u32 image_base;
- __aligned_u64 image_size;
- unsigned int image_code_type;
- unsigned int image_data_type;
- u32 unload;
-} efi_loaded_image_32_t;
-
-typedef struct {
- u32 revision;
- u64 parent_handle;
- u64 system_table;
- u64 device_handle;
- u64 file_path;
- u64 reserved;
- u32 load_options_size;
- u64 load_options;
- u64 image_base;
- __aligned_u64 image_size;
- unsigned int image_code_type;
- unsigned int image_data_type;
- u64 unload;
-} efi_loaded_image_64_t;
-
typedef union efi_loaded_image efi_loaded_image_t;
union efi_loaded_image {
@@ -999,34 +838,6 @@ typedef struct {
efi_char16_t filename[1];
} efi_file_info_t;
-typedef struct {
- u64 revision;
- u32 open;
- u32 close;
- u32 delete;
- u32 read;
- u32 write;
- u32 get_position;
- u32 set_position;
- u32 get_info;
- u32 set_info;
- u32 flush;
-} efi_file_handle_32_t;
-
-typedef struct {
- u64 revision;
- u64 open;
- u64 close;
- u64 delete;
- u64 read;
- u64 write;
- u64 get_position;
- u64 set_position;
- u64 get_info;
- u64 set_info;
- u64 flush;
-} efi_file_handle_64_t;
-
typedef union efi_file_handle efi_file_handle_t;
union efi_file_handle {
@@ -1062,16 +873,6 @@ union efi_file_handle {
} mixed_mode;
};
-typedef struct {
- u64 revision;
- u32 open_volume;
-} efi_file_io_interface_32_t;
-
-typedef struct {
- u64 revision;
- u64 open_volume;
-} efi_file_io_interface_64_t;
-
typedef union efi_file_io_interface efi_file_io_interface_t;
union efi_file_io_interface {
@@ -1084,7 +885,7 @@ union efi_file_io_interface {
u64 revision;
u32 open_volume;
} mixed_mode;
-} ;
+};
#define EFI_FILE_MODE_READ 0x0000000000000001
#define EFI_FILE_MODE_WRITE 0x0000000000000002
@@ -1591,24 +1392,6 @@ typedef struct {
u32 pixels_per_scan_line;
} efi_graphics_output_mode_info_t;
-typedef struct {
- u32 max_mode;
- u32 mode;
- u32 info;
- u32 size_of_info;
- u64 frame_buffer_base;
- u32 frame_buffer_size;
-} efi_graphics_output_protocol_mode_32_t;
-
-typedef struct {
- u32 max_mode;
- u32 mode;
- u64 info;
- u64 size_of_info;
- u64 frame_buffer_base;
- u64 frame_buffer_size;
-} efi_graphics_output_protocol_mode_64_t;
-
typedef union efi_graphics_output_protocol_mode efi_graphics_output_protocol_mode_t;
union efi_graphics_output_protocol_mode {
@@ -1630,20 +1413,6 @@ union efi_graphics_output_protocol_mode {
} mixed_mode;
};
-typedef struct {
- u32 query_mode;
- u32 set_mode;
- u32 blt;
- u32 mode;
-} efi_graphics_output_protocol_32_t;
-
-typedef struct {
- u64 query_mode;
- u64 set_mode;
- u64 blt;
- u64 mode;
-} efi_graphics_output_protocol_64_t;
-
typedef union efi_graphics_output_protocol efi_graphics_output_protocol_t;
union efi_graphics_output_protocol {
--
2.17.1
next prev parent reply other threads:[~2019-12-18 17:02 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-18 17:01 [PATCH v2 00/21] efi/x86: confine type unsafe casting to mixed mode Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 01/21] efi/libstub: remove unused __efi_call_early() macro Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 02/21] efi/x86: rename efi_is_native() to efi_is_mixed() Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 03/21] efi/libstub: use a helper to iterate over a EFI handle array Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 04/21] efi/libstub: extend native protocol definitions with mixed_mode aliases Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 05/21] efi/libstub: distinguish between native/mixed not 32/64 bit Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 06/21] efi/libstub/x86: use mixed mode helpers to populate efi_config Ard Biesheuvel
2019-12-18 17:01 ` Ard Biesheuvel [this message]
2019-12-18 17:01 ` [PATCH v2 08/21] efi/libstub: use stricter typing for firmware function pointers Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 09/21] efi/libstub: annotate firmware routines as __efiapi Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 10/21] efi/libstub/x86: avoid thunking for native firmware calls Ard Biesheuvel
2019-12-21 21:22 ` Hans de Goede
2019-12-22 12:02 ` Ard Biesheuvel
2019-12-22 12:37 ` Ard Biesheuvel
2019-12-22 12:46 ` Andy Lutomirski
2019-12-22 15:29 ` Ard Biesheuvel
2019-12-22 21:12 ` Arvind Sankar
2019-12-22 21:25 ` Ard Biesheuvel
2019-12-23 11:49 ` Hans de Goede
2019-12-23 12:00 ` Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 11/21] efi/libstub: get rid of 'sys_table_arg' macro parameter Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 12/21] efi/libstub: unify the efi_char16_printk implementations Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 13/21] efi/libstub/x86: drop __efi_early() export of efi_config struct Ard Biesheuvel
2019-12-24 19:34 ` Hans de Goede
2019-12-25 14:42 ` Ard Biesheuvel
2019-12-27 22:44 ` Hans de Goede
2019-12-27 22:51 ` Ard Biesheuvel
2019-12-31 23:04 ` Arvind Sankar
2020-01-01 18:13 ` Ard Biesheuvel
2020-01-01 19:08 ` Arvind Sankar
2020-01-02 7:33 ` Ard Biesheuvel
2020-01-02 14:06 ` Arvind Sankar
2020-01-02 15:20 ` Ard Biesheuvel
2020-01-02 15:51 ` Arvind Sankar
2020-01-02 15:58 ` Ard Biesheuvel
2020-01-02 16:28 ` Ard Biesheuvel
2020-01-02 16:59 ` Ard Biesheuvel
2020-01-02 17:26 ` Arvind Sankar
2020-01-02 17:30 ` Ard Biesheuvel
2020-01-02 17:41 ` Arvind Sankar
2020-01-02 17:48 ` Ard Biesheuvel
2020-01-02 18:10 ` Arvind Sankar
2020-01-02 18:38 ` Ard Biesheuvel
2020-01-03 14:16 ` Arvind Sankar
2020-01-03 14:23 ` Ard Biesheuvel
2020-01-02 18:38 ` Arvind Sankar
2020-01-02 16:59 ` Arvind Sankar
2020-01-02 17:03 ` Ard Biesheuvel
2020-01-02 17:21 ` Arvind Sankar
2019-12-18 17:01 ` [PATCH v2 14/21] efi/libstub: drop sys_table_arg from printk routines Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 15/21] efi/libstub: remove 'sys_table_arg' from all function prototypes Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 16/21] efi/libstub: drop protocol argument from efi_call_proto() macro Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 17/21] efi/libstub: drop 'table' argument from efi_table_attr() macro Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 18/21] efi/libstub: use 'func' not 'f' as macro parameter Ard Biesheuvel
2019-12-31 16:51 ` Arvind Sankar
2019-12-31 17:06 ` Ard Biesheuvel
2019-12-31 17:36 ` Arvind Sankar
2019-12-18 17:01 ` [PATCH v2 19/21] efi/libstub: tidy up types and names of global cmdline variables Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 20/21] efi/libstub: import type definitions for creating and signalling events Ard Biesheuvel
2019-12-18 17:01 ` [PATCH v2 21/21] efi: Allow disabling PCI busmastering on bridges during boot Ard Biesheuvel
2019-12-19 2:50 ` Andy Lutomirski
2019-12-19 13:17 ` Ard Biesheuvel
2019-12-19 20:04 ` Matthew Garrett
2019-12-19 20:04 ` Matthew Garrett
2019-12-20 7:06 ` Ard Biesheuvel
2019-12-20 7:17 ` Andy Lutomirski
2019-12-20 8:11 ` Ard Biesheuvel
2019-12-20 19:41 ` Arvind Sankar
2020-01-02 14:46 ` Laszlo Ersek
2020-01-02 15:40 ` Ard Biesheuvel
2019-12-20 20:43 ` Matthew Garrett
2019-12-21 16:44 ` Ard Biesheuvel
2019-12-21 21:24 ` Matthew Garrett
2019-12-21 22:54 ` Arvind Sankar
2019-12-23 14:02 ` Ard Biesheuvel
2019-12-23 15:46 ` Arvind Sankar
2019-12-23 15:58 ` Ard Biesheuvel
2019-12-23 16:12 ` Arvind Sankar
2019-12-23 20:57 ` Matthew Garrett
2020-02-06 14:30 ` Hans de Goede
2020-02-06 14:35 ` Ard Biesheuvel
2020-03-04 10:38 ` Hans de Goede
2020-03-04 18:26 ` Ard Biesheuvel
2020-03-04 18:49 ` Hans de Goede
2020-03-04 21:59 ` Ard Biesheuvel
2019-12-19 11:12 ` [PATCH v2 00/21] efi/x86: confine type unsafe casting to mixed mode Hans de Goede
2019-12-19 13:22 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191218170139.9468-8-ardb@kernel.org \
--to=ardb@kernel.org \
--cc=hdegoede@redhat.com \
--cc=linux-efi@vger.kernel.org \
--cc=luto@kernel.org \
--cc=matthewgarrett@google.com \
--cc=mingo@kernel.org \
--cc=nivedita@alum.mit.edu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).