aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/efi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/efi.h')
-rw-r--r--include/linux/efi.h82
1 files changed, 74 insertions, 8 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 41bbf8ba4ba8..45cb4ffdea62 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);
522typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size); 523typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size);
523 524
525void 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);
870extern void efi_initialize_iomem_resources(struct resource *code_resource, 873extern 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);
872extern void efi_get_time(struct timespec *now); 875extern void efi_get_time(struct timespec *now);
873extern int efi_set_rtc_mmss(const struct timespec *now);
874extern void efi_reserve_boot_services(void); 876extern void efi_reserve_boot_services(void);
875extern int efi_get_fdt_params(struct efi_fdt_params *params, int verbose); 877extern int efi_get_fdt_params(struct efi_fdt_params *params, int verbose);
876extern struct efi_memory_map memmap; 878extern struct efi_memory_map memmap;
877 879
880extern int efi_reboot_quirk_mode;
881extern 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}
935extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
929#else 936#else
930static inline bool efi_enabled(int feature) 937static inline bool efi_enabled(int feature)
931{ 938{
932 return false; 939 return false;
933} 940}
941static inline void
942efi_reboot(enum reboot_mode reboot_mode, const char *__unused) {}
934#endif 943#endif
935 944
936/* 945/*
@@ -1031,12 +1040,8 @@ struct efivar_operations {
1031struct efivars { 1040struct 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;
@@ -1151,6 +1156,9 @@ int efivars_sysfs_init(void);
1151#ifdef CONFIG_EFI_RUNTIME_MAP 1156#ifdef CONFIG_EFI_RUNTIME_MAP
1152int efi_runtime_map_init(struct kobject *); 1157int efi_runtime_map_init(struct kobject *);
1153void efi_runtime_map_setup(void *, int, u32); 1158void efi_runtime_map_setup(void *, int, u32);
1159int efi_get_runtime_map_size(void);
1160int efi_get_runtime_map_desc_size(void);
1161int efi_runtime_map_copy(void *buf, size_t bufsz);
1154#else 1162#else
1155static inline int efi_runtime_map_init(struct kobject *kobj) 1163static inline int efi_runtime_map_init(struct kobject *kobj)
1156{ 1164{
@@ -1159,6 +1167,64 @@ static inline int efi_runtime_map_init(struct kobject *kobj)
1159 1167
1160static inline void 1168static inline void
1161efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {} 1169efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {}
1170
1171static inline int efi_get_runtime_map_size(void)
1172{
1173 return 0;
1174}
1175
1176static inline int efi_get_runtime_map_desc_size(void)
1177{
1178 return 0;
1179}
1180
1181static inline int efi_runtime_map_copy(void *buf, size_t bufsz)
1182{
1183 return 0;
1184}
1185
1162#endif 1186#endif
1163 1187
1188/* prototypes shared between arch specific and generic stub code */
1189
1190#define pr_efi(sys_table, msg) efi_printk(sys_table, "EFI stub: "msg)
1191#define pr_efi_err(sys_table, msg) efi_printk(sys_table, "EFI stub: ERROR: "msg)
1192
1193void efi_printk(efi_system_table_t *sys_table_arg, char *str);
1194
1195void efi_free(efi_system_table_t *sys_table_arg, unsigned long size,
1196 unsigned long addr);
1197
1198char *efi_convert_cmdline(efi_system_table_t *sys_table_arg,
1199 efi_loaded_image_t *image, int *cmd_line_len);
1200
1201efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg,
1202 efi_memory_desc_t **map,
1203 unsigned long *map_size,
1204 unsigned long *desc_size,
1205 u32 *desc_ver,
1206 unsigned long *key_ptr);
1207
1208efi_status_t efi_low_alloc(efi_system_table_t *sys_table_arg,
1209 unsigned long size, unsigned long align,
1210 unsigned long *addr);
1211
1212efi_status_t efi_high_alloc(efi_system_table_t *sys_table_arg,
1213 unsigned long size, unsigned long align,
1214 unsigned long *addr, unsigned long max);
1215
1216efi_status_t efi_relocate_kernel(efi_system_table_t *sys_table_arg,
1217 unsigned long *image_addr,
1218 unsigned long image_size,
1219 unsigned long alloc_size,
1220 unsigned long preferred_addr,
1221 unsigned long alignment);
1222
1223efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg,
1224 efi_loaded_image_t *image,
1225 char *cmd_line, char *option_string,
1226 unsigned long max_addr,
1227 unsigned long *load_addr,
1228 unsigned long *load_size);
1229
1164#endif /* _LINUX_EFI_H */ 1230#endif /* _LINUX_EFI_H */