diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-25 15:30:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-25 15:30:01 -0400 |
commit | a2303849a6b4b7ba59667091e00d6bb194071d9a (patch) | |
tree | f7b357df247abcf4d72b1380e70615a7c7ca3e58 | |
parent | df00ccca7201dcb78847de68538486dbcfa5deba (diff) | |
parent | 7fb2b43c3252c9177825a0a49138cd16144b6b5e (diff) |
Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull EFI updates from Ingo Molnar:
"The biggest change in this cycle were SGI/UV related changes that
clean up and fix UV boot quirks and problems.
There's also various smaller cleanups and refinements"
* 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
efi: Reorganize the GUID table to make it easier to read
x86/efi: Remove the unused efi_get_time() function
x86/efi: Update efi_thunk() to use the the arch_efi_call_virt*() macros
x86/uv: Update uv_bios_call() to use efi_call_virt_pointer()
efi: Convert efi_call_virt() to efi_call_virt_pointer()
x86/efi: Remove unused variable 'efi'
efi: Document #define FOO_PROTOCOL_GUID layout
efibc: Report more information in the error messages
-rw-r--r-- | arch/arm/include/asm/efi.h | 4 | ||||
-rw-r--r-- | arch/arm64/include/asm/efi.h | 4 | ||||
-rw-r--r-- | arch/x86/boot/compressed/eboot.c | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/efi.h | 9 | ||||
-rw-r--r-- | arch/x86/platform/efi/efi.c | 15 | ||||
-rw-r--r-- | arch/x86/platform/efi/efi_64.c | 21 | ||||
-rw-r--r-- | arch/x86/platform/uv/bios_uv.c | 3 | ||||
-rw-r--r-- | drivers/firmware/efi/efibc.c | 4 | ||||
-rw-r--r-- | drivers/firmware/efi/runtime-wrappers.c | 53 | ||||
-rw-r--r-- | include/linux/efi.h | 200 |
10 files changed, 125 insertions, 190 deletions
diff --git a/arch/arm/include/asm/efi.h b/arch/arm/include/asm/efi.h index a708fa1f0905..766bf9b78160 100644 --- a/arch/arm/include/asm/efi.h +++ b/arch/arm/include/asm/efi.h | |||
@@ -28,10 +28,10 @@ int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md); | |||
28 | #define arch_efi_call_virt_setup() efi_virtmap_load() | 28 | #define arch_efi_call_virt_setup() efi_virtmap_load() |
29 | #define arch_efi_call_virt_teardown() efi_virtmap_unload() | 29 | #define arch_efi_call_virt_teardown() efi_virtmap_unload() |
30 | 30 | ||
31 | #define arch_efi_call_virt(f, args...) \ | 31 | #define arch_efi_call_virt(p, f, args...) \ |
32 | ({ \ | 32 | ({ \ |
33 | efi_##f##_t *__f; \ | 33 | efi_##f##_t *__f; \ |
34 | __f = efi.systab->runtime->f; \ | 34 | __f = p->f; \ |
35 | __f(args); \ | 35 | __f(args); \ |
36 | }) | 36 | }) |
37 | 37 | ||
diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index 622db3c6474e..bd887663689b 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h | |||
@@ -23,10 +23,10 @@ int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md); | |||
23 | efi_virtmap_load(); \ | 23 | efi_virtmap_load(); \ |
24 | }) | 24 | }) |
25 | 25 | ||
26 | #define arch_efi_call_virt(f, args...) \ | 26 | #define arch_efi_call_virt(p, f, args...) \ |
27 | ({ \ | 27 | ({ \ |
28 | efi_##f##_t *__f; \ | 28 | efi_##f##_t *__f; \ |
29 | __f = efi.systab->runtime->f; \ | 29 | __f = p->f; \ |
30 | __f(args); \ | 30 | __f(args); \ |
31 | }) | 31 | }) |
32 | 32 | ||
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index 52fef606bc54..ff574dad95cc 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c | |||
@@ -757,7 +757,6 @@ struct boot_params *make_boot_params(struct efi_config *c) | |||
757 | struct boot_params *boot_params; | 757 | struct boot_params *boot_params; |
758 | struct apm_bios_info *bi; | 758 | struct apm_bios_info *bi; |
759 | struct setup_header *hdr; | 759 | struct setup_header *hdr; |
760 | struct efi_info *efi; | ||
761 | efi_loaded_image_t *image; | 760 | efi_loaded_image_t *image; |
762 | void *options, *handle; | 761 | void *options, *handle; |
763 | efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID; | 762 | efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID; |
@@ -800,7 +799,6 @@ struct boot_params *make_boot_params(struct efi_config *c) | |||
800 | memset(boot_params, 0x0, 0x4000); | 799 | memset(boot_params, 0x0, 0x4000); |
801 | 800 | ||
802 | hdr = &boot_params->hdr; | 801 | hdr = &boot_params->hdr; |
803 | efi = &boot_params->efi_info; | ||
804 | bi = &boot_params->apm_bios_info; | 802 | bi = &boot_params->apm_bios_info; |
805 | 803 | ||
806 | /* Copy the second sector to boot_params */ | 804 | /* Copy the second sector to boot_params */ |
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 78d1e7467eae..55b4596ef688 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
@@ -41,10 +41,9 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); | |||
41 | /* | 41 | /* |
42 | * Wrap all the virtual calls in a way that forces the parameters on the stack. | 42 | * Wrap all the virtual calls in a way that forces the parameters on the stack. |
43 | */ | 43 | */ |
44 | #define arch_efi_call_virt(f, args...) \ | 44 | #define arch_efi_call_virt(p, f, args...) \ |
45 | ({ \ | 45 | ({ \ |
46 | ((efi_##f##_t __attribute__((regparm(0)))*) \ | 46 | ((efi_##f##_t __attribute__((regparm(0)))*) p->f)(args); \ |
47 | efi.systab->runtime->f)(args); \ | ||
48 | }) | 47 | }) |
49 | 48 | ||
50 | #define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size) | 49 | #define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size) |
@@ -81,8 +80,8 @@ struct efi_scratch { | |||
81 | } \ | 80 | } \ |
82 | }) | 81 | }) |
83 | 82 | ||
84 | #define arch_efi_call_virt(f, args...) \ | 83 | #define arch_efi_call_virt(p, f, args...) \ |
85 | efi_call((void *)efi.systab->runtime->f, args) \ | 84 | efi_call((void *)p->f, args) \ |
86 | 85 | ||
87 | #define arch_efi_call_virt_teardown() \ | 86 | #define arch_efi_call_virt_teardown() \ |
88 | ({ \ | 87 | ({ \ |
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index f93545e7dc54..d898b334ff46 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -98,21 +98,6 @@ static efi_status_t __init phys_efi_set_virtual_address_map( | |||
98 | return status; | 98 | return status; |
99 | } | 99 | } |
100 | 100 | ||
101 | void efi_get_time(struct timespec *now) | ||
102 | { | ||
103 | efi_status_t status; | ||
104 | efi_time_t eft; | ||
105 | efi_time_cap_t cap; | ||
106 | |||
107 | status = efi.get_time(&eft, &cap); | ||
108 | if (status != EFI_SUCCESS) | ||
109 | pr_err("Oops: efitime: can't read time!\n"); | ||
110 | |||
111 | now->tv_sec = mktime(eft.year, eft.month, eft.day, eft.hour, | ||
112 | eft.minute, eft.second); | ||
113 | now->tv_nsec = 0; | ||
114 | } | ||
115 | |||
116 | void __init efi_find_mirror(void) | 101 | void __init efi_find_mirror(void) |
117 | { | 102 | { |
118 | efi_memory_desc_t *md; | 103 | efi_memory_desc_t *md; |
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index b226b3f497f1..5cb4301c4dcf 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c | |||
@@ -466,22 +466,17 @@ extern efi_status_t efi64_thunk(u32, ...); | |||
466 | #define efi_thunk(f, ...) \ | 466 | #define efi_thunk(f, ...) \ |
467 | ({ \ | 467 | ({ \ |
468 | efi_status_t __s; \ | 468 | efi_status_t __s; \ |
469 | unsigned long flags; \ | 469 | unsigned long __flags; \ |
470 | u32 func; \ | 470 | u32 __func; \ |
471 | \ | 471 | \ |
472 | efi_sync_low_kernel_mappings(); \ | 472 | local_irq_save(__flags); \ |
473 | local_irq_save(flags); \ | 473 | arch_efi_call_virt_setup(); \ |
474 | \ | 474 | \ |
475 | efi_scratch.prev_cr3 = read_cr3(); \ | 475 | __func = runtime_service32(f); \ |
476 | write_cr3((unsigned long)efi_scratch.efi_pgt); \ | 476 | __s = efi64_thunk(__func, __VA_ARGS__); \ |
477 | __flush_tlb_all(); \ | ||
478 | \ | 477 | \ |
479 | func = runtime_service32(f); \ | 478 | arch_efi_call_virt_teardown(); \ |
480 | __s = efi64_thunk(func, __VA_ARGS__); \ | 479 | local_irq_restore(__flags); \ |
481 | \ | ||
482 | write_cr3(efi_scratch.prev_cr3); \ | ||
483 | __flush_tlb_all(); \ | ||
484 | local_irq_restore(flags); \ | ||
485 | \ | 480 | \ |
486 | __s; \ | 481 | __s; \ |
487 | }) | 482 | }) |
diff --git a/arch/x86/platform/uv/bios_uv.c b/arch/x86/platform/uv/bios_uv.c index 815fec6e05e2..66b2166ea4a1 100644 --- a/arch/x86/platform/uv/bios_uv.c +++ b/arch/x86/platform/uv/bios_uv.c | |||
@@ -40,8 +40,7 @@ s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5) | |||
40 | */ | 40 | */ |
41 | return BIOS_STATUS_UNIMPLEMENTED; | 41 | return BIOS_STATUS_UNIMPLEMENTED; |
42 | 42 | ||
43 | ret = efi_call((void *)__va(tab->function), (u64)which, | 43 | ret = efi_call_virt_pointer(tab, function, (u64)which, a1, a2, a3, a4, a5); |
44 | a1, a2, a3, a4, a5); | ||
45 | return ret; | 44 | return ret; |
46 | } | 45 | } |
47 | EXPORT_SYMBOL_GPL(uv_bios_call); | 46 | EXPORT_SYMBOL_GPL(uv_bios_call); |
diff --git a/drivers/firmware/efi/efibc.c b/drivers/firmware/efi/efibc.c index 8dd0c7085e59..503bbe2a9d49 100644 --- a/drivers/firmware/efi/efibc.c +++ b/drivers/firmware/efi/efibc.c | |||
@@ -37,13 +37,13 @@ static int efibc_set_variable(const char *name, const char *value) | |||
37 | size_t size = (strlen(value) + 1) * sizeof(efi_char16_t); | 37 | size_t size = (strlen(value) + 1) * sizeof(efi_char16_t); |
38 | 38 | ||
39 | if (size > sizeof(entry->var.Data)) { | 39 | if (size > sizeof(entry->var.Data)) { |
40 | pr_err("value is too large"); | 40 | pr_err("value is too large (%zu bytes) for '%s' EFI variable\n", size, name); |
41 | return -EINVAL; | 41 | return -EINVAL; |
42 | } | 42 | } |
43 | 43 | ||
44 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); | 44 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); |
45 | if (!entry) { | 45 | if (!entry) { |
46 | pr_err("failed to allocate efivar entry"); | 46 | pr_err("failed to allocate efivar entry for '%s' EFI variable\n", name); |
47 | return -ENOMEM; | 47 | return -ENOMEM; |
48 | } | 48 | } |
49 | 49 | ||
diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index 23bef6bb73ee..41958774cde3 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c | |||
@@ -22,7 +22,16 @@ | |||
22 | #include <linux/stringify.h> | 22 | #include <linux/stringify.h> |
23 | #include <asm/efi.h> | 23 | #include <asm/efi.h> |
24 | 24 | ||
25 | static void efi_call_virt_check_flags(unsigned long flags, const char *call) | 25 | /* |
26 | * Wrap around the new efi_call_virt_generic() macros so that the | ||
27 | * code doesn't get too cluttered: | ||
28 | */ | ||
29 | #define efi_call_virt(f, args...) \ | ||
30 | efi_call_virt_pointer(efi.systab->runtime, f, args) | ||
31 | #define __efi_call_virt(f, args...) \ | ||
32 | __efi_call_virt_pointer(efi.systab->runtime, f, args) | ||
33 | |||
34 | void efi_call_virt_check_flags(unsigned long flags, const char *call) | ||
26 | { | 35 | { |
27 | unsigned long cur_flags, mismatch; | 36 | unsigned long cur_flags, mismatch; |
28 | 37 | ||
@@ -39,48 +48,6 @@ static void efi_call_virt_check_flags(unsigned long flags, const char *call) | |||
39 | } | 48 | } |
40 | 49 | ||
41 | /* | 50 | /* |
42 | * Arch code can implement the following three template macros, avoiding | ||
43 | * reptition for the void/non-void return cases of {__,}efi_call_virt: | ||
44 | * | ||
45 | * * arch_efi_call_virt_setup | ||
46 | * | ||
47 | * Sets up the environment for the call (e.g. switching page tables, | ||
48 | * allowing kernel-mode use of floating point, if required). | ||
49 | * | ||
50 | * * arch_efi_call_virt | ||
51 | * | ||
52 | * Performs the call. The last expression in the macro must be the call | ||
53 | * itself, allowing the logic to be shared by the void and non-void | ||
54 | * cases. | ||
55 | * | ||
56 | * * arch_efi_call_virt_teardown | ||
57 | * | ||
58 | * Restores the usual kernel environment once the call has returned. | ||
59 | */ | ||
60 | |||
61 | #define efi_call_virt(f, args...) \ | ||
62 | ({ \ | ||
63 | efi_status_t __s; \ | ||
64 | unsigned long flags; \ | ||
65 | arch_efi_call_virt_setup(); \ | ||
66 | local_save_flags(flags); \ | ||
67 | __s = arch_efi_call_virt(f, args); \ | ||
68 | efi_call_virt_check_flags(flags, __stringify(f)); \ | ||
69 | arch_efi_call_virt_teardown(); \ | ||
70 | __s; \ | ||
71 | }) | ||
72 | |||
73 | #define __efi_call_virt(f, args...) \ | ||
74 | ({ \ | ||
75 | unsigned long flags; \ | ||
76 | arch_efi_call_virt_setup(); \ | ||
77 | local_save_flags(flags); \ | ||
78 | arch_efi_call_virt(f, args); \ | ||
79 | efi_call_virt_check_flags(flags, __stringify(f)); \ | ||
80 | arch_efi_call_virt_teardown(); \ | ||
81 | }) | ||
82 | |||
83 | /* | ||
84 | * According to section 7.1 of the UEFI spec, Runtime Services are not fully | 51 | * According to section 7.1 of the UEFI spec, Runtime Services are not fully |
85 | * reentrant, and there are particular combinations of calls that need to be | 52 | * reentrant, and there are particular combinations of calls that need to be |
86 | * serialized. (source: UEFI Specification v2.4A) | 53 | * serialized. (source: UEFI Specification v2.4A) |
diff --git a/include/linux/efi.h b/include/linux/efi.h index f196dd0b0f2f..7f80a75ee9e3 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -536,116 +536,58 @@ typedef efi_status_t efi_query_variable_store_t(u32 attributes, | |||
536 | void efi_native_runtime_setup(void); | 536 | void efi_native_runtime_setup(void); |
537 | 537 | ||
538 | /* | 538 | /* |
539 | * EFI Configuration Table and GUID definitions | 539 | * EFI Configuration Table and GUID definitions |
540 | * | ||
541 | * These are all defined in a single line to make them easier to | ||
542 | * grep for and to see them at a glance - while still having a | ||
543 | * similar structure to the definitions in the spec. | ||
544 | * | ||
545 | * Here's how they are structured: | ||
546 | * | ||
547 | * GUID: 12345678-1234-1234-1234-123456789012 | ||
548 | * Spec: | ||
549 | * #define EFI_SOME_PROTOCOL_GUID \ | ||
550 | * {0x12345678,0x1234,0x1234,\ | ||
551 | * {0x12,0x34,0x12,0x34,0x56,0x78,0x90,0x12}} | ||
552 | * Here: | ||
553 | * #define SOME_PROTOCOL_GUID EFI_GUID(0x12345678, 0x1234, 0x1234, 0x12, 0x34, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12) | ||
554 | * ^ tabs ^extra space | ||
555 | * | ||
556 | * Note that the 'extra space' separates the values at the same place | ||
557 | * where the UEFI SPEC breaks the line. | ||
540 | */ | 558 | */ |
541 | #define NULL_GUID \ | 559 | #define NULL_GUID EFI_GUID(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) |
542 | EFI_GUID(0x00000000, 0x0000, 0x0000, \ | 560 | #define MPS_TABLE_GUID EFI_GUID(0xeb9d2d2f, 0x2d88, 0x11d3, 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) |
543 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) | 561 | #define ACPI_TABLE_GUID EFI_GUID(0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) |
544 | 562 | #define ACPI_20_TABLE_GUID EFI_GUID(0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81) | |
545 | #define MPS_TABLE_GUID \ | 563 | #define SMBIOS_TABLE_GUID EFI_GUID(0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) |
546 | EFI_GUID(0xeb9d2d2f, 0x2d88, 0x11d3, \ | 564 | #define SMBIOS3_TABLE_GUID EFI_GUID(0xf2fd1544, 0x9794, 0x4a2c, 0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94) |
547 | 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) | 565 | #define SAL_SYSTEM_TABLE_GUID EFI_GUID(0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) |
548 | 566 | #define HCDP_TABLE_GUID EFI_GUID(0xf951938d, 0x620b, 0x42ef, 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98) | |
549 | #define ACPI_TABLE_GUID \ | 567 | #define UGA_IO_PROTOCOL_GUID EFI_GUID(0x61a4d49e, 0x6f68, 0x4f1b, 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0x0b, 0x07, 0xa2) |
550 | EFI_GUID(0xeb9d2d30, 0x2d88, 0x11d3, \ | 568 | #define EFI_GLOBAL_VARIABLE_GUID EFI_GUID(0x8be4df61, 0x93ca, 0x11d2, 0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c) |
551 | 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) | 569 | #define UV_SYSTEM_TABLE_GUID EFI_GUID(0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93) |
552 | 570 | #define LINUX_EFI_CRASH_GUID EFI_GUID(0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0) | |
553 | #define ACPI_20_TABLE_GUID \ | 571 | #define LOADED_IMAGE_PROTOCOL_GUID EFI_GUID(0x5b1b31a1, 0x9562, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b) |
554 | EFI_GUID(0x8868e871, 0xe4f1, 0x11d3, \ | 572 | #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID EFI_GUID(0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a) |
555 | 0xbc, 0x22, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81) | 573 | #define EFI_UGA_PROTOCOL_GUID EFI_GUID(0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39) |
556 | 574 | #define EFI_PCI_IO_PROTOCOL_GUID EFI_GUID(0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x02, 0x9a) | |
557 | #define SMBIOS_TABLE_GUID \ | 575 | #define EFI_FILE_INFO_ID EFI_GUID(0x09576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b) |
558 | EFI_GUID(0xeb9d2d31, 0x2d88, 0x11d3, \ | 576 | #define EFI_SYSTEM_RESOURCE_TABLE_GUID EFI_GUID(0xb122a263, 0x3661, 0x4f68, 0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80) |
559 | 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) | 577 | #define EFI_FILE_SYSTEM_GUID EFI_GUID(0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b) |
560 | 578 | #define DEVICE_TREE_GUID EFI_GUID(0xb1b621d5, 0xf19c, 0x41a5, 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0) | |
561 | #define SMBIOS3_TABLE_GUID \ | 579 | #define EFI_PROPERTIES_TABLE_GUID EFI_GUID(0x880aaca3, 0x4adc, 0x4a04, 0x90, 0x79, 0xb7, 0x47, 0x34, 0x08, 0x25, 0xe5) |
562 | EFI_GUID(0xf2fd1544, 0x9794, 0x4a2c, \ | 580 | #define EFI_RNG_PROTOCOL_GUID EFI_GUID(0x3152bca5, 0xeade, 0x433d, 0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44) |
563 | 0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94) | 581 | #define EFI_MEMORY_ATTRIBUTES_TABLE_GUID EFI_GUID(0xdcfa911d, 0x26eb, 0x469f, 0xa2, 0x20, 0x38, 0xb7, 0xdc, 0x46, 0x12, 0x20) |
564 | 582 | #define EFI_CONSOLE_OUT_DEVICE_GUID EFI_GUID(0xd3b36f2c, 0xd551, 0x11d4, 0x9a, 0x46, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) | |
565 | #define SAL_SYSTEM_TABLE_GUID \ | ||
566 | EFI_GUID(0xeb9d2d32, 0x2d88, 0x11d3, \ | ||
567 | 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) | ||
568 | |||
569 | #define HCDP_TABLE_GUID \ | ||
570 | EFI_GUID(0xf951938d, 0x620b, 0x42ef, \ | ||
571 | 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98) | ||
572 | |||
573 | #define UGA_IO_PROTOCOL_GUID \ | ||
574 | EFI_GUID(0x61a4d49e, 0x6f68, 0x4f1b, \ | ||
575 | 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0x0b, 0x07, 0xa2) | ||
576 | |||
577 | #define EFI_GLOBAL_VARIABLE_GUID \ | ||
578 | EFI_GUID(0x8be4df61, 0x93ca, 0x11d2, \ | ||
579 | 0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c) | ||
580 | |||
581 | #define UV_SYSTEM_TABLE_GUID \ | ||
582 | EFI_GUID(0x3b13a7d4, 0x633e, 0x11dd, \ | ||
583 | 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93) | ||
584 | |||
585 | #define LINUX_EFI_CRASH_GUID \ | ||
586 | EFI_GUID(0xcfc8fc79, 0xbe2e, 0x4ddc, \ | ||
587 | 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0) | ||
588 | |||
589 | #define LOADED_IMAGE_PROTOCOL_GUID \ | ||
590 | EFI_GUID(0x5b1b31a1, 0x9562, 0x11d2, \ | ||
591 | 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b) | ||
592 | |||
593 | #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ | ||
594 | EFI_GUID(0x9042a9de, 0x23dc, 0x4a38, \ | ||
595 | 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a) | ||
596 | |||
597 | #define EFI_UGA_PROTOCOL_GUID \ | ||
598 | EFI_GUID(0x982c298b, 0xf4fa, 0x41cb, \ | ||
599 | 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39) | ||
600 | |||
601 | #define EFI_PCI_IO_PROTOCOL_GUID \ | ||
602 | EFI_GUID(0x4cf5b200, 0x68b8, 0x4ca5, \ | ||
603 | 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x02, 0x9a) | ||
604 | |||
605 | #define EFI_FILE_INFO_ID \ | ||
606 | EFI_GUID(0x9576e92, 0x6d3f, 0x11d2, \ | ||
607 | 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b) | ||
608 | |||
609 | #define EFI_SYSTEM_RESOURCE_TABLE_GUID \ | ||
610 | EFI_GUID(0xb122a263, 0x3661, 0x4f68, \ | ||
611 | 0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80) | ||
612 | |||
613 | #define EFI_FILE_SYSTEM_GUID \ | ||
614 | EFI_GUID(0x964e5b22, 0x6459, 0x11d2, \ | ||
615 | 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b) | ||
616 | |||
617 | #define DEVICE_TREE_GUID \ | ||
618 | EFI_GUID(0xb1b621d5, 0xf19c, 0x41a5, \ | ||
619 | 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0) | ||
620 | |||
621 | #define EFI_PROPERTIES_TABLE_GUID \ | ||
622 | EFI_GUID(0x880aaca3, 0x4adc, 0x4a04, \ | ||
623 | 0x90, 0x79, 0xb7, 0x47, 0x34, 0x08, 0x25, 0xe5) | ||
624 | |||
625 | #define EFI_RNG_PROTOCOL_GUID \ | ||
626 | EFI_GUID(0x3152bca5, 0xeade, 0x433d, \ | ||
627 | 0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44) | ||
628 | |||
629 | #define EFI_MEMORY_ATTRIBUTES_TABLE_GUID \ | ||
630 | EFI_GUID(0xdcfa911d, 0x26eb, 0x469f, \ | ||
631 | 0xa2, 0x20, 0x38, 0xb7, 0xdc, 0x46, 0x12, 0x20) | ||
632 | |||
633 | #define EFI_CONSOLE_OUT_DEVICE_GUID \ | ||
634 | EFI_GUID(0xd3b36f2c, 0xd551, 0x11d4, \ | ||
635 | 0x9a, 0x46, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) | ||
636 | 583 | ||
637 | /* | 584 | /* |
638 | * This GUID is used to pass to the kernel proper the struct screen_info | 585 | * This GUID is used to pass to the kernel proper the struct screen_info |
639 | * structure that was populated by the stub based on the GOP protocol instance | 586 | * structure that was populated by the stub based on the GOP protocol instance |
640 | * associated with ConOut | 587 | * associated with ConOut |
641 | */ | 588 | */ |
642 | #define LINUX_EFI_ARM_SCREEN_INFO_TABLE_GUID \ | 589 | #define LINUX_EFI_ARM_SCREEN_INFO_TABLE_GUID EFI_GUID(0xe03fc20a, 0x85dc, 0x406e, 0xb9, 0x0e, 0x4a, 0xb5, 0x02, 0x37, 0x1d, 0x95) |
643 | EFI_GUID(0xe03fc20a, 0x85dc, 0x406e, \ | 590 | #define LINUX_EFI_LOADER_ENTRY_GUID EFI_GUID(0x4a67b082, 0x0a4c, 0x41cf, 0xb6, 0xc7, 0x44, 0x0b, 0x29, 0xbb, 0x8c, 0x4f) |
644 | 0xb9, 0xe, 0x4a, 0xb5, 0x02, 0x37, 0x1d, 0x95) | ||
645 | |||
646 | #define LINUX_EFI_LOADER_ENTRY_GUID \ | ||
647 | EFI_GUID(0x4a67b082, 0x0a4c, 0x41cf, \ | ||
648 | 0xb6, 0xc7, 0x44, 0x0b, 0x29, 0xbb, 0x8c, 0x4f) | ||
649 | 591 | ||
650 | typedef struct { | 592 | typedef struct { |
651 | efi_guid_t guid; | 593 | efi_guid_t guid; |
@@ -975,7 +917,6 @@ extern u64 efi_mem_desc_end(efi_memory_desc_t *md); | |||
975 | extern int efi_mem_desc_lookup(u64 phys_addr, efi_memory_desc_t *out_md); | 917 | extern int efi_mem_desc_lookup(u64 phys_addr, efi_memory_desc_t *out_md); |
976 | extern void efi_initialize_iomem_resources(struct resource *code_resource, | 918 | extern void efi_initialize_iomem_resources(struct resource *code_resource, |
977 | struct resource *data_resource, struct resource *bss_resource); | 919 | struct resource *data_resource, struct resource *bss_resource); |
978 | extern void efi_get_time(struct timespec *now); | ||
979 | extern void efi_reserve_boot_services(void); | 920 | extern void efi_reserve_boot_services(void); |
980 | extern int efi_get_fdt_params(struct efi_fdt_params *params); | 921 | extern int efi_get_fdt_params(struct efi_fdt_params *params); |
981 | extern struct kobject *efi_kobj; | 922 | extern struct kobject *efi_kobj; |
@@ -1465,4 +1406,55 @@ efi_status_t efi_setup_gop(efi_system_table_t *sys_table_arg, | |||
1465 | unsigned long size); | 1406 | unsigned long size); |
1466 | 1407 | ||
1467 | bool efi_runtime_disabled(void); | 1408 | bool efi_runtime_disabled(void); |
1409 | extern void efi_call_virt_check_flags(unsigned long flags, const char *call); | ||
1410 | |||
1411 | /* | ||
1412 | * Arch code can implement the following three template macros, avoiding | ||
1413 | * reptition for the void/non-void return cases of {__,}efi_call_virt(): | ||
1414 | * | ||
1415 | * * arch_efi_call_virt_setup() | ||
1416 | * | ||
1417 | * Sets up the environment for the call (e.g. switching page tables, | ||
1418 | * allowing kernel-mode use of floating point, if required). | ||
1419 | * | ||
1420 | * * arch_efi_call_virt() | ||
1421 | * | ||
1422 | * Performs the call. The last expression in the macro must be the call | ||
1423 | * itself, allowing the logic to be shared by the void and non-void | ||
1424 | * cases. | ||
1425 | * | ||
1426 | * * arch_efi_call_virt_teardown() | ||
1427 | * | ||
1428 | * Restores the usual kernel environment once the call has returned. | ||
1429 | */ | ||
1430 | |||
1431 | #define efi_call_virt_pointer(p, f, args...) \ | ||
1432 | ({ \ | ||
1433 | efi_status_t __s; \ | ||
1434 | unsigned long __flags; \ | ||
1435 | \ | ||
1436 | arch_efi_call_virt_setup(); \ | ||
1437 | \ | ||
1438 | local_save_flags(__flags); \ | ||
1439 | __s = arch_efi_call_virt(p, f, args); \ | ||
1440 | efi_call_virt_check_flags(__flags, __stringify(f)); \ | ||
1441 | \ | ||
1442 | arch_efi_call_virt_teardown(); \ | ||
1443 | \ | ||
1444 | __s; \ | ||
1445 | }) | ||
1446 | |||
1447 | #define __efi_call_virt_pointer(p, f, args...) \ | ||
1448 | ({ \ | ||
1449 | unsigned long __flags; \ | ||
1450 | \ | ||
1451 | arch_efi_call_virt_setup(); \ | ||
1452 | \ | ||
1453 | local_save_flags(__flags); \ | ||
1454 | arch_efi_call_virt(p, f, args); \ | ||
1455 | efi_call_virt_check_flags(__flags, __stringify(f)); \ | ||
1456 | \ | ||
1457 | arch_efi_call_virt_teardown(); \ | ||
1458 | }) | ||
1459 | |||
1468 | #endif /* _LINUX_EFI_H */ | 1460 | #endif /* _LINUX_EFI_H */ |