]> git.saurik.com Git - apple/xnu.git/blob - pexpert/pexpert/i386/boot.h
73254f6e474845d8eb16db246603f01af96ec445
[apple/xnu.git] / pexpert / pexpert / i386 / boot.h
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 /*
47 * Video information.
48 */
49 struct boot_video {
50 uint32_t v_baseAddr; // Base address of video memory
51 uint32_t v_display; // Display Code
52 uint32_t v_rowBytes; // Number of bytes per pixel row
53 uint32_t v_width; // Width
54 uint32_t v_height; // Height
55 uint32_t v_depth; // Pixel Depth
56 };
57
58 typedef struct boot_video boot_video;
59
60 /* Values for v_display */
61
62 #define VGA_TEXT_MODE 0
63 #define GRAPHICS_MODE 1
64 #define FB_TEXT_MODE 2
65
66
67 enum {
68 kEfiReservedMemoryType = 0,
69 kEfiLoaderCode = 1,
70 kEfiLoaderData = 2,
71 kEfiBootServicesCode = 3,
72 kEfiBootServicesData = 4,
73 kEfiRuntimeServicesCode = 5,
74 kEfiRuntimeServicesData = 6,
75 kEfiConventionalMemory = 7,
76 kEfiUnusableMemory = 8,
77 kEfiACPIReclaimMemory = 9,
78 kEfiACPIMemoryNVS = 10,
79 kEfiMemoryMappedIO = 11,
80 kEfiMemoryMappedIOPortSpace = 12,
81 kEfiPalCode = 13,
82 kEfiMaxMemoryType = 14
83 };
84
85 /*
86 * Memory range descriptor.
87 */
88 typedef struct EfiMemoryRange {
89 uint32_t Type;
90 uint32_t pad;
91 uint64_t PhysicalStart;
92 uint64_t VirtualStart;
93 uint64_t NumberOfPages;
94 uint64_t Attribute;
95 } EfiMemoryRange;
96
97 #define BOOT_LINE_LENGTH 1024
98 #define BOOT_STRING_LEN BOOT_LINE_LENGTH
99
100 /*
101 * Video information..
102 */
103
104 struct Boot_Video {
105 uint32_t v_baseAddr; /* Base address of video memory */
106 uint32_t v_display; /* Display Code (if Applicable */
107 uint32_t v_rowBytes; /* Number of bytes per pixel row */
108 uint32_t v_width; /* Width */
109 uint32_t v_height; /* Height */
110 uint32_t v_depth; /* Pixel Depth */
111 } __attribute__((aligned(4)));
112
113 typedef struct Boot_Video Boot_Video;
114
115
116 /* Boot argument structure - passed into Mach kernel at boot time.
117 */
118 #define kBootArgsRevision 4
119 #define kBootArgsVersion 1
120
121 #define kBootArgsEfiMode32 32
122 #define kBootArgsEfiMode64 64
123
124 typedef struct boot_args {
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;
131 uint32_t MemoryMapSize;
132 uint32_t MemoryMapDescriptorSize;
133 uint32_t MemoryMapDescriptorVersion;
134
135 Boot_Video Video; /* Video Information */
136
137 uint32_t deviceTreeP; /* Base of flattened device tree */
138 uint32_t deviceTreeLength;/* Length of flattened tree */
139
140 uint32_t kaddr;
141 uint32_t ksize;
142
143 uint32_t efiRuntimeServicesPageStart;
144 uint32_t efiRuntimeServicesPageCount;
145 uint32_t efiSystemTable;
146
147 uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
148 uint8_t __reserved1[3];
149 uint32_t __reserved2[7];
150
151 } __attribute__((aligned(4))) boot_args;
152
153 #endif /* _PEXPERT_I386_BOOT_H */
154