diff options
Diffstat (limited to 'include/linux/efi.h')
-rw-r--r-- | include/linux/efi.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h index fb737bc19a8c..e376270cd26e 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -299,6 +299,7 @@ extern void efi_initialize_iomem_resources(struct resource *code_resource, | |||
299 | struct resource *data_resource, struct resource *bss_resource); | 299 | struct resource *data_resource, struct resource *bss_resource); |
300 | extern unsigned long efi_get_time(void); | 300 | extern unsigned long efi_get_time(void); |
301 | extern int efi_set_rtc_mmss(unsigned long nowtime); | 301 | extern int efi_set_rtc_mmss(unsigned long nowtime); |
302 | extern void efi_reserve_boot_services(void); | ||
302 | extern struct efi_memory_map memmap; | 303 | extern struct efi_memory_map memmap; |
303 | 304 | ||
304 | /** | 305 | /** |
@@ -397,4 +398,41 @@ static inline void memrange_efi_to_native(u64 *addr, u64 *npages) | |||
397 | *addr &= PAGE_MASK; | 398 | *addr &= PAGE_MASK; |
398 | } | 399 | } |
399 | 400 | ||
401 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) | ||
402 | /* | ||
403 | * EFI Variable support. | ||
404 | * | ||
405 | * Different firmware drivers can expose their EFI-like variables using | ||
406 | * the following. | ||
407 | */ | ||
408 | |||
409 | struct efivar_operations { | ||
410 | efi_get_variable_t *get_variable; | ||
411 | efi_get_next_variable_t *get_next_variable; | ||
412 | efi_set_variable_t *set_variable; | ||
413 | }; | ||
414 | |||
415 | struct efivars { | ||
416 | /* | ||
417 | * ->lock protects two things: | ||
418 | * 1) ->list - adds, removals, reads, writes | ||
419 | * 2) ops.[gs]et_variable() calls. | ||
420 | * It must not be held when creating sysfs entries or calling kmalloc. | ||
421 | * ops.get_next_variable() is only called from register_efivars(), | ||
422 | * which is protected by the BKL, so that path is safe. | ||
423 | */ | ||
424 | spinlock_t lock; | ||
425 | struct list_head list; | ||
426 | struct kset *kset; | ||
427 | struct bin_attribute *new_var, *del_var; | ||
428 | const struct efivar_operations *ops; | ||
429 | }; | ||
430 | |||
431 | int register_efivars(struct efivars *efivars, | ||
432 | const struct efivar_operations *ops, | ||
433 | struct kobject *parent_kobj); | ||
434 | void unregister_efivars(struct efivars *efivars); | ||
435 | |||
436 | #endif /* CONFIG_EFI_VARS */ | ||
437 | |||
400 | #endif /* _LINUX_EFI_H */ | 438 | #endif /* _LINUX_EFI_H */ |