]> git.saurik.com Git - apple/xnu.git/blob - pexpert/pexpert/i386/boot.h
22169e861718ed962d3dda0c3390531f8d9e543a
[apple/xnu.git] / pexpert / pexpert / i386 / boot.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 #ifndef _PEXPERT_I386_BOOT_H
23 #define _PEXPERT_I386_BOOT_H
24
25 #include <stdint.h>
26
27 /*
28 * What the booter leaves behind for the kernel.
29 */
30
31 /*
32 * Types of boot driver that may be loaded by the booter.
33 */
34 enum {
35 kBootDriverTypeInvalid = 0,
36 kBootDriverTypeKEXT = 1,
37 kBootDriverTypeMKEXT = 2
38 };
39
40 /*
41 * Video information.
42 */
43 struct boot_video {
44 uint32_t v_baseAddr; // Base address of video memory
45 uint32_t v_display; // Display Code
46 uint32_t v_rowBytes; // Number of bytes per pixel row
47 uint32_t v_width; // Width
48 uint32_t v_height; // Height
49 uint32_t v_depth; // Pixel Depth
50 };
51
52 typedef struct boot_video boot_video;
53
54 /* Values for v_display */
55
56 #define VGA_TEXT_MODE 0
57 #define GRAPHICS_MODE 1
58 #define FB_TEXT_MODE 2
59
60
61 enum {
62 kEfiReservedMemoryType = 0,
63 kEfiLoaderCode = 1,
64 kEfiLoaderData = 2,
65 kEfiBootServicesCode = 3,
66 kEfiBootServicesData = 4,
67 kEfiRuntimeServicesCode = 5,
68 kEfiRuntimeServicesData = 6,
69 kEfiConventionalMemory = 7,
70 kEfiUnusableMemory = 8,
71 kEfiACPIReclaimMemory = 9,
72 kEfiACPIMemoryNVS = 10,
73 kEfiMemoryMappedIO = 11,
74 kEfiMemoryMappedIOPortSpace = 12,
75 kEfiPalCode = 13,
76 kEfiMaxMemoryType = 14
77 };
78
79 /*
80 * Memory range descriptor.
81 */
82 typedef struct EfiMemoryRange {
83 uint32_t Type;
84 uint32_t pad;
85 uint64_t PhysicalStart;
86 uint64_t VirtualStart;
87 uint64_t NumberOfPages;
88 uint64_t Attribute;
89 } EfiMemoryRange;
90
91 #define BOOT_LINE_LENGTH 1024
92 #define BOOT_STRING_LEN BOOT_LINE_LENGTH
93
94 /*
95 * Video information..
96 */
97
98 struct Boot_Video {
99 uint32_t v_baseAddr; /* Base address of video memory */
100 uint32_t v_display; /* Display Code (if Applicable */
101 uint32_t v_rowBytes; /* Number of bytes per pixel row */
102 uint32_t v_width; /* Width */
103 uint32_t v_height; /* Height */
104 uint32_t v_depth; /* Pixel Depth */
105 } __attribute__((aligned(4)));
106
107 typedef struct Boot_Video Boot_Video;
108
109
110 /* Boot argument structure - passed into Mach kernel at boot time.
111 */
112 #define kBootArgsRevision 4
113 #define kBootArgsVersion 1
114
115 #define kBootArgsEfiMode32 32
116 #define kBootArgsEfiMode64 64
117
118 typedef struct boot_args {
119 uint16_t Revision; /* Revision of boot_args structure */
120 uint16_t Version; /* Version of boot_args structure */
121
122 char CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */
123
124 uint32_t MemoryMap;
125 uint32_t MemoryMapSize;
126 uint32_t MemoryMapDescriptorSize;
127 uint32_t MemoryMapDescriptorVersion;
128
129 Boot_Video Video; /* Video Information */
130
131 uint32_t deviceTreeP; /* Base of flattened device tree */
132 uint32_t deviceTreeLength;/* Length of flattened tree */
133
134 uint32_t kaddr;
135 uint32_t ksize;
136
137 uint32_t efiRuntimeServicesPageStart;
138 uint32_t efiRuntimeServicesPageCount;
139 uint32_t efiSystemTable;
140
141 uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
142 uint8_t __reserved1[3];
143 uint32_t __reserved2[7];
144
145 } __attribute__((aligned(4))) boot_args;
146
147 #endif /* _PEXPERT_I386_BOOT_H */
148