]> git.saurik.com Git - apple/xnu.git/blame - pexpert/pexpert/i386/boot.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / pexpert / pexpert / i386 / boot.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
0a7de745 5 *
2d21ac55
A
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.
0a7de745 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
0a7de745 17 *
2d21ac55
A
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
8f6c56a5
A
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
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.
0a7de745 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b
A
27 */
28#ifndef _PEXPERT_I386_BOOT_H
29#define _PEXPERT_I386_BOOT_H
30
0c530ab8 31#include <stdint.h>
21362eb3 32
6601e61a 33/*
0c530ab8 34 * What the booter leaves behind for the kernel.
6601e61a 35 */
6601e61a 36
0b4e3aa0
A
37/*
38 * Types of boot driver that may be loaded by the booter.
1c79356b 39 */
0b4e3aa0 40enum {
0a7de745
A
41 kBootDriverTypeInvalid = 0,
42 kBootDriverTypeKEXT = 1,
43 kBootDriverTypeMKEXT = 2
0b4e3aa0 44};
1c79356b 45
55e303ae 46enum {
0a7de745
A
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
55e303ae
A
62};
63
64/*
65 * Memory range descriptor.
66 */
0c530ab8 67typedef struct EfiMemoryRange {
0a7de745
A
68 uint32_t Type;
69 uint32_t Pad;
70 uint64_t PhysicalStart;
71 uint64_t VirtualStart;
72 uint64_t NumberOfPages;
73 uint64_t Attribute;
0c530ab8
A
74} EfiMemoryRange;
75
76#define BOOT_LINE_LENGTH 1024
77#define BOOT_STRING_LEN BOOT_LINE_LENGTH
1c79356b
A
78
79/*
0a7de745 80 * Video information..
1c79356b
A
81 */
82
39037602 83struct Boot_VideoV1 {
0a7de745
A
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 */
b0d623f7 90};
0a7de745 91typedef struct Boot_VideoV1 Boot_VideoV1;
1c79356b 92
39037602 93struct Boot_Video {
0a7de745
A
94 uint32_t v_display; /* Display Code (if Applicable */
95 uint32_t v_rowBytes; /* Number of bytes per pixel row */
96 uint32_t v_width; /* Width */
97 uint32_t v_height; /* Height */
98 uint32_t v_depth; /* Pixel Depth */
99 uint8_t v_rotate; /* Rotation */
100 uint8_t v_resv_byte[3]; /* Reserved */
101 uint32_t v_resv[6]; /* Reserved */
102 uint64_t v_baseAddr; /* Base address of video memory */
39037602 103};
0a7de745 104typedef struct Boot_Video Boot_Video;
1c79356b 105
b0d623f7
A
106/* Values for v_display */
107
108#define GRAPHICS_MODE 1
109#define FB_TEXT_MODE 2
1c79356b 110
7ddcb079
A
111/* Struct describing an image passed in by the booter */
112struct boot_icon_element {
0a7de745
A
113 unsigned int width;
114 unsigned int height;
115 int y_offset_from_center;
116 unsigned int data_size;
117 unsigned int __reserved1[4];
118 unsigned char data[0];
7ddcb079
A
119};
120typedef struct boot_icon_element boot_icon_element;
121
1c79356b 122/* Boot argument structure - passed into Mach kernel at boot time.
b0d623f7 123 * "Revision" can be incremented for compatible changes
1c79356b 124 */
0a7de745 125#define kBootArgsRevision 0
f427ee49
A
126#define kBootArgsRevision0 kBootArgsRevision
127#define kBootArgsRevision1 1 /* added KC_hdrs_addr */
0a7de745 128#define kBootArgsVersion 2
0c530ab8 129
b0d623f7 130/* Snapshot constants of previous revisions that are supported */
0a7de745
A
131#define kBootArgsVersion1 1
132#define kBootArgsVersion2 2
133#define kBootArgsRevision2_0 0
b0d623f7 134
0c530ab8
A
135#define kBootArgsEfiMode32 32
136#define kBootArgsEfiMode64 64
1c79356b 137
316670eb 138/* Bitfields for boot_args->flags */
0a7de745
A
139#define kBootArgsFlagRebootOnPanic (1 << 0)
140#define kBootArgsFlagHiDPI (1 << 1)
141#define kBootArgsFlagBlack (1 << 2)
142#define kBootArgsFlagCSRActiveConfig (1 << 3)
143#define kBootArgsFlagCSRConfigMode (1 << 4)
144#define kBootArgsFlagCSRBoot (1 << 5)
145#define kBootArgsFlagBlackBg (1 << 6)
146#define kBootArgsFlagLoginUI (1 << 7)
147#define kBootArgsFlagInstallUI (1 << 8)
f427ee49 148#define kBootArgsFlagRecoveryBoot (1 << 10)
13f56ec4 149
1c79356b 150typedef struct boot_args {
0a7de745
A
151 uint16_t Revision; /* Revision of boot_args structure */
152 uint16_t Version; /* Version of boot_args structure */
153
154 uint8_t efiMode;/* 32 = 32-bit, 64 = 64-bit */
155 uint8_t debugMode;/* Bit field with behavior changes */
156 uint16_t flags;
157
158 char CommandLine[BOOT_LINE_LENGTH];/* Passed in command line */
159
160 uint32_t MemoryMap;/* Physical address of memory map */
161 uint32_t MemoryMapSize;
162 uint32_t MemoryMapDescriptorSize;
163 uint32_t MemoryMapDescriptorVersion;
164
165 Boot_VideoV1 VideoV1; /* Video Information */
166
167 uint32_t deviceTreeP; /* Physical address of flattened device tree */
168 uint32_t deviceTreeLength;/* Length of flattened tree */
169
170 uint32_t kaddr; /* Physical address of beginning of kernel text */
171 uint32_t ksize; /* Size of combined kernel text+data+efi */
172
173 uint32_t efiRuntimeServicesPageStart;/* physical address of defragmented runtime pages */
174 uint32_t efiRuntimeServicesPageCount;
175 uint64_t efiRuntimeServicesVirtualPageStart;/* virtual address of defragmented runtime pages */
176
177 uint32_t efiSystemTable;/* physical address of system table in runtime area */
178 uint32_t kslide;
179
180 uint32_t performanceDataStart;/* physical address of log */
181 uint32_t performanceDataSize;
182
183 uint32_t keyStoreDataStart;/* physical address of key store data */
184 uint32_t keyStoreDataSize;
185 uint64_t bootMemStart;
186 uint64_t bootMemSize;
187 uint64_t PhysicalMemorySize;
188 uint64_t FSBFrequency;
189 uint64_t pciConfigSpaceBaseAddress;
190 uint32_t pciConfigSpaceStartBusNumber;
191 uint32_t pciConfigSpaceEndBusNumber;
192 uint32_t csrActiveConfig;
193 uint32_t csrCapabilities;
194 uint32_t boot_SMC_plimit;
195 uint16_t bootProgressMeterStart;
196 uint16_t bootProgressMeterEnd;
197 Boot_Video Video; /* Video Information */
198
199 uint32_t apfsDataStart;/* Physical address of apfs volume key structure */
200 uint32_t apfsDataSize;
201
f427ee49
A
202 /* Version 2, Revision 1 */
203 uint64_t KC_hdrs_vaddr;
204
c3c9b80d 205 uint64_t arvRootHashStart; /* Physical address of system volume root hash file */
f427ee49
A
206 uint64_t arvRootHashSize;
207
c3c9b80d 208 uint64_t arvManifestStart; /* Physical address of system volume manifest file */
f427ee49
A
209 uint64_t arvManifestSize;
210
c3c9b80d
A
211 uint64_t bsARVRootHashStart;/* Physical address of base system root hash file */
212 uint64_t bsARVRootHashSize;
213
214 uint64_t bsARVManifestStart;/* Physical address of base system manifest file */
215 uint64_t bsARVManifestSize;
216
f427ee49 217 /* Reserved */
c3c9b80d 218 uint32_t __reserved4[692];
b0d623f7 219} boot_args;
55e303ae 220
6d2010ae
A
221extern char assert_boot_args_size_is_4096[sizeof(boot_args) == 4096 ? 1 : -1];
222
1c79356b 223#endif /* _PEXPERT_I386_BOOT_H */