Home | History | Annotate | Line # | Download | only in efi
      1  1.2  riastrad /* $NetBSD: defs.h,v 1.2 2025/03/30 14:36:48 riastradh Exp $ */
      2  1.1  christos 
      3  1.1  christos /*
      4  1.1  christos  * Redistribution and use in source and binary forms, with or without
      5  1.1  christos  * modification, are permitted provided that the following conditions
      6  1.1  christos  * are met:
      7  1.1  christos  * 1. Redistributions of source code must retain the above copyright
      8  1.1  christos  *    notice, this list of conditions and the following disclaimer.
      9  1.1  christos  * 2. Redistributions in binary form must reproduce the above copyright
     10  1.1  christos  *    notice, this list of conditions and the following disclaimer in the
     11  1.1  christos  *    documentation and/or other materials provided with the distribution.
     12  1.1  christos  *
     13  1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
     14  1.1  christos  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     15  1.1  christos  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     16  1.1  christos  * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     17  1.1  christos  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     18  1.1  christos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     19  1.1  christos  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     20  1.1  christos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     21  1.1  christos  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     22  1.1  christos  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     23  1.1  christos  * SUCH DAMAGE.
     24  1.1  christos  */
     25  1.1  christos 
     26  1.1  christos #ifndef _DEFS_H_
     27  1.1  christos #define _DEFS_H_
     28  1.1  christos 
     29  1.1  christos #ifndef lint
     30  1.2  riastrad __RCSID("$NetBSD: defs.h,v 1.2 2025/03/30 14:36:48 riastradh Exp $");
     31  1.1  christos #endif /* not lint */
     32  1.1  christos 
     33  1.1  christos #define PUBLIC
     34  1.1  christos #define VERSION 18
     35  1.1  christos 
     36  1.1  christos /* debug bit flags */
     37  1.1  christos 
     38  1.1  christos #define DEBUG_STRUCT_BIT	__BIT(0)
     39  1.1  christos #define DEBUG_DATA_BIT		__BIT(1)
     40  1.1  christos #define DEBUG_EFI_IOC_BIT	__BIT(2)
     41  1.1  christos #define DEBUG_MASK		__BITS(15,0)
     42  1.1  christos #define DEBUG_BRIEF_BIT		__BIT(16)
     43  1.1  christos #define DEBUG_VERBOSE_BIT	__BIT(17)
     44  1.1  christos 
     45  1.1  christos #define EFI_GLOBAL_VARIABLE \
     46  1.1  christos 	((uuid_t){0x8be4df61,0x93ca,0x11d2,0xaa,0x0d,\
     47  1.1  christos 	  {0x00,0xe0,0x98,0x03,0x2b,0x8c}})
     48  1.1  christos #if 0
     49  1.1  christos /* XXX: same as EFI_GLOBAL_VARIABLE */
     50  1.1  christos #define EFI_VARIABLE_GUID \
     51  1.1  christos 	((uuid_t){0x8be4df61,0x93ca,0x11d2,0xaa,0x0d,\
     52  1.1  christos 	  {0x00,0xe0,0x98,0x03,0x2b,0x8c}})
     53  1.1  christos #endif
     54  1.1  christos 
     55  1.1  christos #define	EFI_TABLE_SMBIOS \
     56  1.1  christos 	((uuid_t){0xeb9d2d31,0x2d88,0x11d3,0x9a,0x16,\
     57  1.1  christos 	  {0x00,0x90,0x27,0x3f,0xc1,0x4d}}
     58  1.1  christos 
     59  1.1  christos #define	EFI_TABLE_SMBIOS3 \
     60  1.1  christos 	((uuid_t){0xf2fd1544,0x9794,0x4a2c,0x99,0x2e,\
     61  1.1  christos 	  {0xe5,0xbb,0xcf,0x20,0xe3,0x94}}
     62  1.1  christos 
     63  1.1  christos #define LINUX_EFI_MEMRESERVE_TABLE \
     64  1.1  christos 	((uuid_t){0x888eb0c6,0x8ede,0x4ff5,0xa8,0xf0,\
     65  1.1  christos 	  {0x9a,0xee,0x5c,0xb9,0x77,0xc2}}
     66  1.1  christos 
     67  1.1  christos #define EFI_UNKNOWN_GUID \
     68  1.1  christos 	((uuid_t){0x47c7b225,0xc42a,0x11d2,0x57,0x8e,\
     69  1.1  christos 	  {0x00,0xa0,0xc9,0x69,0x72,0x3b}}
     70  1.1  christos 
     71  1.1  christos #define EFI_ADDRESS_RANGE_MIRROR_VARIABLE_GUID \
     72  1.1  christos 	((uuid_t){0x7b9be2e0,0xe28a,0x4197,0x3e,0xad,\
     73  1.1  christos 	  {0x32,0xf0,0x62,0xf9,0x46,0x2c}}
     74  1.1  christos 
     75  1.1  christos /*
     76  1.1  christos  * XXX: It would be nice to have QueryVariableInfo() support to get
     77  1.2  riastrad  * maximum variable size ... or at least export EFI_VARNAME_MAXBYTES
     78  1.1  christos  * from efi.h!
     79  1.1  christos  */
     80  1.1  christos /* From sys/arch/x86/include/efi.h */
     81  1.1  christos #define	EFI_PAGE_SHIFT		12
     82  1.1  christos #define	EFI_PAGE_SIZE		(1 << EFI_PAGE_SHIFT)
     83  1.2  riastrad #define	EFI_VARNAME_MAXBYTES	EFI_PAGE_SIZE
     84  1.1  christos 
     85  1.1  christos /* XXX: Why is this not exposed in sys/uuid.h? */
     86  1.1  christos #define	UUID_STR_LEN	_UUID_STR_LEN
     87  1.1  christos 
     88  1.1  christos #endif /* _DEFS_H_ */
     89