提交 7644c16c 编写于 作者: M Mike Waychison 提交者: Tony Luck

efivars: Introduce PSTORE_EFI_ATTRIBUTES

Consolidate the attributes listed for pstore operations in one place,
PSTORE_EFI_ATTRIBUTES.
Signed-off-by: NMike Waychison <mikew@google.com>
Signed-off-by: NTony Luck <tony.luck@intel.com>
上级 c475594d
...@@ -122,6 +122,10 @@ struct efivar_attribute { ...@@ -122,6 +122,10 @@ struct efivar_attribute {
ssize_t (*store)(struct efivar_entry *entry, const char *buf, size_t count); ssize_t (*store)(struct efivar_entry *entry, const char *buf, size_t count);
}; };
#define PSTORE_EFI_ATTRIBUTES \
(EFI_VARIABLE_NON_VOLATILE | \
EFI_VARIABLE_BOOTSERVICE_ACCESS | \
EFI_VARIABLE_RUNTIME_ACCESS)
#define EFIVAR_ATTR(_name, _mode, _show, _store) \ #define EFIVAR_ATTR(_name, _mode, _show, _store) \
struct efivar_attribute efivar_attr_##_name = { \ struct efivar_attribute efivar_attr_##_name = { \
...@@ -523,8 +527,9 @@ static u64 efi_pstore_write(enum pstore_type_id type, unsigned int part, ...@@ -523,8 +527,9 @@ static u64 efi_pstore_write(enum pstore_type_id type, unsigned int part,
/* found */ /* found */
found = entry; found = entry;
efivars->ops->set_variable(entry->var.VariableName, &entry->var.VendorGuid, efivars->ops->set_variable(entry->var.VariableName,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, &entry->var.VendorGuid,
PSTORE_EFI_ATTRIBUTES,
0, NULL); 0, NULL);
} }
...@@ -534,8 +539,7 @@ static u64 efi_pstore_write(enum pstore_type_id type, unsigned int part, ...@@ -534,8 +539,7 @@ static u64 efi_pstore_write(enum pstore_type_id type, unsigned int part,
for (i = 0; i < DUMP_NAME_LEN; i++) for (i = 0; i < DUMP_NAME_LEN; i++)
efi_name[i] = name[i]; efi_name[i] = name[i];
efivars->ops->set_variable(efi_name, &vendor, efivars->ops->set_variable(efi_name, &vendor, PSTORE_EFI_ATTRIBUTES,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
size, psi->buf); size, psi->buf);
spin_unlock(&efivars->lock); spin_unlock(&efivars->lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册