mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-17 22:23:45 -04:00
efi: vars: Add thin wrapper around EFI get/set variable interface
The current efivars layer is a jumble of list iterators, shadow data structures and safe variable manipulation helpers that really belong in the efivarfs pseudo file system once the obsolete sysfs access method to EFI variables is removed. So split off a minimal efivar get/set variable API that reuses the existing efivars_lock semaphore to mediate access to the various runtime services, primarily to ensure that performing a SetVariable() on one CPU while another is calling GetNextVariable() in a loop to enumerate the contents of the EFI variable store does not result in surprises. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
@@ -1099,6 +1099,26 @@ bool efivar_validate(efi_guid_t vendor, efi_char16_t *var_name, u8 *data,
|
||||
bool efivar_variable_is_removable(efi_guid_t vendor, const char *name,
|
||||
size_t len);
|
||||
|
||||
int efivar_lock(void);
|
||||
int efivar_trylock(void);
|
||||
void efivar_unlock(void);
|
||||
|
||||
efi_status_t efivar_get_variable(efi_char16_t *name, efi_guid_t *vendor,
|
||||
u32 *attr, unsigned long *size, void *data);
|
||||
|
||||
efi_status_t efivar_get_next_variable(unsigned long *name_size,
|
||||
efi_char16_t *name, efi_guid_t *vendor);
|
||||
|
||||
efi_status_t efivar_set_variable_locked(efi_char16_t *name, efi_guid_t *vendor,
|
||||
u32 attr, unsigned long data_size,
|
||||
void *data, bool nonblocking);
|
||||
|
||||
efi_status_t efivar_set_variable(efi_char16_t *name, efi_guid_t *vendor,
|
||||
u32 attr, unsigned long data_size, void *data);
|
||||
|
||||
efi_status_t check_var_size(u32 attributes, unsigned long size);
|
||||
efi_status_t check_var_size_nonblocking(u32 attributes, unsigned long size);
|
||||
|
||||
#if IS_ENABLED(CONFIG_EFI_CAPSULE_LOADER)
|
||||
extern bool efi_capsule_pending(int *reset_type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user