summaryrefslogtreecommitdiff
path: root/src/drivers/efi/efivars.h
blob: b3443b33b350ae26462004f86dd8bc737ea27464 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef _EDK2_OPTION_H_
#define _EDK2_OPTION_H_

#include <types.h>
#include <commonlib/region.h>

#include <vendorcode/intel/edk2/UDK2017/MdePkg/Include/Uefi/UefiBaseType.h>

/**
 * efi_fv_get_option
 * Use the provided EFI variable store inside the region device as variable store.
 * @rdev: the readable region to operate on
 * @guid: the vendor guid to look for
 * @name: the variable name to look for. NULL terminated.
 * @dest: memory buffer to place the result into
 * @size: on input the size of buffer pointed to by dest.
 *        on output the number of bytes written.
 */

enum cb_err efi_fv_get_option(struct region_device *rdev,
			      const EFI_GUID *guid,
			      const char *name,
			      void *dest,
			      uint32_t *size);

/**
 * efi_fv_set_option
 * Use the provided EFI variable store inside the region device as variable store.
 * If the variable exists with the same size and contents, nothing will be written
 * to the region device.
 * @rdev: the read/writable region to operate on
 * @guid: the vendor guid to write
 * @name: the variable name to write. NULL terminated.
 * @data: memory buffer where to read data from
 * @size: the size of buffer pointed to by data
 */
enum cb_err efi_fv_set_option(struct region_device *rdev,
			      const EFI_GUID *guid,
			      const char *name,
			      void *data,
			      uint32_t size);

enum cb_err efi_fv_print_options(struct region_device *rdev);

#endif /* _EDK2_OPTION_H_ */