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 | /* Struct describing an image passed in by the booter */␊ |
95 | struct boot_icon_element {␊ |
96 | unsigned int width;␊ |
97 | unsigned int height;␊ |
98 | int y_offset_from_center;␊ |
99 | unsigned int data_size;␊ |
100 | unsigned int __reserved1[4];␊ |
101 | unsigned char data[0];␊ |
102 | };␊ |
103 | typedef struct boot_icon_element boot_icon_element;␊ |
104 | ␊ |
105 | /* Values for v_display */␊ |
106 | ␊ |
107 | #define GRAPHICS_MODE 1␊ |
108 | #define FB_TEXT_MODE 2␊ |
109 | ␊ |
110 | /* Boot argument structure - passed into Mach kernel at boot time.␊ |
111 | * "Revision" can be incremented for compatible changes␊ |
112 | */␊ |
113 | #define kBootArgsRevision␉␉0␊ |
114 | #define kBootArgsVersion␉␉2␊ |
115 | ␊ |
116 | /* Snapshot constants of previous revisions that are supported */␊ |
117 | #define kBootArgsVersion1␉␉1␊ |
118 | #define kBootArgsVersion2␉␉2␊ |
119 | #define kBootArgsRevision2_0␉␉0␊ |
120 | ␊ |
121 | #define kBootArgsEfiMode32 32␊ |
122 | #define kBootArgsEfiMode64 64␊ |
123 | ␊ |
124 | typedef struct boot_args_Legacy {␊ |
125 | uint16_t Revision;␉/* Revision of boot_args structure */␊ |
126 | uint16_t Version;␉/* Version of boot_args structure */␊ |
127 | ␊ |
128 | char CommandLine[BOOT_LINE_LENGTH];␉/* Passed in command line */␊ |
129 | ␊ |
130 | uint32_t MemoryMap; /* Physical address of memory map */␊ |
131 | uint32_t MemoryMapSize;␊ |
132 | uint32_t MemoryMapDescriptorSize;␊ |
133 | uint32_t MemoryMapDescriptorVersion;␊ |
134 | ␊ |
135 | Boot_Video␉Video;␉␉/* Video Information */␊ |
136 | ␊ |
137 | uint32_t deviceTreeP;␉ /* Physical address of flattened device tree */␊ |
138 | uint32_t deviceTreeLength; /* Length of flattened tree */␊ |
139 | ␊ |
140 | uint32_t kaddr; /* Physical address of beginning of kernel text */␊ |
141 | uint32_t ksize; /* Size of combined kernel text+data+efi */␊ |
142 | ␊ |
143 | uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */␊ |
144 | uint32_t efiRuntimeServicesPageCount;␊ |
145 | uint32_t efiSystemTable; /* physical address of system table in runtime area */␊ |
146 | ␊ |
147 | uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */␊ |
148 | uint8_t __reserved1[3];␊ |
149 | uint32_t __reserved2[1];␊ |
150 | uint32_t performanceDataStart; /* physical address of log */␊ |
151 | uint32_t performanceDataSize;␊ |
152 | uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */␊ |
153 | uint32_t __reserved3[2];␊ |
154 | ␊ |
155 | } boot_args_Legacy;␊ |
156 | ␊ |
157 | typedef struct boot_args_107 {␊ |
158 | uint16_t Revision;␉/* Revision of boot_args structure */␊ |
159 | uint16_t Version;␉/* Version of boot_args structure */␊ |
160 | ␉␊ |
161 | uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */␊ |
162 | uint8_t debugMode; /* Bit field with behavior changes */␊ |
163 | uint8_t __reserved1[2];␊ |
164 | ␉␊ |
165 | char CommandLine[BOOT_LINE_LENGTH];␉/* Passed in command line */␊ |
166 | ␉␊ |
167 | uint32_t MemoryMap; /* Physical address of memory map */␊ |
168 | uint32_t MemoryMapSize;␊ |
169 | uint32_t MemoryMapDescriptorSize;␊ |
170 | uint32_t MemoryMapDescriptorVersion;␊ |
171 | ␉␊ |
172 | Boot_Video␉Video;␉␉/* Video Information */␊ |
173 | ␉␊ |
174 | uint32_t deviceTreeP;␉ /* Physical address of flattened device tree */␊ |
175 | uint32_t deviceTreeLength; /* Length of flattened tree */␊ |
176 | ␉␊ |
177 | uint32_t kaddr; /* Physical address of beginning of kernel text */␊ |
178 | uint32_t ksize; /* Size of combined kernel text+data+efi */␊ |
179 | ␉␊ |
180 | uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */␊ |
181 | uint32_t efiRuntimeServicesPageCount;␊ |
182 | uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */␊ |
183 | ␉␊ |
184 | uint32_t efiSystemTable; /* physical address of system table in runtime area */␊ |
185 | uint32_t __reserved2;␊ |
186 | ␉␊ |
187 | uint32_t performanceDataStart; /* physical address of log */␊ |
188 | uint32_t performanceDataSize;␊ |
189 | ␉␊ |
190 | uint32_t keyStoreDataStart; /* physical address of key store data */␊ |
191 | uint32_t keyStoreDataSize;␊ |
192 | uint64_t␉bootMemStart;␊ |
193 | uint64_t␉bootMemSize;␊ |
194 | uint64_t PhysicalMemorySize;␊ |
195 | uint64_t FSBFrequency;␊ |
196 | uint64_t pciConfigSpaceBaseAddress;␊ |
197 | uint32_t pciConfigSpaceStartBusNumber;␊ |
198 | uint32_t pciConfigSpaceEndBusNumber;␊ |
199 | uint32_t __reserved4[730];␊ |
200 | ␉␊ |
201 | } boot_args_107;␊ |
202 | ␊ |
203 | typedef struct boot_args_108 {␊ |
204 | uint16_t Revision;␉/* Revision of boot_args structure */␊ |
205 | uint16_t Version;␉/* Version of boot_args structure */␊ |
206 | ␉␊ |
207 | uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */␊ |
208 | uint8_t debugMode; /* Bit field with behavior changes */␊ |
209 | uint8_t __reserved1[2];␊ |
210 | ␉␊ |
211 | char CommandLine[BOOT_LINE_LENGTH];␉/* Passed in command line */␊ |
212 | ␉␊ |
213 | uint32_t MemoryMap; /* Physical address of memory map */␊ |
214 | uint32_t MemoryMapSize;␊ |
215 | uint32_t MemoryMapDescriptorSize;␊ |
216 | uint32_t MemoryMapDescriptorVersion;␊ |
217 | ␉␊ |
218 | Boot_Video␉Video;␉␉/* Video Information */␊ |
219 | ␉␊ |
220 | uint32_t deviceTreeP;␉ /* Physical address of flattened device tree */␊ |
221 | uint32_t deviceTreeLength; /* Length of flattened tree */␊ |
222 | ␉␊ |
223 | uint32_t kaddr; /* Physical address of beginning of kernel text */␊ |
224 | uint32_t ksize; /* Size of combined kernel text+data+efi */␊ |
225 | ␉␊ |
226 | uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */␊ |
227 | uint32_t efiRuntimeServicesPageCount;␊ |
228 | uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */␊ |
229 | ␉␊ |
230 | uint32_t efiSystemTable; /* physical address of system table in runtime area */␊ |
231 | uint32_t __reserved2;␊ |
232 | ␉␊ |
233 | uint32_t performanceDataStart; /* physical address of log */␊ |
234 | uint32_t performanceDataSize;␊ |
235 | ␉␊ |
236 | uint32_t keyStoreDataStart; /* physical address of key store data */␊ |
237 | uint32_t keyStoreDataSize;␊ |
238 | uint64_t␉bootMemStart;␊ |
239 | uint64_t␉bootMemSize;␊ |
240 | uint64_t PhysicalMemorySize;␊ |
241 | uint64_t FSBFrequency;␊ |
242 | ␉uint64_t pciConfigSpaceBaseAddress;␊ |
243 | uint32_t pciConfigSpaceStartBusNumber;␊ |
244 | uint32_t pciConfigSpaceEndBusNumber;␊ |
245 | uint32_t __reserved4[730];␊ |
246 | ␉␊ |
247 | } boot_args_108; // for now apparently the same package for 10.8 and 10.7␊ |
248 | ␊ |
249 | typedef struct boot_args_header {␊ |
250 | ␉uint16_t Revision;␉/* Revision of boot_args structure */␊ |
251 | uint16_t Version;␉/* Version of boot_args structure */␊ |
252 | } boot_args_header;␊ |
253 | ␊ |
254 | typedef struct boot_args_10x {␊ |
255 | boot_args_header Header;␉␊ |
256 | ␊ |
257 | ␉Boot_Video␉Video;␉␉/* Video Information */␊ |
258 | ␊ |
259 | uint32_t MemoryMap; /* Physical address of memory map */␊ |
260 | uint32_t MemoryMapSize;␊ |
261 | uint32_t MemoryMapDescriptorSize;␊ |
262 | uint32_t MemoryMapDescriptorVersion;␊ |
263 | ␉␊ |
264 | ␉uint8_t debugMode; /* Bit field with behavior changes */␊ |
265 | ␉uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */␊ |
266 | ␉␊ |
267 | ␉␊ |
268 | uint32_t deviceTreeP;␉ /* Physical address of flattened device tree */␊ |
269 | uint32_t deviceTreeLength; /* Length of flattened tree */␊ |
270 | ␉␊ |
271 | ␉char CommandLine[BOOT_LINE_LENGTH];␉/* Passed in command line */␊ |
272 | ␊ |
273 | ␊ |
274 | ␉uint32_t keyStoreDataStart; /* physical address of key store data */␊ |
275 | uint32_t keyStoreDataSize;␊ |
276 | uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */␊ |
277 | uint32_t efiRuntimeServicesPageCount;␊ |
278 | uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */␊ |
279 | ␉␊ |
280 | uint32_t efiSystemTable; /* physical address of system table in runtime area */␊ |
281 | ␉uint64_t FSBFrequency;␊ |
282 | ␊ |
283 | uint32_t performanceDataSize;␊ |
284 | ␉uint32_t performanceDataStart; /* physical address of log */␊ |
285 | ␊ |
286 | uint32_t kaddr; /* Physical address of beginning of kernel text */␊ |
287 | uint32_t ksize; /* Size of combined kernel text+data+efi */␊ |
288 | ␊ |
289 | ␉uint64_t␉bootMemStart;␊ |
290 | uint64_t␉bootMemSize;␊ |
291 | uint64_t PhysicalMemorySize;␊ |
292 | ␉␊ |
293 | ␉uint64_t pciConfigSpaceBaseAddress;␊ |
294 | uint32_t pciConfigSpaceStartBusNumber;␊ |
295 | uint32_t pciConfigSpaceEndBusNumber;␊ |
296 | } boot_args_10x;␊ |
297 | ␊ |
298 | typedef struct boot_args_10x boot_args_common;␊ |
299 | ␊ |
300 | extern char assert_boot_args_107_size_is_4096[sizeof(boot_args_107) == 4096 ? 1 : -1];␊ |
301 | extern char assert_boot_args_108_size_is_4096[sizeof(boot_args_108) == 4096 ? 1 : -1];␊ |
302 | ␊ |
303 | #endif /* _PEXPERT_I386_BOOT_H */␊ |
304 | |