aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/efi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/efi.h')
-rw-r--r--include/linux/efi.h136
1 files changed, 135 insertions, 1 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 2362a0bc7f0d..37c300712e02 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -109,6 +109,14 @@ typedef struct {
109 u32 imagesize; 109 u32 imagesize;
110} efi_capsule_header_t; 110} efi_capsule_header_t;
111 111
112/*
113 * Allocation types for calls to boottime->allocate_pages.
114 */
115#define EFI_ALLOCATE_ANY_PAGES 0
116#define EFI_ALLOCATE_MAX_ADDRESS 1
117#define EFI_ALLOCATE_ADDRESS 2
118#define EFI_MAX_ALLOCATE_TYPE 3
119
112typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); 120typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg);
113 121
114/* 122/*
@@ -139,6 +147,57 @@ typedef struct {
139} efi_time_cap_t; 147} efi_time_cap_t;
140 148
141/* 149/*
150 * EFI Boot Services table
151 */
152typedef struct {
153 efi_table_hdr_t hdr;
154 void *raise_tpl;
155 void *restore_tpl;
156 void *allocate_pages;
157 void *free_pages;
158 void *get_memory_map;
159 void *allocate_pool;
160 void *free_pool;
161 void *create_event;
162 void *set_timer;
163 void *wait_for_event;
164 void *signal_event;
165 void *close_event;
166 void *check_event;
167 void *install_protocol_interface;
168 void *reinstall_protocol_interface;
169 void *uninstall_protocol_interface;
170 void *handle_protocol;
171 void *__reserved;
172 void *register_protocol_notify;
173 void *locate_handle;
174 void *locate_device_path;
175 void *install_configuration_table;
176 void *load_image;
177 void *start_image;
178 void *exit;
179 void *unload_image;
180 void *exit_boot_services;
181 void *get_next_monotonic_count;
182 void *stall;
183 void *set_watchdog_timer;
184 void *connect_controller;
185 void *disconnect_controller;
186 void *open_protocol;
187 void *close_protocol;
188 void *open_protocol_information;
189 void *protocols_per_handle;
190 void *locate_handle_buffer;
191 void *locate_protocol;
192 void *install_multiple_protocol_interfaces;
193 void *uninstall_multiple_protocol_interfaces;
194 void *calculate_crc32;
195 void *copy_mem;
196 void *set_mem;
197 void *create_event_ex;
198} efi_boot_services_t;
199
200/*
142 * Types and defines for EFI ResetSystem 201 * Types and defines for EFI ResetSystem
143 */ 202 */
144#define EFI_RESET_COLD 0 203#define EFI_RESET_COLD 0
@@ -236,6 +295,24 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
236#define LINUX_EFI_CRASH_GUID \ 295#define LINUX_EFI_CRASH_GUID \
237 EFI_GUID( 0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 ) 296 EFI_GUID( 0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 )
238 297
298#define LOADED_IMAGE_PROTOCOL_GUID \
299 EFI_GUID( 0x5b1b31a1, 0x9562, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b )
300
301#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
302 EFI_GUID( 0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a )
303
304#define EFI_UGA_PROTOCOL_GUID \
305 EFI_GUID( 0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 )
306
307#define EFI_PCI_IO_PROTOCOL_GUID \
308 EFI_GUID( 0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a )
309
310#define EFI_FILE_INFO_ID \
311 EFI_GUID( 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b )
312
313#define EFI_FILE_SYSTEM_GUID \
314 EFI_GUID( 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b )
315
239typedef struct { 316typedef struct {
240 efi_guid_t guid; 317 efi_guid_t guid;
241 unsigned long table; 318 unsigned long table;
@@ -261,7 +338,7 @@ typedef struct {
261 unsigned long stderr_handle; 338 unsigned long stderr_handle;
262 unsigned long stderr; 339 unsigned long stderr;
263 efi_runtime_services_t *runtime; 340 efi_runtime_services_t *runtime;
264 unsigned long boottime; 341 efi_boot_services_t *boottime;
265 unsigned long nr_tables; 342 unsigned long nr_tables;
266 unsigned long tables; 343 unsigned long tables;
267} efi_system_table_t; 344} efi_system_table_t;
@@ -275,6 +352,56 @@ struct efi_memory_map {
275 unsigned long desc_size; 352 unsigned long desc_size;
276}; 353};
277 354
355typedef struct {
356 u32 revision;
357 void *parent_handle;
358 efi_system_table_t *system_table;
359 void *device_handle;
360 void *file_path;
361 void *reserved;
362 u32 load_options_size;
363 void *load_options;
364 void *image_base;
365 __aligned_u64 image_size;
366 unsigned int image_code_type;
367 unsigned int image_data_type;
368 unsigned long unload;
369} efi_loaded_image_t;
370
371typedef struct {
372 u64 revision;
373 void *open_volume;
374} efi_file_io_interface_t;
375
376typedef struct {
377 u64 size;
378 u64 file_size;
379 u64 phys_size;
380 efi_time_t create_time;
381 efi_time_t last_access_time;
382 efi_time_t modification_time;
383 __aligned_u64 attribute;
384 efi_char16_t filename[1];
385} efi_file_info_t;
386
387typedef struct {
388 u64 revision;
389 void *open;
390 void *close;
391 void *delete;
392 void *read;
393 void *write;
394 void *get_position;
395 void *set_position;
396 void *get_info;
397 void *set_info;
398 void *flush;
399} efi_file_handle_t;
400
401#define EFI_FILE_MODE_READ 0x0000000000000001
402#define EFI_FILE_MODE_WRITE 0x0000000000000002
403#define EFI_FILE_MODE_CREATE 0x8000000000000000
404
278#define EFI_INVALID_TABLE_ADDR (~0UL) 405#define EFI_INVALID_TABLE_ADDR (~0UL)
279 406
280/* 407/*
@@ -385,6 +512,13 @@ extern int __init efi_setup_pcdp_console(char *);
385#define EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004 512#define EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004
386 513
387/* 514/*
515 * The type of search to perform when calling boottime->locate_handle
516 */
517#define EFI_LOCATE_ALL_HANDLES 0
518#define EFI_LOCATE_BY_REGISTER_NOTIFY 1
519#define EFI_LOCATE_BY_PROTOCOL 2
520
521/*
388 * EFI Device Path information 522 * EFI Device Path information
389 */ 523 */
390#define EFI_DEV_HW 0x01 524#define EFI_DEV_HW 0x01