1 | /*␊ |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * This file contains Original Code and/or Modifications of Original Code␊ |
7 | * as defined in and that are subject to the Apple Public Source License␊ |
8 | * Version 2.0 (the 'License'). You may not use this file except in␊ |
9 | * compliance with the License. The rights granted to you under the License␊ |
10 | * may not be used to create, or enable the creation or redistribution of,␊ |
11 | * unlawful or unlicensed copies of an Apple operating system, or to␊ |
12 | * circumvent, violate, or enable the circumvention or violation of, any␊ |
13 | * terms of an Apple operating system software license agreement.␊ |
14 | * ␊ |
15 | * Please obtain a copy of the License at␊ |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file.␊ |
17 | * ␊ |
18 | * The Original Code and all software distributed under the License are␊ |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.␊ |
23 | * Please see the License for the specific language governing rights and␊ |
24 | * limitations under the License.␊ |
25 | * ␊ |
26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@␊ |
27 | */␊ |
28 | #ifndef _PEXPERT_I386_BOOT_H␊ |
29 | #define _PEXPERT_I386_BOOT_H␊ |
30 | ␊ |
31 | #include <stdint.h>␊ |
32 | ␊ |
33 | /*␊ |
34 | * What the booter leaves behind for the kernel.␊ |
35 | */␊ |
36 | ␊ |
37 | /*␊ |
38 | * Types of boot driver that may be loaded by the booter.␊ |
39 | */␊ |
40 | enum {␊ |
41 | kBootDriverTypeInvalid = 0,␊ |
42 | kBootDriverTypeKEXT = 1,␊ |
43 | kBootDriverTypeMKEXT = 2␊ |
44 | };␊ |
45 | ␊ |
46 | enum {␊ |
47 | kEfiReservedMemoryType␉= 0,␊ |
48 | kEfiLoaderCode␉␉= 1,␊ |
49 | kEfiLoaderData␉␉= 2,␊ |
50 | kEfiBootServicesCode␉= 3,␊ |
51 | kEfiBootServicesData␉= 4,␊ |
52 | kEfiRuntimeServicesCode␉= 5,␊ |
53 | kEfiRuntimeServicesData␉= 6,␊ |
54 | kEfiConventionalMemory␉= 7,␊ |
55 | kEfiUnusableMemory␉␉= 8,␊ |
56 | kEfiACPIReclaimMemory␉= 9,␊ |
57 | kEfiACPIMemoryNVS␉␉= 10,␊ |
58 | kEfiMemoryMappedIO␉␉= 11,␊ |
59 | kEfiMemoryMappedIOPortSpace = 12,␊ |
60 | kEfiPalCode␉␉␉= 13,␊ |
61 | kEfiMaxMemoryType␉␉= 14␊ |
62 | };␊ |
63 | ␊ |
64 | /*␊ |
65 | * Memory range descriptor.␊ |
66 | */␊ |
67 | typedef struct EfiMemoryRange {␊ |
68 | uint32_t Type;␊ |
69 | uint32_t Pad;␊ |
70 | uint64_t PhysicalStart;␊ |
71 | uint64_t VirtualStart;␊ |
72 | uint64_t NumberOfPages;␊ |
73 | uint64_t Attribute;␊ |
74 | } EfiMemoryRange;␊ |
75 | ␊ |
76 | #define BOOT_LINE_LENGTH 1024␊ |
77 | #define BOOT_STRING_LEN BOOT_LINE_LENGTH␊ |
78 | ␊ |
79 | /*␊ |
80 | * Video information.. ␊ |
81 | */␊ |
82 | ␊ |
83 | struct Boot_Video {␊ |
84 | ␉uint32_t␉v_baseAddr;␉/* Base address of video memory */␊ |
85 | ␉uint32_t␉v_display;␉/* Display Code (if Applicable */␊ |
86 | ␉uint32_t␉v_rowBytes;␉/* Number of bytes per pixel row */␊ |
87 | ␉uint32_t␉v_width;␉/* Width */␊ |
88 | ␉uint32_t␉v_height;␉/* Height */␊ |
89 | ␉uint32_t␉v_depth;␉/* Pixel Depth */␊ |
90 | };␊ |
91 | ␊ |
92 | typedef struct Boot_Video␉Boot_Video;␊ |
93 | ␊ |
94 | /* Values for v_display */␊ |
95 | ␊ |
96 | #define GRAPHICS_MODE 1␊ |
97 | #define FB_TEXT_MODE 2␊ |
98 | ␊ |
99 | /* Boot argument structure - passed into Mach kernel at boot time.␊ |
100 | * "Revision" can be incremented for compatible changes␊ |
101 | */␊ |
102 | #define kBootArgsRevision␉␉0␊ |
103 | #define kBootArgsVersion␉␉2␊ |
104 | ␊ |
105 | /* Snapshot constants of previous revisions that are supported */␊ |
106 | #define kBootArgsVersion1␉␉1␊ |
107 | #define kBootArgsVersion2␉␉2␊ |
108 | #define kBootArgsRevision2_0␉␉0␊ |
109 | ␊ |
110 | #define kBootArgsEfiMode32 32␊ |
111 | #define kBootArgsEfiMode64 64␊ |
112 | ␊ |
113 | typedef struct boot_args_Legacy {␊ |
114 | uint16_t Revision;␉/* Revision of boot_args structure */␊ |
115 | uint16_t Version;␉/* Version of boot_args structure */␊ |
116 | ␊ |
117 | char CommandLine[BOOT_LINE_LENGTH];␉/* Passed in command line */␊ |
118 | ␊ |
119 | uint32_t MemoryMap; /* Physical address of memory map */␊ |
120 | uint32_t MemoryMapSize;␊ |
121 | uint32_t MemoryMapDescriptorSize;␊ |
122 | uint32_t MemoryMapDescriptorVersion;␊ |
123 | ␊ |
124 | Boot_Video␉Video;␉␉/* Video Information */␊ |
125 | ␊ |
126 | uint32_t deviceTreeP;␉ /* Physical address of flattened device tree */␊ |
127 | uint32_t deviceTreeLength; /* Length of flattened tree */␊ |
128 | ␊ |
129 | uint32_t kaddr; /* Physical address of beginning of kernel text */␊ |
130 | uint32_t ksize; /* Size of combined kernel text+data+efi */␊ |
131 | ␊ |
132 | uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */␊ |
133 | uint32_t efiRuntimeServicesPageCount;␊ |
134 | uint32_t efiSystemTable; /* physical address of system table in runtime area */␊ |
135 | ␊ |
136 | uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */␊ |
137 | uint8_t __reserved1[3];␊ |
138 | uint32_t __reserved2[1];␊ |
139 | uint32_t performanceDataStart; /* physical address of log */␊ |
140 | uint32_t performanceDataSize;␊ |
141 | uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */␊ |
142 | uint32_t __reserved3[2];␊ |
143 | ␊ |
144 | } boot_args_Legacy;␊ |
145 | ␊ |
146 | typedef struct boot_args_107 {␊ |
147 | uint16_t Revision;␉/* Revision of boot_args structure */␊ |
148 | uint16_t Version;␉/* Version of boot_args structure */␊ |
149 | ␊ |
150 | uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */␊ |
151 | uint8_t debugMode; /* Bit field with behavior changes */␊ |
152 | uint8_t __reserved1[2];␊ |
153 | ␊ |
154 | char CommandLine[BOOT_LINE_LENGTH];␉/* Passed in command line */␊ |
155 | ␊ |
156 | uint32_t MemoryMap; /* Physical address of memory map */␊ |
157 | uint32_t MemoryMapSize;␊ |
158 | uint32_t MemoryMapDescriptorSize;␊ |
159 | uint32_t MemoryMapDescriptorVersion;␊ |
160 | ␊ |
161 | Boot_Video␉Video;␉␉/* Video Information */␊ |
162 | ␊ |
163 | uint32_t deviceTreeP;␉ /* Physical address of flattened device tree */␊ |
164 | uint32_t deviceTreeLength; /* Length of flattened tree */␊ |
165 | ␊ |
166 | uint32_t kaddr; /* Physical address of beginning of kernel text */␊ |
167 | uint32_t ksize; /* Size of combined kernel text+data+efi */␊ |
168 | ␊ |
169 | uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */␊ |
170 | uint32_t efiRuntimeServicesPageCount;␊ |
171 | uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */␊ |
172 | ␊ |
173 | uint32_t efiSystemTable; /* physical address of system table in runtime area */␊ |
174 | uint32_t __reserved2;␊ |
175 | ␊ |
176 | uint32_t performanceDataStart; /* physical address of log */␊ |
177 | uint32_t performanceDataSize;␊ |
178 | ␊ |
179 | uint32_t keyStoreDataStart; /* physical address of key store data */␊ |
180 | uint32_t keyStoreDataSize;␊ |
181 | uint64_t␉bootMemStart;␊ |
182 | uint64_t␉bootMemSize;␊ |
183 | uint64_t PhysicalMemorySize;␊ |
184 | uint64_t FSBFrequency;␊ |
185 | ␉uint32_t __reserved4[734];␊ |
186 | ␊ |
187 | } boot_args_107;␊ |
188 | ␊ |
189 | typedef struct boot_args_108 {␊ |
190 | uint16_t Revision;␉/* Revision of boot_args structure */␊ |
191 | uint16_t Version;␉/* Version of boot_args structure */␊ |
192 | ␉␊ |
193 | uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */␊ |
194 | uint8_t debugMode; /* Bit field with behavior changes */␊ |
195 | uint8_t __reserved1[2];␊ |
196 | ␉␊ |
197 | char CommandLine[BOOT_LINE_LENGTH];␉/* Passed in command line */␊ |
198 | ␉␊ |
199 | uint32_t MemoryMap; /* Physical address of memory map */␊ |
200 | uint32_t MemoryMapSize;␊ |
201 | uint32_t MemoryMapDescriptorSize;␊ |
202 | uint32_t MemoryMapDescriptorVersion;␊ |
203 | ␉␊ |
204 | Boot_Video␉Video;␉␉/* Video Information */␊ |
205 | ␉␊ |
206 | uint32_t deviceTreeP;␉ /* Physical address of flattened device tree */␊ |
207 | uint32_t deviceTreeLength; /* Length of flattened tree */␊ |
208 | ␉␊ |
209 | uint32_t kaddr; /* Physical address of beginning of kernel text */␊ |
210 | uint32_t ksize; /* Size of combined kernel text+data+efi */␊ |
211 | ␉␊ |
212 | uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */␊ |
213 | uint32_t efiRuntimeServicesPageCount;␊ |
214 | uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */␊ |
215 | ␉␊ |
216 | uint32_t efiSystemTable; /* physical address of system table in runtime area */␊ |
217 | uint32_t __reserved2;␊ |
218 | ␉␊ |
219 | uint32_t performanceDataStart; /* physical address of log */␊ |
220 | uint32_t performanceDataSize;␊ |
221 | ␉␊ |
222 | uint32_t keyStoreDataStart; /* physical address of key store data */␊ |
223 | uint32_t keyStoreDataSize;␊ |
224 | uint64_t␉bootMemStart;␊ |
225 | uint64_t␉bootMemSize;␊ |
226 | uint64_t PhysicalMemorySize;␊ |
227 | uint64_t FSBFrequency;␊ |
228 | ␉␊ |
229 | ␉uint32_t __reserved3[4];␉␊ |
230 | ␉uint32_t __reserved4[730];␊ |
231 | ␉␊ |
232 | } boot_args_108;␊ |
233 | ␊ |
234 | typedef struct boot_args_header {␊ |
235 | ␉uint16_t Revision;␉/* Revision of boot_args structure */␊ |
236 | uint16_t Version;␉/* Version of boot_args structure */␊ |
237 | } boot_args_header;␊ |
238 | ␊ |
239 | typedef struct boot_args_10x {␊ |
240 | boot_args_header Header;␉␊ |
241 | ␊ |
242 | ␉Boot_Video␉Video;␉␉/* Video Information */␊ |
243 | ␊ |
244 | uint32_t MemoryMap; /* Physical address of memory map */␊ |
245 | uint32_t MemoryMapSize;␊ |
246 | uint32_t MemoryMapDescriptorSize;␊ |
247 | uint32_t MemoryMapDescriptorVersion;␊ |
248 | ␉␊ |
249 | ␉uint8_t debugMode; /* Bit field with behavior changes */␊ |
250 | ␉uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */␊ |
251 | ␉␊ |
252 | ␉␊ |
253 | uint32_t deviceTreeP;␉ /* Physical address of flattened device tree */␊ |
254 | uint32_t deviceTreeLength; /* Length of flattened tree */␊ |
255 | ␉␊ |
256 | ␉char CommandLine[BOOT_LINE_LENGTH];␉/* Passed in command line */␊ |
257 | ␊ |
258 | ␊ |
259 | ␉uint32_t keyStoreDataStart; /* physical address of key store data */␊ |
260 | uint32_t keyStoreDataSize;␊ |
261 | uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */␊ |
262 | uint32_t efiRuntimeServicesPageCount;␊ |
263 | uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */␊ |
264 | ␉␊ |
265 | uint32_t efiSystemTable; /* physical address of system table in runtime area */␊ |
266 | ␉uint64_t FSBFrequency;␊ |
267 | ␊ |
268 | uint32_t performanceDataSize;␊ |
269 | ␉uint32_t performanceDataStart; /* physical address of log */␊ |
270 | ␊ |
271 | uint32_t kaddr; /* Physical address of beginning of kernel text */␊ |
272 | uint32_t ksize; /* Size of combined kernel text+data+efi */␊ |
273 | ␊ |
274 | ␉uint64_t␉bootMemStart;␊ |
275 | uint64_t␉bootMemSize;␊ |
276 | uint64_t PhysicalMemorySize;␊ |
277 | ␉␊ |
278 | ␉uint32_t __reserved[4];␉␊ |
279 | } boot_args_10x;␊ |
280 | ␊ |
281 | typedef struct boot_args_10x boot_args_common;␊ |
282 | ␊ |
283 | extern char assert_boot_args_107_size_is_4096[sizeof(boot_args_107) == 4096 ? 1 : -1];␊ |
284 | extern char assert_boot_args_108_size_is_4096[sizeof(boot_args_108) == 4096 ? 1 : -1];␊ |
285 | ␊ |
286 | #endif /* _PEXPERT_I386_BOOT_H */␊ |
287 | |