2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; version 2 of the License.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 * Copyright (C) 2018 Huaxintong Semiconductor Technology Co.,Ltd. All rights
17 * Author: Ge Song <ge.song@hxt-semitech.com>
22 #include <linux/magic.h>
25 #define EFI_VARIABLE_NON_VOLATILE 0x00000001
26 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
27 #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
28 #define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
29 #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
30 #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
31 #define EFI_VARIABLE_APPEND_WRITE 0x00000040
33 #define EFI_DEFALT_ATTRIBUTES ( \
34 EFI_VARIABLE_NON_VOLATILE | \
35 EFI_VARIABLE_RUNTIME_ACCESS | \
36 EFI_VARIABLE_BOOTSERVICE_ACCESS \
39 #ifndef EFIVARFS_MAGIC
40 #define EFIVARFS_MAGIC 0xde5e81e4
50 void set_efivarfs_path(const char *path);
51 const char *get_efivarfs_path(void);
53 int efi_get_variable(void *ctx, const char *guidstr, const char *name,
54 struct efi_data **efi_data);
55 int efi_set_variable(const char *guidstr, const char *name,
56 const struct efi_data *efi_data);
57 int efi_del_variable(const char *guidstr, const char *name);