2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
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.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
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.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
28 #ifndef _PEXPERT_I386_BOOT_H
29 #define _PEXPERT_I386_BOOT_H
34 * What the booter leaves behind for the kernel.
38 * Types of boot driver that may be loaded by the booter.
41 kBootDriverTypeInvalid
= 0,
42 kBootDriverTypeKEXT
= 1,
43 kBootDriverTypeMKEXT
= 2
47 kEfiReservedMemoryType
= 0,
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,
61 kEfiMaxMemoryType
= 14
65 * Memory range descriptor.
67 typedef struct EfiMemoryRange
{
70 uint64_t PhysicalStart
;
71 uint64_t VirtualStart
;
72 uint64_t NumberOfPages
;
76 #define BOOT_LINE_LENGTH 1024
77 #define BOOT_STRING_LEN BOOT_LINE_LENGTH
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 */
92 typedef struct Boot_Video Boot_Video
;
94 /* Values for v_display */
96 #define GRAPHICS_MODE 1
97 #define FB_TEXT_MODE 2
99 /* Struct describing an image passed in by the booter */
100 struct boot_icon_element
{
103 int y_offset_from_center
;
104 unsigned int data_size
;
105 unsigned int __reserved1
[4];
106 unsigned char data
[0];
108 typedef struct boot_icon_element boot_icon_element
;
110 /* Boot argument structure - passed into Mach kernel at boot time.
111 * "Revision" can be incremented for compatible changes
113 #define kBootArgsRevision 0
114 #define kBootArgsVersion 2
116 /* Snapshot constants of previous revisions that are supported */
117 #define kBootArgsVersion1 1
118 #define kBootArgsVersion2 2
119 #define kBootArgsRevision2_0 0
121 #define kBootArgsEfiMode32 32
122 #define kBootArgsEfiMode64 64
124 /* Bitfields for boot_args->flags */
125 #define kBootArgsFlagRebootOnPanic (1 << 0)
126 #define kBootArgsFlagHiDPI (1 << 1)
127 #define kBootArgsFlagBlack (1 << 2)
128 #define kBootArgsFlagCSRActiveConfig (1 << 3)
129 #define kBootArgsFlagCSRPendingConfig (1 << 4)
130 #define kBootArgsFlagCSRBoot (1 << 5)
131 #define kBootArgsFlagBlackBg (1 << 6)
132 #define kBootArgsFlagLoginUI (1 << 7)
134 typedef struct boot_args
{
135 uint16_t Revision
; /* Revision of boot_args structure */
136 uint16_t Version
; /* Version of boot_args structure */
138 uint8_t efiMode
; /* 32 = 32-bit, 64 = 64-bit */
139 uint8_t debugMode
; /* Bit field with behavior changes */
142 char CommandLine
[BOOT_LINE_LENGTH
]; /* Passed in command line */
144 uint32_t MemoryMap
; /* Physical address of memory map */
145 uint32_t MemoryMapSize
;
146 uint32_t MemoryMapDescriptorSize
;
147 uint32_t MemoryMapDescriptorVersion
;
149 Boot_Video Video
; /* Video Information */
151 uint32_t deviceTreeP
; /* Physical address of flattened device tree */
152 uint32_t deviceTreeLength
; /* Length of flattened tree */
154 uint32_t kaddr
; /* Physical address of beginning of kernel text */
155 uint32_t ksize
; /* Size of combined kernel text+data+efi */
157 uint32_t efiRuntimeServicesPageStart
; /* physical address of defragmented runtime pages */
158 uint32_t efiRuntimeServicesPageCount
;
159 uint64_t efiRuntimeServicesVirtualPageStart
; /* virtual address of defragmented runtime pages */
161 uint32_t efiSystemTable
; /* physical address of system table in runtime area */
164 uint32_t performanceDataStart
; /* physical address of log */
165 uint32_t performanceDataSize
;
167 uint32_t keyStoreDataStart
; /* physical address of key store data */
168 uint32_t keyStoreDataSize
;
169 uint64_t bootMemStart
;
170 uint64_t bootMemSize
;
171 uint64_t PhysicalMemorySize
;
172 uint64_t FSBFrequency
;
173 uint64_t pciConfigSpaceBaseAddress
;
174 uint32_t pciConfigSpaceStartBusNumber
;
175 uint32_t pciConfigSpaceEndBusNumber
;
176 uint32_t csrActiveConfig
;
177 uint32_t csrPendingConfig
;
178 uint32_t __reserved4
[728];
182 extern char assert_boot_args_size_is_4096
[sizeof(boot_args
) == 4096 ? 1 : -1];
184 #endif /* _PEXPERT_I386_BOOT_H */