| 1 |
|
| 2 |
|
| 3 |
#ifndef SMMSTORETOOL__VS_H__ |
| 4 |
#define SMMSTORETOOL__VS_H__ |
| 5 |
|
| 6 |
#include <stdbool.h> |
| 7 |
|
| 8 |
#include "udk2017.h" |
| 9 |
#include "utils.h" |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
struct var_t { |
| 15 |
uint8_t reserved; |
| 16 |
uint32_t attrs; |
| 17 |
EFI_GUID guid; |
| 18 |
CHAR16 *name; |
| 19 |
size_t name_size; |
| 20 |
uint8_t *data; |
| 21 |
size_t data_size; |
| 22 |
struct var_t *next; |
| 23 |
}; |
| 24 |
|
| 25 |
struct var_store_t { |
| 26 |
struct var_t *vars; |
| 27 |
bool is_auth_var_store; |
| 28 |
}; |
| 29 |
|
| 30 |
struct var_store_t vs_load(struct mem_range_t vs_data, bool is_auth_var_store); |
| 31 |
|
| 32 |
bool vs_store(struct var_store_t *vs, struct mem_range_t vs_data); |
| 33 |
|
| 34 |
struct var_t *vs_new_var(struct var_store_t *vs); |
| 35 |
|
| 36 |
struct var_t *vs_find(struct var_store_t *vs, |
| 37 |
const char name[], |
| 38 |
const EFI_GUID *guid); |
| 39 |
|
| 40 |
void vs_delete(struct var_store_t *vs, struct var_t *var); |
| 41 |
|
| 42 |
void vs_free(struct var_store_t *vs); |
| 43 |
|
| 44 |
#endif |