diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-04 20:13:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-04 20:13:50 -0400 |
commit | 76f09aa464a1913efd596dd0edbf88f932fde08c (patch) | |
tree | ce9aadc9a1c30597b9d61c7aac86bfb2e6caf961 /include/linux | |
parent | e9c9eecabaa898ff3fedd98813ee4ac1a00d006a (diff) | |
parent | 99a5603e2a1f146ac0c6414d8a3669aa749ccff8 (diff) |
Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull EFI changes from Ingo Molnar:
"Main changes in this cycle are:
- arm64 efi stub fixes, preservation of FP/SIMD registers across
firmware calls, and conversion of the EFI stub code into a static
library - Ard Biesheuvel
- Xen EFI support - Daniel Kiper
- Support for autoloading the efivars driver - Lee, Chun-Yi
- Use the PE/COFF headers in the x86 EFI boot stub to request that
the stub be loaded with CONFIG_PHYSICAL_ALIGN alignment - Michael
Brown
- Consolidate all the x86 EFI quirks into one file - Saurabh Tangri
- Additional error logging in x86 EFI boot stub - Ulf Winkelvos
- Support loading initrd above 4G in EFI boot stub - Yinghai Lu
- EFI reboot patches for ACPI hardware reduced platforms"
* 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (31 commits)
efi/arm64: Handle missing virtual mapping for UEFI System Table
arch/x86/xen: Silence compiler warnings
xen: Silence compiler warnings
x86/efi: Request desired alignment via the PE/COFF headers
x86/efi: Add better error logging to EFI boot stub
efi: Autoload efivars
efi: Update stale locking comment for struct efivars
arch/x86: Remove efi_set_rtc_mmss()
arch/x86: Replace plain strings with constants
xen: Put EFI machinery in place
xen: Define EFI related stuff
arch/x86: Remove redundant set_bit(EFI_MEMMAP) call
arch/x86: Remove redundant set_bit(EFI_SYSTEM_TABLES) call
efi: Introduce EFI_PARAVIRT flag
arch/x86: Do not access EFI memory map if it is not available
efi: Use early_mem*() instead of early_io*()
arch/ia64: Define early_memunmap()
x86/reboot: Add EFI reboot quirk for ACPI Hardware Reduced flag
efi/reboot: Allow powering off machines using EFI
efi/reboot: Add generic wrapper around EfiResetSystem()
...
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/efi.h | 63 |
1 files changed, 55 insertions, 8 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h index 41bbf8ba4ba8..efc681fd5895 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/ioport.h> | 20 | #include <linux/ioport.h> |
21 | #include <linux/pfn.h> | 21 | #include <linux/pfn.h> |
22 | #include <linux/pstore.h> | 22 | #include <linux/pstore.h> |
23 | #include <linux/reboot.h> | ||
23 | 24 | ||
24 | #include <asm/page.h> | 25 | #include <asm/page.h> |
25 | 26 | ||
@@ -521,6 +522,8 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, | |||
521 | int *reset_type); | 522 | int *reset_type); |
522 | typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size); | 523 | typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size); |
523 | 524 | ||
525 | void efi_native_runtime_setup(void); | ||
526 | |||
524 | /* | 527 | /* |
525 | * EFI Configuration Table and GUID definitions | 528 | * EFI Configuration Table and GUID definitions |
526 | */ | 529 | */ |
@@ -870,11 +873,13 @@ extern int __init efi_uart_console_only (void); | |||
870 | extern void efi_initialize_iomem_resources(struct resource *code_resource, | 873 | extern void efi_initialize_iomem_resources(struct resource *code_resource, |
871 | struct resource *data_resource, struct resource *bss_resource); | 874 | struct resource *data_resource, struct resource *bss_resource); |
872 | extern void efi_get_time(struct timespec *now); | 875 | extern void efi_get_time(struct timespec *now); |
873 | extern int efi_set_rtc_mmss(const struct timespec *now); | ||
874 | extern void efi_reserve_boot_services(void); | 876 | extern void efi_reserve_boot_services(void); |
875 | extern int efi_get_fdt_params(struct efi_fdt_params *params, int verbose); | 877 | extern int efi_get_fdt_params(struct efi_fdt_params *params, int verbose); |
876 | extern struct efi_memory_map memmap; | 878 | extern struct efi_memory_map memmap; |
877 | 879 | ||
880 | extern int efi_reboot_quirk_mode; | ||
881 | extern bool efi_poweroff_required(void); | ||
882 | |||
878 | /* Iterate through an efi_memory_map */ | 883 | /* Iterate through an efi_memory_map */ |
879 | #define for_each_efi_memory_desc(m, md) \ | 884 | #define for_each_efi_memory_desc(m, md) \ |
880 | for ((md) = (m)->map; \ | 885 | for ((md) = (m)->map; \ |
@@ -916,7 +921,8 @@ extern int __init efi_setup_pcdp_console(char *); | |||
916 | #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ | 921 | #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ |
917 | #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ | 922 | #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ |
918 | #define EFI_64BIT 5 /* Is the firmware 64-bit? */ | 923 | #define EFI_64BIT 5 /* Is the firmware 64-bit? */ |
919 | #define EFI_ARCH_1 6 /* First arch-specific bit */ | 924 | #define EFI_PARAVIRT 6 /* Access is via a paravirt interface */ |
925 | #define EFI_ARCH_1 7 /* First arch-specific bit */ | ||
920 | 926 | ||
921 | #ifdef CONFIG_EFI | 927 | #ifdef CONFIG_EFI |
922 | /* | 928 | /* |
@@ -926,11 +932,14 @@ static inline bool efi_enabled(int feature) | |||
926 | { | 932 | { |
927 | return test_bit(feature, &efi.flags) != 0; | 933 | return test_bit(feature, &efi.flags) != 0; |
928 | } | 934 | } |
935 | extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused); | ||
929 | #else | 936 | #else |
930 | static inline bool efi_enabled(int feature) | 937 | static inline bool efi_enabled(int feature) |
931 | { | 938 | { |
932 | return false; | 939 | return false; |
933 | } | 940 | } |
941 | static inline void | ||
942 | efi_reboot(enum reboot_mode reboot_mode, const char *__unused) {} | ||
934 | #endif | 943 | #endif |
935 | 944 | ||
936 | /* | 945 | /* |
@@ -1031,12 +1040,8 @@ struct efivar_operations { | |||
1031 | struct efivars { | 1040 | struct efivars { |
1032 | /* | 1041 | /* |
1033 | * ->lock protects two things: | 1042 | * ->lock protects two things: |
1034 | * 1) ->list - adds, removals, reads, writes | 1043 | * 1) efivarfs_list and efivars_sysfs_list |
1035 | * 2) ops.[gs]et_variable() calls. | 1044 | * 2) ->ops calls |
1036 | * It must not be held when creating sysfs entries or calling kmalloc. | ||
1037 | * ops.get_next_variable() is only called from register_efivars() | ||
1038 | * or efivar_update_sysfs_entries(), | ||
1039 | * which is protected by the BKL, so that path is safe. | ||
1040 | */ | 1045 | */ |
1041 | spinlock_t lock; | 1046 | spinlock_t lock; |
1042 | struct kset *kset; | 1047 | struct kset *kset; |
@@ -1161,4 +1166,46 @@ static inline void | |||
1161 | efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {} | 1166 | efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {} |
1162 | #endif | 1167 | #endif |
1163 | 1168 | ||
1169 | /* prototypes shared between arch specific and generic stub code */ | ||
1170 | |||
1171 | #define pr_efi(sys_table, msg) efi_printk(sys_table, "EFI stub: "msg) | ||
1172 | #define pr_efi_err(sys_table, msg) efi_printk(sys_table, "EFI stub: ERROR: "msg) | ||
1173 | |||
1174 | void efi_printk(efi_system_table_t *sys_table_arg, char *str); | ||
1175 | |||
1176 | void efi_free(efi_system_table_t *sys_table_arg, unsigned long size, | ||
1177 | unsigned long addr); | ||
1178 | |||
1179 | char *efi_convert_cmdline(efi_system_table_t *sys_table_arg, | ||
1180 | efi_loaded_image_t *image, int *cmd_line_len); | ||
1181 | |||
1182 | efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg, | ||
1183 | efi_memory_desc_t **map, | ||
1184 | unsigned long *map_size, | ||
1185 | unsigned long *desc_size, | ||
1186 | u32 *desc_ver, | ||
1187 | unsigned long *key_ptr); | ||
1188 | |||
1189 | efi_status_t efi_low_alloc(efi_system_table_t *sys_table_arg, | ||
1190 | unsigned long size, unsigned long align, | ||
1191 | unsigned long *addr); | ||
1192 | |||
1193 | efi_status_t efi_high_alloc(efi_system_table_t *sys_table_arg, | ||
1194 | unsigned long size, unsigned long align, | ||
1195 | unsigned long *addr, unsigned long max); | ||
1196 | |||
1197 | efi_status_t efi_relocate_kernel(efi_system_table_t *sys_table_arg, | ||
1198 | unsigned long *image_addr, | ||
1199 | unsigned long image_size, | ||
1200 | unsigned long alloc_size, | ||
1201 | unsigned long preferred_addr, | ||
1202 | unsigned long alignment); | ||
1203 | |||
1204 | efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, | ||
1205 | efi_loaded_image_t *image, | ||
1206 | char *cmd_line, char *option_string, | ||
1207 | unsigned long max_addr, | ||
1208 | unsigned long *load_addr, | ||
1209 | unsigned long *load_size); | ||
1210 | |||
1164 | #endif /* _LINUX_EFI_H */ | 1211 | #endif /* _LINUX_EFI_H */ |