efivars: Move EFI_VARIABLE_* attributes to efivars.h
Rather than making these private to sbvarsign, move the EFI_VARIABLE attribute defintions to efivars.h Since some of these are defined by gnu-efi, we need to protect the definitions with an #ifdef. Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
parent
a7228c8307
commit
88625a586c
2 changed files with 26 additions and 7 deletions
|
@ -38,6 +38,26 @@
|
|||
{0x4aafd29d, 0x68df, 0x49ee, \
|
||||
{0x8a, 0xa9, 0x34, 0x7d, 0x37, 0x56, 0x65, 0xa7}}
|
||||
|
||||
#ifndef EFI_VARIABLE_NON_VOLATILE
|
||||
#define EFI_VARIABLE_NON_VOLATILE 0x00000001
|
||||
#endif
|
||||
|
||||
#ifndef EFI_VARIABLE_BOOTSERVICE_ACCESS
|
||||
#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef EFI_VARIABLE_RUNTIME_ACCESS
|
||||
#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
|
||||
#endif
|
||||
|
||||
#ifndef EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
|
||||
#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
|
||||
#endif
|
||||
|
||||
#ifndef EFI_VARIABLE_APPEND_WRITE
|
||||
#define EFI_VARIABLE_APPEND_WRITE 0x00000040
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
UINT32 dwLength;
|
||||
UINT16 wRevision;
|
||||
|
|
|
@ -87,16 +87,15 @@ struct attr {
|
|||
int value;
|
||||
};
|
||||
|
||||
#define EFI_VAR_ATTR(n) { #n, EFI_VARIABLE_ ## n }
|
||||
static struct attr attrs[] = {
|
||||
{ "NON_VOLATILE", 0x0001 },
|
||||
{ "BOOTSERVICE_ACCESS", 0x0002 },
|
||||
{ "RUNTIME_ACCESS", 0x0004 },
|
||||
{ "TIME_BASED_AUTHENTICATED_WRITE_ACCESS", 0x0020 },
|
||||
{ "APPEND_WRITE", 0x0040 },
|
||||
EFI_VAR_ATTR(NON_VOLATILE),
|
||||
EFI_VAR_ATTR(BOOTSERVICE_ACCESS),
|
||||
EFI_VAR_ATTR(RUNTIME_ACCESS),
|
||||
EFI_VAR_ATTR(TIME_BASED_AUTHENTICATED_WRITE_ACCESS),
|
||||
EFI_VAR_ATTR(APPEND_WRITE),
|
||||
};
|
||||
|
||||
#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x0020
|
||||
|
||||
static uint32_t attr_invalid = 0xffffffffu;
|
||||
static const char *attr_prefix = "EFI_VARIABLE_";
|
||||
|
||||
|
|
Loading…
Reference in a new issue