Patrick Rudolph | 1ab8ad6 | 2021-04-21 10:02:55 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #ifndef _EDK2_OPTION_H_ |
| 4 | #define _EDK2_OPTION_H_ |
| 5 | |
| 6 | #include <types.h> |
| 7 | #include <commonlib/region.h> |
| 8 | |
| 9 | #include <vendorcode/intel/edk2/UDK2017/MdePkg/Include/Uefi/UefiBaseType.h> |
| 10 | |
| 11 | /** |
| 12 | * efi_fv_get_option |
| 13 | * Use the provided EFI variable store inside the region device as variable store. |
| 14 | * @rdev: the readable region to operate on |
| 15 | * @guid: the vendor guid to look for |
| 16 | * @name: the variable name to look for. NULL terminated. |
| 17 | * @dest: memory buffer to place the result into |
| 18 | * @size: on input the size of buffer pointed to by dest. |
| 19 | * on output the number of bytes written. |
| 20 | */ |
| 21 | |
| 22 | enum cb_err efi_fv_get_option(struct region_device *rdev, |
| 23 | const EFI_GUID *guid, |
| 24 | const char *name, |
| 25 | void *dest, |
| 26 | uint32_t *size); |
| 27 | |
| 28 | /** |
| 29 | * efi_fv_set_option |
| 30 | * Use the provided EFI variable store inside the region device as variable store. |
| 31 | * If the variable exists with the same size and contents, nothing will be written |
| 32 | * to the region device. |
| 33 | * @rdev: the read/writable region to operate on |
| 34 | * @guid: the vendor guid to write |
| 35 | * @name: the variable name to write. NULL terminated. |
| 36 | * @data: memory buffer where to read data from |
| 37 | * @size: the size of buffer pointed to by data |
| 38 | */ |
| 39 | enum cb_err efi_fv_set_option(struct region_device *rdev, |
| 40 | const EFI_GUID *guid, |
| 41 | const char *name, |
| 42 | void *data, |
| 43 | uint32_t size); |
| 44 | |
| 45 | enum cb_err efi_fv_print_options(struct region_device *rdev); |
| 46 | |
| 47 | #endif /* _EDK2_OPTION_H_ */ |