diff options
author | Olof Johansson <olof@lixom.net> | 2012-02-12 16:24:29 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-02-23 21:54:51 -0500 |
commit | 1adbfa3511ee1c1118e16a9a0246870f12fef4e6 (patch) | |
tree | 7bcdb0f37a98cdb7e97b996eda10a5aeca89c50f /include/linux/efi.h | |
parent | 140bf275d3e89e9b36851d5cf498dbbbecdf7ca8 (diff) |
x86, efi: Allow basic init with mixed 32/64-bit efi/kernel
Traditionally the kernel has refused to setup EFI at all if there's been
a mismatch in 32/64-bit mode between EFI and the kernel.
On some platforms that boot natively through EFI (Chrome OS being one),
we still need to get at least some of the static data such as memory
configuration out of EFI. Runtime services aren't as critical, and
it's a significant amount of work to implement switching between the
operating modes to call between kernel and firmware for thise cases. So
I'm ignoring it for now.
v5:
* Fixed some printk strings based on feedback
* Renamed 32/64-bit specific types to not have _ prefix
* Fixed bug in printout of efi runtime disablement
v4:
* Some of the earlier cleanup was accidentally reverted by this patch, fixed.
* Reworded some messages to not have to line wrap printk strings
v3:
* Reorganized to a series of patches to make it easier to review, and
do some of the cleanups I had left out before.
v2:
* Added graceful error handling for 32-bit kernel that gets passed
EFI data above 4GB.
* Removed some warnings that were missed in first version.
Signed-off-by: Olof Johansson <olof@lixom.net>
Link: http://lkml.kernel.org/r/1329081869-20779-6-git-send-email-olof@lixom.net
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'include/linux/efi.h')
-rw-r--r-- | include/linux/efi.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h index 37c300712e02..47fbf6b3dc77 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -315,6 +315,16 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, | |||
315 | 315 | ||
316 | typedef struct { | 316 | typedef struct { |
317 | efi_guid_t guid; | 317 | efi_guid_t guid; |
318 | u64 table; | ||
319 | } efi_config_table_64_t; | ||
320 | |||
321 | typedef struct { | ||
322 | efi_guid_t guid; | ||
323 | u32 table; | ||
324 | } efi_config_table_32_t; | ||
325 | |||
326 | typedef struct { | ||
327 | efi_guid_t guid; | ||
318 | unsigned long table; | 328 | unsigned long table; |
319 | } efi_config_table_t; | 329 | } efi_config_table_t; |
320 | 330 | ||
@@ -329,6 +339,40 @@ typedef struct { | |||
329 | 339 | ||
330 | typedef struct { | 340 | typedef struct { |
331 | efi_table_hdr_t hdr; | 341 | efi_table_hdr_t hdr; |
342 | u64 fw_vendor; /* physical addr of CHAR16 vendor string */ | ||
343 | u32 fw_revision; | ||
344 | u32 __pad1; | ||
345 | u64 con_in_handle; | ||
346 | u64 con_in; | ||
347 | u64 con_out_handle; | ||
348 | u64 con_out; | ||
349 | u64 stderr_handle; | ||
350 | u64 stderr; | ||
351 | u64 runtime; | ||
352 | u64 boottime; | ||
353 | u32 nr_tables; | ||
354 | u32 __pad2; | ||
355 | u64 tables; | ||
356 | } efi_system_table_64_t; | ||
357 | |||
358 | typedef struct { | ||
359 | efi_table_hdr_t hdr; | ||
360 | u32 fw_vendor; /* physical addr of CHAR16 vendor string */ | ||
361 | u32 fw_revision; | ||
362 | u32 con_in_handle; | ||
363 | u32 con_in; | ||
364 | u32 con_out_handle; | ||
365 | u32 con_out; | ||
366 | u32 stderr_handle; | ||
367 | u32 stderr; | ||
368 | u32 runtime; | ||
369 | u32 boottime; | ||
370 | u32 nr_tables; | ||
371 | u32 tables; | ||
372 | } efi_system_table_32_t; | ||
373 | |||
374 | typedef struct { | ||
375 | efi_table_hdr_t hdr; | ||
332 | unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */ | 376 | unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */ |
333 | u32 fw_revision; | 377 | u32 fw_revision; |
334 | unsigned long con_in_handle; | 378 | unsigned long con_in_handle; |
@@ -497,6 +541,7 @@ extern int __init efi_setup_pcdp_console(char *); | |||
497 | #ifdef CONFIG_EFI | 541 | #ifdef CONFIG_EFI |
498 | # ifdef CONFIG_X86 | 542 | # ifdef CONFIG_X86 |
499 | extern int efi_enabled; | 543 | extern int efi_enabled; |
544 | extern bool efi_64bit; | ||
500 | # else | 545 | # else |
501 | # define efi_enabled 1 | 546 | # define efi_enabled 1 |
502 | # endif | 547 | # endif |