]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/efi.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
[mirror_ubuntu-bionic-kernel.git] / include / linux / efi.h
index 2362a0bc7f0dbfe0c4cb7df2e31ef769ebcbdacc..37c300712e025c2138f8627033b82ff9584683c6 100644 (file)
@@ -109,6 +109,14 @@ typedef struct {
        u32 imagesize;
 } efi_capsule_header_t;
 
+/*
+ * Allocation types for calls to boottime->allocate_pages.
+ */
+#define EFI_ALLOCATE_ANY_PAGES         0
+#define EFI_ALLOCATE_MAX_ADDRESS       1
+#define EFI_ALLOCATE_ADDRESS           2
+#define EFI_MAX_ALLOCATE_TYPE          3
+
 typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg);
 
 /*
@@ -138,6 +146,57 @@ typedef struct {
        u8 sets_to_zero;
 } efi_time_cap_t;
 
+/*
+ * EFI Boot Services table
+ */
+typedef struct {
+       efi_table_hdr_t hdr;
+       void *raise_tpl;
+       void *restore_tpl;
+       void *allocate_pages;
+       void *free_pages;
+       void *get_memory_map;
+       void *allocate_pool;
+       void *free_pool;
+       void *create_event;
+       void *set_timer;
+       void *wait_for_event;
+       void *signal_event;
+       void *close_event;
+       void *check_event;
+       void *install_protocol_interface;
+       void *reinstall_protocol_interface;
+       void *uninstall_protocol_interface;
+       void *handle_protocol;
+       void *__reserved;
+       void *register_protocol_notify;
+       void *locate_handle;
+       void *locate_device_path;
+       void *install_configuration_table;
+       void *load_image;
+       void *start_image;
+       void *exit;
+       void *unload_image;
+       void *exit_boot_services;
+       void *get_next_monotonic_count;
+       void *stall;
+       void *set_watchdog_timer;
+       void *connect_controller;
+       void *disconnect_controller;
+       void *open_protocol;
+       void *close_protocol;
+       void *open_protocol_information;
+       void *protocols_per_handle;
+       void *locate_handle_buffer;
+       void *locate_protocol;
+       void *install_multiple_protocol_interfaces;
+       void *uninstall_multiple_protocol_interfaces;
+       void *calculate_crc32;
+       void *copy_mem;
+       void *set_mem;
+       void *create_event_ex;
+} efi_boot_services_t;
+
 /*
  * Types and defines for EFI ResetSystem
  */
@@ -236,6 +295,24 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
 #define LINUX_EFI_CRASH_GUID \
     EFI_GUID(  0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 )
 
+#define LOADED_IMAGE_PROTOCOL_GUID \
+    EFI_GUID(  0x5b1b31a1, 0x9562, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b )
+
+#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
+    EFI_GUID(  0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a )
+
+#define EFI_UGA_PROTOCOL_GUID \
+    EFI_GUID(  0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 )
+
+#define EFI_PCI_IO_PROTOCOL_GUID \
+    EFI_GUID(  0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a )
+
+#define EFI_FILE_INFO_ID \
+    EFI_GUID(  0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b )
+
+#define EFI_FILE_SYSTEM_GUID \
+    EFI_GUID(  0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b )
+
 typedef struct {
        efi_guid_t guid;
        unsigned long table;
@@ -261,7 +338,7 @@ typedef struct {
        unsigned long stderr_handle;
        unsigned long stderr;
        efi_runtime_services_t *runtime;
-       unsigned long boottime;
+       efi_boot_services_t *boottime;
        unsigned long nr_tables;
        unsigned long tables;
 } efi_system_table_t;
@@ -275,6 +352,56 @@ struct efi_memory_map {
        unsigned long desc_size;
 };
 
+typedef struct {
+       u32 revision;
+       void *parent_handle;
+       efi_system_table_t *system_table;
+       void *device_handle;
+       void *file_path;
+       void *reserved;
+       u32 load_options_size;
+       void *load_options;
+       void *image_base;
+       __aligned_u64 image_size;
+       unsigned int image_code_type;
+       unsigned int image_data_type;
+       unsigned long unload;
+} efi_loaded_image_t;
+
+typedef struct {
+       u64 revision;
+       void *open_volume;
+} efi_file_io_interface_t;
+
+typedef struct {
+       u64 size;
+       u64 file_size;
+       u64 phys_size;
+       efi_time_t create_time;
+       efi_time_t last_access_time;
+       efi_time_t modification_time;
+       __aligned_u64 attribute;
+       efi_char16_t filename[1];
+} efi_file_info_t;
+
+typedef struct {
+       u64 revision;
+       void *open;
+       void *close;
+       void *delete;
+       void *read;
+       void *write;
+       void *get_position;
+       void *set_position;
+       void *get_info;
+       void *set_info;
+       void *flush;
+} efi_file_handle_t;
+
+#define EFI_FILE_MODE_READ     0x0000000000000001
+#define EFI_FILE_MODE_WRITE    0x0000000000000002
+#define EFI_FILE_MODE_CREATE   0x8000000000000000
+
 #define EFI_INVALID_TABLE_ADDR         (~0UL)
 
 /*
@@ -384,6 +511,13 @@ extern int __init efi_setup_pcdp_console(char *);
 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002
 #define EFI_VARIABLE_RUNTIME_ACCESS     0x0000000000000004
 
+/*
+ * The type of search to perform when calling boottime->locate_handle
+ */
+#define EFI_LOCATE_ALL_HANDLES                 0
+#define EFI_LOCATE_BY_REGISTER_NOTIFY          1
+#define EFI_LOCATE_BY_PROTOCOL                 2
+
 /*
  * EFI Device Path information
  */