3rdparty/fsp: Update submodule to upstream master
[coreboot.git] / util / smmstoretool / vs.h
blob2ac9e6c8b256dc02d6e6562a1d394257fd2ed860
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #ifndef SMMSTORETOOL__VS_H__
4 #define SMMSTORETOOL__VS_H__
6 #include <stdbool.h>
8 #include "udk2017.h"
9 #include "utils.h"
11 // Variable store is part of firmware volume. This unit doesn't deal with its
12 // header only with data that follows.
14 struct var_t {
15 uint8_t reserved;
16 uint32_t attrs;
17 EFI_GUID guid;
18 CHAR16 *name;
19 size_t name_size; // in bytes
20 uint8_t *data;
21 size_t data_size; // in bytes
22 struct var_t *next;
25 struct var_store_t {
26 struct var_t *vars;
27 bool auth_vars;
30 struct var_store_t vs_load(struct mem_range_t vs_data, bool auth_vars);
32 bool vs_store(struct var_store_t *vs, struct mem_range_t vs_data);
34 struct var_t *vs_new_var(struct var_store_t *vs);
36 struct var_t *vs_find(struct var_store_t *vs,
37 const char name[],
38 const EFI_GUID *guid);
40 void vs_delete(struct var_store_t *vs, struct var_t *var);
42 void vs_free(struct var_store_t *vs);
44 #endif // SMMSTORETOOL__VS_H__