Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / ia64 / stand / efi / include / efidef.h
blobee7febbcd4ab9a57855de254e845c4bc2cf22f4d
1 /* $NetBSD: efidef.h,v 1.1 2006/04/07 14:21:29 cherry Exp $ */
2 /* $FreeBSD: src/sys/boot/efi/include/efidef.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
4 #ifndef _EFI_DEF_H
5 #define _EFI_DEF_H
7 /*++
9 Copyright (c) 1998 Intel Corporation
11 Module Name:
13 efidef.h
15 Abstract:
17 EFI definitions
22 Revision History
24 --*/
26 typedef UINT16 CHAR16;
27 typedef UINT8 CHAR8;
28 typedef UINT8 BOOLEAN;
30 #ifndef TRUE
31 #define TRUE ((BOOLEAN) 1)
32 #define FALSE ((BOOLEAN) 0)
33 #endif
35 #ifndef NULL
36 #define NULL ((VOID *) 0)
37 #endif
39 typedef UINTN EFI_STATUS;
40 typedef UINT64 EFI_LBA;
41 typedef UINTN EFI_TPL;
42 typedef VOID *EFI_HANDLE;
43 typedef VOID *EFI_EVENT;
47 * Prototype argument decoration for EFI parameters to indicate
48 * their direction
50 * IN - argument is passed into the function
51 * OUT - argument (pointer) is returned from the function
52 * OPTIONAL - argument is optional
55 #ifndef IN
56 #define IN
57 #define OUT
58 #define OPTIONAL
59 #endif
63 * A GUID
66 typedef struct {
67 UINT32 Data1;
68 UINT16 Data2;
69 UINT16 Data3;
70 UINT8 Data4[8];
71 } EFI_GUID;
75 * Time
78 typedef struct {
79 UINT16 Year; /* 1998 - 20XX */
80 UINT8 Month; /* 1 - 12 */
81 UINT8 Day; /* 1 - 31 */
82 UINT8 Hour; /* 0 - 23 */
83 UINT8 Minute; /* 0 - 59 */
84 UINT8 Second; /* 0 - 59 */
85 UINT8 Pad1;
86 UINT32 Nanosecond; /* 0 - 999,999,999 */
87 INT16 TimeZone; /* -1440 to 1440 or 2047 */
88 UINT8 Daylight;
89 UINT8 Pad2;
90 } EFI_TIME;
92 /* Bit definitions for EFI_TIME.Daylight */
93 #define EFI_TIME_ADJUST_DAYLIGHT 0x01
94 #define EFI_TIME_IN_DAYLIGHT 0x02
96 /* Value definition for EFI_TIME.TimeZone */
97 #define EFI_UNSPECIFIED_TIMEZONE 0x07FF
102 * Networking
105 typedef struct {
106 UINT8 Addr[4];
107 } EFI_IPv4_ADDRESS;
109 typedef struct {
110 UINT8 Addr[16];
111 } EFI_IPv6_ADDRESS;
113 typedef struct {
114 UINT8 Addr[32];
115 } EFI_MAC_ADDRESS;
118 * Memory
121 typedef UINT64 EFI_PHYSICAL_ADDRESS;
122 typedef UINT64 EFI_VIRTUAL_ADDRESS;
124 typedef enum {
125 AllocateAnyPages,
126 AllocateMaxAddress,
127 AllocateAddress,
128 MaxAllocateType
129 } EFI_ALLOCATE_TYPE;
132 * Preseve the attr on any range supplied.
133 * ConventialMemory must have WB,SR,SW when supplied.
134 * When allocating from ConventialMemory always make it WB,SR,SW
135 * When returning to ConventialMemory always make it WB,SR,SW
136 * When getting the memory map, or on RT for runtime types
139 typedef enum {
140 EfiReservedMemoryType,
141 EfiLoaderCode,
142 EfiLoaderData,
143 EfiBootServicesCode,
144 EfiBootServicesData,
145 EfiRuntimeServicesCode,
146 EfiRuntimeServicesData,
147 EfiConventionalMemory,
148 EfiUnusableMemory,
149 EfiACPIReclaimMemory,
150 EfiACPIMemoryNVS,
151 EfiMemoryMappedIO,
152 EfiMemoryMappedIOPortSpace,
153 EfiPalCode,
154 EfiMaxMemoryType
155 } EFI_MEMORY_TYPE;
157 /* possible caching types for the memory range */
158 #define EFI_MEMORY_UC 0x0000000000000001
159 #define EFI_MEMORY_WC 0x0000000000000002
160 #define EFI_MEMORY_WT 0x0000000000000004
161 #define EFI_MEMORY_WB 0x0000000000000008
162 #define EFI_MEMORY_UCE 0x0000000000000010
164 /* physical memory protection on range */
165 #define EFI_MEMORY_WP 0x0000000000001000
166 #define EFI_MEMORY_RP 0x0000000000002000
167 #define EFI_MEMORY_XP 0x0000000000004000
169 /* range requires a runtime mapping */
170 #define EFI_MEMORY_RUNTIME 0x8000000000000000
172 #define EFI_MEMORY_DESCRIPTOR_VERSION 1
173 typedef struct {
174 UINT32 Type; /* 32 bit padding */
175 EFI_PHYSICAL_ADDRESS PhysicalStart;
176 EFI_VIRTUAL_ADDRESS VirtualStart;
177 UINT64 NumberOfPages;
178 UINT64 Attribute;
179 } EFI_MEMORY_DESCRIPTOR;
182 * International Language
185 typedef UINT8 ISO_639_2;
186 #define ISO_639_2_ENTRY_SIZE 3
188 #define EFI_PAGE_SIZE 4096
189 #define EFI_PAGE_MASK 0xFFF
190 #define EFI_PAGE_SHIFT 12
192 #define EFI_SIZE_TO_PAGES(a) \
193 ( ((a) >> EFI_PAGE_SHIFT) + ((a) & EFI_PAGE_MASK ? 1 : 0) )
195 #endif