From c3dfc9b7b91045172d460651c0309b09b0ab121a Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Thu, 2 Aug 2018 17:29:36 +0000 Subject: 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 Signed-off-by: Samuel Mendoza-Jonas --- lib/efi/efivar.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lib/efi/efivar.h') 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 */ -- cgit v1.2.1