FreeBSD/Linux Kernel Cross Reference
sys/sys/efiio.h
1 /* $NetBSD: efiio.h,v 1.2 2021/10/11 10:23:02 jmcneill Exp $ */
2
3 /*-
4 * Copyright (c) 2021 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jared McNeill <jmcneill@invisible.ca>.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #ifndef _SYS_EFIIO_H
33 #define _SYS_EFIIO_H
34
35 #include <sys/types.h>
36 #include <sys/ioccom.h>
37 #include <sys/uuid.h>
38
39 /*
40 * Variable attributes
41 */
42 #define EFI_VARIABLE_NON_VOLATILE 0x00000001
43 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
44 #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
45 #define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
46 #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
47 #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
48 #define EFI_VARIABLE_APPEND_WRITE 0x00000040
49 #define EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS 0x00000080
50
51 struct efi_var_ioc {
52 uint16_t * name; /* vendor's variable name */
53 size_t namesize; /* size in bytes of the name buffer */
54 struct uuid vendor; /* unique identifier for vendor */
55 uint32_t attrib; /* variable attribute bitmask */
56 void * data; /* buffer containing variable data */
57 size_t datasize; /* size in bytes of the data buffer */
58 };
59
60 #define EFIIOC_VAR_GET _IOWR('e', 4, struct efi_var_ioc)
61 #define EFIIOC_VAR_NEXT _IOWR('e', 5, struct efi_var_ioc)
62 #define EFIIOC_VAR_SET _IOWR('e', 7, struct efi_var_ioc)
63
64 #endif /* _SYS_EFIIO_H */
Cache object: f6a2f9e643dc6190795702d7c204029b
|