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