Deleted Added
full compact
efidef.h (96893) efidef.h (163898)
1/* $FreeBSD: head/sys/boot/efi/include/efidef.h 96893 2002-05-19 03:17:22Z marcel $ */
1/* $FreeBSD: head/sys/boot/efi/include/efidef.h 163898 2006-11-02 02:42:48Z marcel $ */
2#ifndef _EFI_DEF_H
3#define _EFI_DEF_H
4
5/*++
6
2#ifndef _EFI_DEF_H
3#define _EFI_DEF_H
4
5/*++
6
7Copyright (c) 1998 Intel Corporation
7Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
8This software and associated documentation (if any) is furnished
9under a license and may only be used or copied in accordance
10with the terms of the license. Except as permitted by such
11license, no part of this software or documentation may be
12reproduced, stored in a retrieval system, or transmitted in any
13form or by any means without the express written consent of
14Intel Corporation.
8
9Module Name:
10
11 efidef.h
12
13Abstract:
14
15 EFI definitions

--- 20 unchanged lines hidden (view full) ---

36
37typedef UINTN EFI_STATUS;
38typedef UINT64 EFI_LBA;
39typedef UINTN EFI_TPL;
40typedef VOID *EFI_HANDLE;
41typedef VOID *EFI_EVENT;
42
43
15
16Module Name:
17
18 efidef.h
19
20Abstract:
21
22 EFI definitions

--- 20 unchanged lines hidden (view full) ---

43
44typedef UINTN EFI_STATUS;
45typedef UINT64 EFI_LBA;
46typedef UINTN EFI_TPL;
47typedef VOID *EFI_HANDLE;
48typedef VOID *EFI_EVENT;
49
50
44/*
45 * Prototype argument decoration for EFI parameters to indicate
46 * their direction
47 *
48 * IN - argument is passed into the function
49 * OUT - argument (pointer) is returned from the function
50 * OPTIONAL - argument is optional
51 */
51//
52// Prototype argument decoration for EFI parameters to indicate
53// their direction
54//
55// IN - argument is passed into the function
56// OUT - argument (pointer) is returned from the function
57// OPTIONAL - argument is optional
58//
52
53#ifndef IN
54 #define IN
55 #define OUT
56 #define OPTIONAL
57#endif
58
59
59
60#ifndef IN
61 #define IN
62 #define OUT
63 #define OPTIONAL
64#endif
65
66
60/*
61 * A GUID
62 */
67//
68// A GUID
69//
63
64typedef struct {
65 UINT32 Data1;
66 UINT16 Data2;
67 UINT16 Data3;
68 UINT8 Data4[8];
69} EFI_GUID;
70
71
70
71typedef struct {
72 UINT32 Data1;
73 UINT16 Data2;
74 UINT16 Data3;
75 UINT8 Data4[8];
76} EFI_GUID;
77
78
72/*
73 * Time
74 */
79//
80// Time
81//
75
76typedef struct {
82
83typedef struct {
77 UINT16 Year; /* 1998 - 20XX */
78 UINT8 Month; /* 1 - 12 */
79 UINT8 Day; /* 1 - 31 */
80 UINT8 Hour; /* 0 - 23 */
81 UINT8 Minute; /* 0 - 59 */
82 UINT8 Second; /* 0 - 59 */
83 UINT8 Pad1;
84 UINT32 Nanosecond; /* 0 - 999,999,999 */
85 INT16 TimeZone; /* -1440 to 1440 or 2047 */
86 UINT8 Daylight;
87 UINT8 Pad2;
84 UINT16 Year; // 1998 - 20XX
85 UINT8 Month; // 1 - 12
86 UINT8 Day; // 1 - 31
87 UINT8 Hour; // 0 - 23
88 UINT8 Minute; // 0 - 59
89 UINT8 Second; // 0 - 59
90 UINT8 Pad1;
91 UINT32 Nanosecond; // 0 - 999,999,999
92 INT16 TimeZone; // -1440 to 1440 or 2047
93 UINT8 Daylight;
94 UINT8 Pad2;
88} EFI_TIME;
89
95} EFI_TIME;
96
90/* Bit definitions for EFI_TIME.Daylight */
97// Bit definitions for EFI_TIME.Daylight
91#define EFI_TIME_ADJUST_DAYLIGHT 0x01
92#define EFI_TIME_IN_DAYLIGHT 0x02
93
98#define EFI_TIME_ADJUST_DAYLIGHT 0x01
99#define EFI_TIME_IN_DAYLIGHT 0x02
100
94/* Value definition for EFI_TIME.TimeZone */
101// Value definition for EFI_TIME.TimeZone
95#define EFI_UNSPECIFIED_TIMEZONE 0x07FF
96
97
98
102#define EFI_UNSPECIFIED_TIMEZONE 0x07FF
103
104
105
99/*
100 * Networking
101 */
106//
107// Networking
108//
102
103typedef struct {
104 UINT8 Addr[4];
105} EFI_IPv4_ADDRESS;
106
107typedef struct {
108 UINT8 Addr[16];
109} EFI_IPv6_ADDRESS;
110
111typedef struct {
112 UINT8 Addr[32];
113} EFI_MAC_ADDRESS;
114
109
110typedef struct {
111 UINT8 Addr[4];
112} EFI_IPv4_ADDRESS;
113
114typedef struct {
115 UINT8 Addr[16];
116} EFI_IPv6_ADDRESS;
117
118typedef struct {
119 UINT8 Addr[32];
120} EFI_MAC_ADDRESS;
121
115/*
116 * Memory
117 */
122//
123// Memory
124//
118
119typedef UINT64 EFI_PHYSICAL_ADDRESS;
120typedef UINT64 EFI_VIRTUAL_ADDRESS;
121
122typedef enum {
123 AllocateAnyPages,
124 AllocateMaxAddress,
125 AllocateAddress,
126 MaxAllocateType
127} EFI_ALLOCATE_TYPE;
128
125
126typedef UINT64 EFI_PHYSICAL_ADDRESS;
127typedef UINT64 EFI_VIRTUAL_ADDRESS;
128
129typedef enum {
130 AllocateAnyPages,
131 AllocateMaxAddress,
132 AllocateAddress,
133 MaxAllocateType
134} EFI_ALLOCATE_TYPE;
135
129/*
130 * Preseve the attr on any range supplied.
131 * ConventialMemory must have WB,SR,SW when supplied.
132 * When allocating from ConventialMemory always make it WB,SR,SW
133 * When returning to ConventialMemory always make it WB,SR,SW
134 * When getting the memory map, or on RT for runtime types
135 */
136//Preseve the attr on any range supplied.
137//ConventialMemory must have WB,SR,SW when supplied.
138//When allocating from ConventialMemory always make it WB,SR,SW
139//When returning to ConventialMemory always make it WB,SR,SW
140//When getting the memory map, or on RT for runtime types
136
141
142
137typedef enum {
138 EfiReservedMemoryType,
139 EfiLoaderCode,
140 EfiLoaderData,
141 EfiBootServicesCode,
142 EfiBootServicesData,
143 EfiRuntimeServicesCode,
144 EfiRuntimeServicesData,
145 EfiConventionalMemory,
146 EfiUnusableMemory,
147 EfiACPIReclaimMemory,
148 EfiACPIMemoryNVS,
149 EfiMemoryMappedIO,
150 EfiMemoryMappedIOPortSpace,
151 EfiPalCode,
152 EfiMaxMemoryType
153} EFI_MEMORY_TYPE;
154
143typedef enum {
144 EfiReservedMemoryType,
145 EfiLoaderCode,
146 EfiLoaderData,
147 EfiBootServicesCode,
148 EfiBootServicesData,
149 EfiRuntimeServicesCode,
150 EfiRuntimeServicesData,
151 EfiConventionalMemory,
152 EfiUnusableMemory,
153 EfiACPIReclaimMemory,
154 EfiACPIMemoryNVS,
155 EfiMemoryMappedIO,
156 EfiMemoryMappedIOPortSpace,
157 EfiPalCode,
158 EfiMaxMemoryType
159} EFI_MEMORY_TYPE;
160
155/* possible caching types for the memory range */
161// possible caching types for the memory range
156#define EFI_MEMORY_UC 0x0000000000000001
157#define EFI_MEMORY_WC 0x0000000000000002
158#define EFI_MEMORY_WT 0x0000000000000004
159#define EFI_MEMORY_WB 0x0000000000000008
160#define EFI_MEMORY_UCE 0x0000000000000010
161
162#define EFI_MEMORY_UC 0x0000000000000001
163#define EFI_MEMORY_WC 0x0000000000000002
164#define EFI_MEMORY_WT 0x0000000000000004
165#define EFI_MEMORY_WB 0x0000000000000008
166#define EFI_MEMORY_UCE 0x0000000000000010
167
162/* physical memory protection on range */
168// physical memory protection on range
163#define EFI_MEMORY_WP 0x0000000000001000
164#define EFI_MEMORY_RP 0x0000000000002000
165#define EFI_MEMORY_XP 0x0000000000004000
166
169#define EFI_MEMORY_WP 0x0000000000001000
170#define EFI_MEMORY_RP 0x0000000000002000
171#define EFI_MEMORY_XP 0x0000000000004000
172
167/* range requires a runtime mapping */
173// range requires a runtime mapping
168#define EFI_MEMORY_RUNTIME 0x8000000000000000
169
170#define EFI_MEMORY_DESCRIPTOR_VERSION 1
171typedef struct {
174#define EFI_MEMORY_RUNTIME 0x8000000000000000
175
176#define EFI_MEMORY_DESCRIPTOR_VERSION 1
177typedef struct {
172 UINT32 Type; /* 32 bit padding */
173 EFI_PHYSICAL_ADDRESS PhysicalStart;
174 EFI_VIRTUAL_ADDRESS VirtualStart;
175 UINT64 NumberOfPages;
176 UINT64 Attribute;
178 UINT32 Type; // Field size is 32 bits followed by 32 bit pad
179 EFI_PHYSICAL_ADDRESS PhysicalStart; // Field size is 64 bits
180 EFI_VIRTUAL_ADDRESS VirtualStart; // Field size is 64 bits
181 UINT64 NumberOfPages; // Field size is 64 bits
182 UINT64 Attribute; // Field size is 64 bits
177} EFI_MEMORY_DESCRIPTOR;
178
183} EFI_MEMORY_DESCRIPTOR;
184
179/*
180 * International Language
181 */
185//
186// International Language
187//
182
183typedef UINT8 ISO_639_2;
184#define ISO_639_2_ENTRY_SIZE 3
185
188
189typedef UINT8 ISO_639_2;
190#define ISO_639_2_ENTRY_SIZE 3
191
192//
193//
194//
195
186#define EFI_PAGE_SIZE 4096
187#define EFI_PAGE_MASK 0xFFF
188#define EFI_PAGE_SHIFT 12
189
190#define EFI_SIZE_TO_PAGES(a) \
196#define EFI_PAGE_SIZE 4096
197#define EFI_PAGE_MASK 0xFFF
198#define EFI_PAGE_SHIFT 12
199
200#define EFI_SIZE_TO_PAGES(a) \
191 ( ((a) >> EFI_PAGE_SHIFT) + ((a) & EFI_PAGE_MASK ? 1 : 0) )
201 ( ((a) >> EFI_PAGE_SHIFT) + (((a) & EFI_PAGE_MASK) ? 1 : 0) )
192
193#endif
202
203#endif