1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2020, Heinrich Schuchardt <xypron.glpk@gmx.de>
6 #ifndef _EFI_VARIABLE_H
7 #define _EFI_VARIABLE_H
9 #include <linux/bitops.h>
11 #define EFI_VARIABLE_READ_ONLY BIT(31)
14 * efi_get_variable() - retrieve value of a UEFI variable
16 * @variable_name: name of the variable
17 * @vendor: vendor GUID
18 * @attributes: attributes of the variable
19 * @data_size: size of the buffer to which the variable value is copied
20 * @data: buffer to which the variable value is copied
21 * @timep: authentication time (seconds since start of epoch)
24 efi_status_t efi_get_variable_int(u16 *variable_name, const efi_guid_t *vendor,
25 u32 *attributes, efi_uintn_t *data_size,
26 void *data, u64 *timep);
29 * efi_set_variable() - set value of a UEFI variable
31 * @variable_name: name of the variable
32 * @vendor: vendor GUID
33 * @attributes: attributes of the variable
34 * @data_size: size of the buffer with the variable value
35 * @data: buffer with the variable value
36 * @ro_check: check the read only read only bit in attributes
39 efi_status_t efi_set_variable_int(u16 *variable_name, const efi_guid_t *vendor,
40 u32 attributes, efi_uintn_t data_size,
41 const void *data, bool ro_check);