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>
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 \
51 void efi_init_mount(struct efi_mount *efi_mount, const char *path,
53 bool efi_check_mount_magic(const struct efi_mount *efi_mount, bool check_magic);
54 static inline bool efi_check_mount(const struct efi_mount *efi_mount)
56 return efi_check_mount_magic(efi_mount, true);
59 int efi_get_variable(void *ctx, const struct efi_mount *efi_mount,
60 const char *name, struct efi_data **efi_data);
61 int efi_set_variable(const struct efi_mount *efi_mount, const char *name,
62 const struct efi_data *efi_data);
63 int efi_del_variable(const struct efi_mount *efi_mount, const char *name);