diff options
author | Geoff Levand <geoff@infradead.org> | 2018-08-02 17:29:36 +0000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-08-07 11:30:36 +1000 |
commit | c3dfc9b7b91045172d460651c0309b09b0ab121a (patch) | |
tree | 47c97548efd0e1695ece1682b2afbae61c2a6b9d /lib/efi/efivar.h | |
parent | a915889b7fbbc4be11f9a37ea7afb5b3f3d41173 (diff) | |
download | talos-petitboot-c3dfc9b7b91045172d460651c0309b09b0ab121a.tar.gz talos-petitboot-c3dfc9b7b91045172d460651c0309b09b0ab121a.zip |
lib/efi: Cleanup read/write routines
Make a new stucture struct efi_data to hold the info that describes
an efi variable. Make a common routine efi_open that opens the efi
variable file. Switch the efi get/set/del routines over to use
efi_open.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'lib/efi/efivar.h')
-rw-r--r-- | lib/efi/efivar.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/efi/efivar.h b/lib/efi/efivar.h index ebf73fa..0d44100 100644 --- a/lib/efi/efivar.h +++ b/lib/efi/efivar.h @@ -34,13 +34,20 @@ #define EFIVARFS_MAGIC 0xde5e81e4 #endif +struct efi_data { + uint32_t attributes; + size_t data_size; + void *data; + uint8_t fill[0]; +}; + void set_efivarfs_path(const char *path); const char *get_efivarfs_path(void); int efi_get_variable(void *ctx, const char *guidstr, const char *name, - uint8_t **data, size_t *data_size, uint32_t *attributes); -int efi_set_variable(void *ctx, const char *guidstr, const char *name, - uint8_t *data, size_t data_size, uint32_t attributes); -int efi_del_variable(void *ctx, const char *guidstr, const char *name); + struct efi_data **efi_data); +int efi_set_variable(const char *guidstr, const char *name, + const struct efi_data *efi_data); +int efi_del_variable(const char *guidstr, const char *name); #endif /* EFIVAR_H */ |