aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Franz <roy.franz@linaro.org>2013-09-22 18:45:26 -0400
committerMatt Fleming <matt.fleming@intel.com>2013-09-25 07:34:33 -0400
commited37ddffe201bfad7be3c45bc08bd65b5298adca (patch)
tree34eb23b5279096eb5213281487d66ade8c727cd1
parent4172fe2f8a479e2237459918edc83b027efa8808 (diff)
efi: Add proper definitions for some EFI function pointers.
The x86/AMD64 EFI stubs must use a call wrapper to convert between the Linux and EFI ABIs, so void pointers are sufficient. For ARM, the ABIs are compatible, so we can directly invoke the function pointers. The functions that are used by the ARM stub are updated to match the EFI definitions. Also add some EFI types used by EFI functions. Signed-off-by: Roy Franz <roy.franz@linaro.org> Acked-by: Mark Salter <msalter@redhat.com> Reviewed-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--arch/x86/boot/compressed/eboot.h8
-rw-r--r--include/linux/efi.h50
2 files changed, 34 insertions, 24 deletions
diff --git a/arch/x86/boot/compressed/eboot.h b/arch/x86/boot/compressed/eboot.h
index e5b0a8f91c5f..02265107cce3 100644
--- a/arch/x86/boot/compressed/eboot.h
+++ b/arch/x86/boot/compressed/eboot.h
@@ -10,8 +10,6 @@
10#define SEG_GRANULARITY_4KB (1 << 0) 10#define SEG_GRANULARITY_4KB (1 << 0)
11 11
12#define DESC_TYPE_CODE_DATA (1 << 0) 12#define DESC_TYPE_CODE_DATA (1 << 0)
13
14#define EFI_PAGE_SIZE (1UL << EFI_PAGE_SHIFT)
15#define EFI_READ_CHUNK_SIZE (1024 * 1024) 13#define EFI_READ_CHUNK_SIZE (1024 * 1024)
16 14
17#define EFI_CONSOLE_OUT_DEVICE_GUID \ 15#define EFI_CONSOLE_OUT_DEVICE_GUID \
@@ -62,10 +60,4 @@ struct efi_uga_draw_protocol {
62 void *blt; 60 void *blt;
63}; 61};
64 62
65struct efi_simple_text_output_protocol {
66 void *reset;
67 void *output_string;
68 void *test_string;
69};
70
71#endif /* BOOT_COMPRESSED_EBOOT_H */ 63#endif /* BOOT_COMPRESSED_EBOOT_H */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index c084b6d942c3..bc5687d0f315 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -39,6 +39,8 @@
39typedef unsigned long efi_status_t; 39typedef unsigned long efi_status_t;
40typedef u8 efi_bool_t; 40typedef u8 efi_bool_t;
41typedef u16 efi_char16_t; /* UNICODE character */ 41typedef u16 efi_char16_t; /* UNICODE character */
42typedef u64 efi_physical_addr_t;
43typedef void *efi_handle_t;
42 44
43 45
44typedef struct { 46typedef struct {
@@ -96,6 +98,7 @@ typedef struct {
96#define EFI_MEMORY_DESCRIPTOR_VERSION 1 98#define EFI_MEMORY_DESCRIPTOR_VERSION 1
97 99
98#define EFI_PAGE_SHIFT 12 100#define EFI_PAGE_SHIFT 12
101#define EFI_PAGE_SIZE (1UL << EFI_PAGE_SHIFT)
99 102
100typedef struct { 103typedef struct {
101 u32 type; 104 u32 type;
@@ -157,11 +160,13 @@ typedef struct {
157 efi_table_hdr_t hdr; 160 efi_table_hdr_t hdr;
158 void *raise_tpl; 161 void *raise_tpl;
159 void *restore_tpl; 162 void *restore_tpl;
160 void *allocate_pages; 163 efi_status_t (*allocate_pages)(int, int, unsigned long,
161 void *free_pages; 164 efi_physical_addr_t *);
162 void *get_memory_map; 165 efi_status_t (*free_pages)(efi_physical_addr_t, unsigned long);
163 void *allocate_pool; 166 efi_status_t (*get_memory_map)(unsigned long *, void *, unsigned long *,
164 void *free_pool; 167 unsigned long *, u32 *);
168 efi_status_t (*allocate_pool)(int, unsigned long, void **);
169 efi_status_t (*free_pool)(void *);
165 void *create_event; 170 void *create_event;
166 void *set_timer; 171 void *set_timer;
167 void *wait_for_event; 172 void *wait_for_event;
@@ -171,7 +176,7 @@ typedef struct {
171 void *install_protocol_interface; 176 void *install_protocol_interface;
172 void *reinstall_protocol_interface; 177 void *reinstall_protocol_interface;
173 void *uninstall_protocol_interface; 178 void *uninstall_protocol_interface;
174 void *handle_protocol; 179 efi_status_t (*handle_protocol)(efi_handle_t, efi_guid_t *, void **);
175 void *__reserved; 180 void *__reserved;
176 void *register_protocol_notify; 181 void *register_protocol_notify;
177 void *locate_handle; 182 void *locate_handle;
@@ -181,7 +186,7 @@ typedef struct {
181 void *start_image; 186 void *start_image;
182 void *exit; 187 void *exit;
183 void *unload_image; 188 void *unload_image;
184 void *exit_boot_services; 189 efi_status_t (*exit_boot_services)(efi_handle_t, unsigned long);
185 void *get_next_monotonic_count; 190 void *get_next_monotonic_count;
186 void *stall; 191 void *stall;
187 void *set_watchdog_timer; 192 void *set_watchdog_timer;
@@ -494,10 +499,6 @@ typedef struct {
494 unsigned long unload; 499 unsigned long unload;
495} efi_loaded_image_t; 500} efi_loaded_image_t;
496 501
497typedef struct {
498 u64 revision;
499 void *open_volume;
500} efi_file_io_interface_t;
501 502
502typedef struct { 503typedef struct {
503 u64 size; 504 u64 size;
@@ -510,20 +511,30 @@ typedef struct {
510 efi_char16_t filename[1]; 511 efi_char16_t filename[1];
511} efi_file_info_t; 512} efi_file_info_t;
512 513
513typedef struct { 514typedef struct _efi_file_handle {
514 u64 revision; 515 u64 revision;
515 void *open; 516 efi_status_t (*open)(struct _efi_file_handle *,
516 void *close; 517 struct _efi_file_handle **,
518 efi_char16_t *, u64, u64);
519 efi_status_t (*close)(struct _efi_file_handle *);
517 void *delete; 520 void *delete;
518 void *read; 521 efi_status_t (*read)(struct _efi_file_handle *, unsigned long *,
522 void *);
519 void *write; 523 void *write;
520 void *get_position; 524 void *get_position;
521 void *set_position; 525 void *set_position;
522 void *get_info; 526 efi_status_t (*get_info)(struct _efi_file_handle *, efi_guid_t *,
527 unsigned long *, void *);
523 void *set_info; 528 void *set_info;
524 void *flush; 529 void *flush;
525} efi_file_handle_t; 530} efi_file_handle_t;
526 531
532typedef struct _efi_file_io_interface {
533 u64 revision;
534 int (*open_volume)(struct _efi_file_io_interface *,
535 efi_file_handle_t **);
536} efi_file_io_interface_t;
537
527#define EFI_FILE_MODE_READ 0x0000000000000001 538#define EFI_FILE_MODE_READ 0x0000000000000001
528#define EFI_FILE_MODE_WRITE 0x0000000000000002 539#define EFI_FILE_MODE_WRITE 0x0000000000000002
529#define EFI_FILE_MODE_CREATE 0x8000000000000000 540#define EFI_FILE_MODE_CREATE 0x8000000000000000
@@ -792,6 +803,13 @@ struct efivar_entry {
792 struct kobject kobj; 803 struct kobject kobj;
793}; 804};
794 805
806
807struct efi_simple_text_output_protocol {
808 void *reset;
809 efi_status_t (*output_string)(void *, void *);
810 void *test_string;
811};
812
795extern struct list_head efivar_sysfs_list; 813extern struct list_head efivar_sysfs_list;
796 814
797static inline void 815static inline void