aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/efi.h
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2011-06-06 15:36:25 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2011-06-06 16:30:30 -0400
commit3b3702377c576f6624348c7c6fd113bfd934fbd7 (patch)
treec68a394441a4269f37b63858fbd54166256893bb /include/linux/efi.h
parentf7a2d73fe75c71941fb0a6b4d8fe7da8144f2c7b (diff)
x86, efi: Add infrastructure for UEFI 2.0 runtime services
We're currently missing support for any of the runtime service calls introduced with the UEFI 2.0 spec in 2006. Add the infrastructure for supporting them. Signed-off-by: Matthew Garrett <mjg@redhat.com> Link: http://lkml.kernel.org/r/1307388985-7852-2-git-send-email-mjg@redhat.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'include/linux/efi.h')
-rw-r--r--include/linux/efi.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 0758753a17a1..ec2572693925 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -101,6 +101,13 @@ typedef struct {
101 u64 attribute; 101 u64 attribute;
102} efi_memory_desc_t; 102} efi_memory_desc_t;
103 103
104typedef struct {
105 efi_guid_t guid;
106 u32 headersize;
107 u32 flags;
108 u32 imagesize;
109} efi_capsule_header_t;
110
104typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); 111typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg);
105 112
106/* 113/*
@@ -156,6 +163,9 @@ typedef struct {
156 unsigned long set_variable; 163 unsigned long set_variable;
157 unsigned long get_next_high_mono_count; 164 unsigned long get_next_high_mono_count;
158 unsigned long reset_system; 165 unsigned long reset_system;
166 unsigned long update_capsule;
167 unsigned long query_capsule_caps;
168 unsigned long query_variable_info;
159} efi_runtime_services_t; 169} efi_runtime_services_t;
160 170
161typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); 171typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc);
@@ -177,6 +187,17 @@ typedef efi_status_t efi_set_virtual_address_map_t (unsigned long memory_map_siz
177 unsigned long descriptor_size, 187 unsigned long descriptor_size,
178 u32 descriptor_version, 188 u32 descriptor_version,
179 efi_memory_desc_t *virtual_map); 189 efi_memory_desc_t *virtual_map);
190typedef efi_status_t efi_query_variable_info_t(u32 attr,
191 u64 *storage_space,
192 u64 *remaining_space,
193 u64 *max_variable_size);
194typedef efi_status_t efi_update_capsule_t(efi_capsule_header_t **capsules,
195 unsigned long count,
196 unsigned long sg_list);
197typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
198 unsigned long count,
199 u64 *max_size,
200 int *reset_type);
180 201
181/* 202/*
182 * EFI Configuration Table and GUID definitions 203 * EFI Configuration Table and GUID definitions
@@ -218,6 +239,13 @@ typedef struct {
218 239
219#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) 240#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL)
220 241
242#define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30))
243#define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20))
244#define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | (10))
245#define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00))
246#define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10))
247#define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02))
248
221typedef struct { 249typedef struct {
222 efi_table_hdr_t hdr; 250 efi_table_hdr_t hdr;
223 unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */ 251 unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */
@@ -250,6 +278,7 @@ struct efi_memory_map {
250 */ 278 */
251extern struct efi { 279extern struct efi {
252 efi_system_table_t *systab; /* EFI system table */ 280 efi_system_table_t *systab; /* EFI system table */
281 unsigned int runtime_version; /* Runtime services version */
253 unsigned long mps; /* MPS table */ 282 unsigned long mps; /* MPS table */
254 unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ 283 unsigned long acpi; /* ACPI table (IA64 ext 0.71) */
255 unsigned long acpi20; /* ACPI table (ACPI 2.0) */ 284 unsigned long acpi20; /* ACPI table (ACPI 2.0) */
@@ -266,6 +295,9 @@ extern struct efi {
266 efi_get_variable_t *get_variable; 295 efi_get_variable_t *get_variable;
267 efi_get_next_variable_t *get_next_variable; 296 efi_get_next_variable_t *get_next_variable;
268 efi_set_variable_t *set_variable; 297 efi_set_variable_t *set_variable;
298 efi_query_variable_info_t *query_variable_info;
299 efi_update_capsule_t *update_capsule;
300 efi_query_capsule_caps_t *query_capsule_caps;
269 efi_get_next_high_mono_count_t *get_next_high_mono_count; 301 efi_get_next_high_mono_count_t *get_next_high_mono_count;
270 efi_reset_system_t *reset_system; 302 efi_reset_system_t *reset_system;
271 efi_set_virtual_address_map_t *set_virtual_address_map; 303 efi_set_virtual_address_map_t *set_virtual_address_map;