2 * $FreeBSD: src/sys/boot/efi/include/efidef.h,v 1.2 2002/05/19 03:17:20 marcel Exp $
3 * $DragonFly: src/sys/boot/efi/include/efidef.h,v 1.1 2003/11/10 06:08:32 dillon Exp $
10 Copyright (c) 1998 Intel Corporation
27 typedef UINT16 CHAR16;
29 typedef UINT8 BOOLEAN;
32 #define TRUE ((BOOLEAN) 1)
33 #define FALSE ((BOOLEAN) 0)
37 #define NULL ((VOID *) 0)
40 typedef UINTN EFI_STATUS;
41 typedef UINT64 EFI_LBA;
42 typedef UINTN EFI_TPL;
43 typedef VOID *EFI_HANDLE;
44 typedef VOID *EFI_EVENT;
48 * Prototype argument decoration for EFI parameters to indicate
51 * IN - argument is passed into the function
52 * OUT - argument (pointer) is returned from the function
53 * OPTIONAL - argument is optional
80 UINT16 Year; /* 1998 - 20XX */
81 UINT8 Month; /* 1 - 12 */
82 UINT8 Day; /* 1 - 31 */
83 UINT8 Hour; /* 0 - 23 */
84 UINT8 Minute; /* 0 - 59 */
85 UINT8 Second; /* 0 - 59 */
87 UINT32 Nanosecond; /* 0 - 999,999,999 */
88 INT16 TimeZone; /* -1440 to 1440 or 2047 */
93 /* Bit definitions for EFI_TIME.Daylight */
94 #define EFI_TIME_ADJUST_DAYLIGHT 0x01
95 #define EFI_TIME_IN_DAYLIGHT 0x02
97 /* Value definition for EFI_TIME.TimeZone */
98 #define EFI_UNSPECIFIED_TIMEZONE 0x07FF
122 typedef UINT64 EFI_PHYSICAL_ADDRESS;
123 typedef UINT64 EFI_VIRTUAL_ADDRESS;
133 * Preseve the attr on any range supplied.
134 * ConventialMemory must have WB,SR,SW when supplied.
135 * When allocating from ConventialMemory always make it WB,SR,SW
136 * When returning to ConventialMemory always make it WB,SR,SW
137 * When getting the memory map, or on RT for runtime types
141 EfiReservedMemoryType,
146 EfiRuntimeServicesCode,
147 EfiRuntimeServicesData,
148 EfiConventionalMemory,
150 EfiACPIReclaimMemory,
153 EfiMemoryMappedIOPortSpace,
158 /* possible caching types for the memory range */
159 #define EFI_MEMORY_UC 0x0000000000000001
160 #define EFI_MEMORY_WC 0x0000000000000002
161 #define EFI_MEMORY_WT 0x0000000000000004
162 #define EFI_MEMORY_WB 0x0000000000000008
163 #define EFI_MEMORY_UCE 0x0000000000000010
165 /* physical memory protection on range */
166 #define EFI_MEMORY_WP 0x0000000000001000
167 #define EFI_MEMORY_RP 0x0000000000002000
168 #define EFI_MEMORY_XP 0x0000000000004000
170 /* range requires a runtime mapping */
171 #define EFI_MEMORY_RUNTIME 0x8000000000000000
173 #define EFI_MEMORY_DESCRIPTOR_VERSION 1
175 UINT32 Type; /* 32 bit padding */
176 EFI_PHYSICAL_ADDRESS PhysicalStart;
177 EFI_VIRTUAL_ADDRESS VirtualStart;
178 UINT64 NumberOfPages;
180 } EFI_MEMORY_DESCRIPTOR;
183 * International Language
186 typedef UINT8 ISO_639_2;
187 #define ISO_639_2_ENTRY_SIZE 3
189 #define EFI_PAGE_SIZE 4096
190 #define EFI_PAGE_MASK 0xFFF
191 #define EFI_PAGE_SHIFT 12
193 #define EFI_SIZE_TO_PAGES(a) \
194 ( ((a) >> EFI_PAGE_SHIFT) + ((a) & EFI_PAGE_MASK ? 1 : 0) )