Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Trunk/i386/libsaio/bootargs.h

1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 *
5 * This file contains Original Code and/or Modifications of Original Code
6 * as defined in and that are subject to the Apple Public Source License
7 * Version 2.0 (the 'License'). You may not use this file except in
8 * compliance with the License. The rights granted to you under the License
9 * may not be used to create, or enable the creation or redistribution of,
10 * unlawful or unlicensed copies of an Apple operating system, or to
11 * circumvent, violate, or enable the circumvention or violation of, any
12 * terms of an Apple operating system software license agreement.
13 *
14 * Please obtain a copy of the License at
15 * http://www.opensource.apple.com/apsl/ and read it before using this file.
16 *
17 * The Original Code and all software distributed under the License are
18 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
19 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
20 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
22 * Please see the License for the specific language governing rights and
23 * limitations under the License.
24 *
25 */
26#ifndef _PEXPERT_I386_BOOT_H
27#define _PEXPERT_I386_BOOT_H
28
29#include <stdint.h>
30
31/*
32 * What the booter leaves behind for the kernel.
33 */
34
35/*
36 * Types of boot driver that may be loaded by the booter.
37 */
38enum {
39 kBootDriverTypeInvalid = 0,
40 kBootDriverTypeKEXT = 1,
41 kBootDriverTypeMKEXT = 2
42};
43
44enum {
45 kEfiReservedMemoryType= 0,
46 kEfiLoaderCode= 1,
47 kEfiLoaderData= 2,
48 kEfiBootServicesCode= 3,
49 kEfiBootServicesData= 4,
50 kEfiRuntimeServicesCode= 5,
51 kEfiRuntimeServicesData= 6,
52 kEfiConventionalMemory= 7,
53 kEfiUnusableMemory= 8,
54 kEfiACPIReclaimMemory= 9,
55 kEfiACPIMemoryNVS= 10,
56 kEfiMemoryMappedIO= 11,
57 kEfiMemoryMappedIOPortSpace = 12,
58 kEfiPalCode= 13,
59 kEfiMaxMemoryType= 14
60};
61
62/*
63 * Memory range descriptor.
64 */
65typedef struct EfiMemoryRange {
66 uint32_t Type;
67 uint32_t Pad;
68 uint64_t PhysicalStart;
69 uint64_t VirtualStart;
70 uint64_t NumberOfPages;
71 uint64_t Attribute;
72} EfiMemoryRange;
73
74#define BOOT_LINE_LENGTH 1024
75#define BOOT_STRING_LEN BOOT_LINE_LENGTH
76
77/*
78 * Video information..
79 */
80
81struct Boot_Video
82{
83uint32_tv_baseAddr;/* Base address of video memory */
84uint32_tv_display;/* Display Code (if Applicable */
85uint32_tv_rowBytes;/* Number of bytes per pixel row */
86uint32_tv_width;/* Width */
87uint32_tv_height;/* Height */
88uint32_tv_depth;/* Pixel Depth */
89};
90
91typedef struct Boot_VideoBoot_Video;
92
93/* Values for v_display */
94
95#define GRAPHICS_MODE1
96#define FB_TEXT_MODE2
97
98/* Boot argument structure - passed into Mach kernel at boot time.
99 * "Revision" can be incremented for compatible changes
100 */
101// Lion
102#define kBootArgsRevision0
103#define kBootArgsVersion2
104
105// Snow Leopard and older
106#define kBootArgsPreLionRevision6
107#define kBootArgsPreLionVersion1
108
109/* Snapshot constants of previous revisions that are supported */
110
111#define kBootArgsEfiMode3232
112#define kBootArgsEfiMode6464
113
114typedef struct boot_args_pre_lion
115{
116 uint16_t Revision;/* Revision of boot_args structure */
117 uint16_t Version;/* Version of boot_args structure */
118
119 char CommandLine[BOOT_LINE_LENGTH];/* Passed in command line */
120
121 uint32_t MemoryMap; /* Physical address of memory map */
122 uint32_t MemoryMapSize;
123 uint32_t MemoryMapDescriptorSize;
124 uint32_t MemoryMapDescriptorVersion;
125
126 Boot_VideoVideo;/* Video Information */
127
128 uint32_t deviceTreeP; /* Physical address of flattened device tree */
129 uint32_t deviceTreeLength; /* Length of flattened tree */
130
131 uint32_t kaddr; /* Physical address of beginning of kernel text */
132 uint32_t ksize; /* Size of combined kernel text+data+efi */
133
134 uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */
135 uint32_t efiRuntimeServicesPageCount;
136
137 uint32_t efiSystemTable; /* physical address of system table in runtime area */
138
139 uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
140 uint8_t __reserved1[3];
141 uint32_t __reserved2[1];
142 uint32_t performanceDataStart; /* physical address of log */
143 uint32_t performanceDataSize;
144 uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */
145 uint32_t __reserved3[2];
146
147} boot_args_pre_lion;
148
149/* Bitfields for boot_args->flags */
150#define kBootArgsFlagRebootOnPanic (1 << 0)
151#define kBootArgsFlagHiDPI (1 << 1)
152
153typedef struct boot_args
154{
155 uint16_t Revision;/* Revision of boot_args structure */
156 uint16_t Version;/* Version of boot_args structure */
157
158 uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
159 uint8_t debugMode; /* Bit field with behavior changes */
160 uint16_t flags;
161
162 char CommandLine[BOOT_LINE_LENGTH];/* Passed in command line */
163
164 uint32_t MemoryMap; /* Physical address of memory map */
165 uint32_t MemoryMapSize;
166 uint32_t MemoryMapDescriptorSize;
167 uint32_t MemoryMapDescriptorVersion;
168
169 Boot_VideoVideo;/* Video Information */
170
171 uint32_t deviceTreeP; /* Physical address of flattened device tree */
172 uint32_t deviceTreeLength; /* Length of flattened tree */
173
174 uint32_t kaddr; /* Physical address of beginning of kernel text */
175 uint32_t ksize; /* Size of combined kernel text+data+efi */
176
177 uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */
178 uint32_t efiRuntimeServicesPageCount;
179 uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */
180
181 uint32_t efiSystemTable; /* physical address of system table in runtime area */
182 uint8_t __reserved1[2];
183 uint32_t __reserved2;
184 uint32_t performanceDataStart; /* physical address of log */
185 uint32_t performanceDataSize;
186
187 uint32_t keyStoreDataStart; /* physical address of key store data */
188 uint32_t keyStoreDataSize;
189 uint64_tbootMemStart;
190 uint64_tbootMemSize;
191 uint64_t PhysicalMemorySize;
192 uint64_t FSBFrequency;
193 uint32_t __reserved4[734];
194
195} boot_args;
196
197extern char gMacOSVersion[8];
198
199#endif /* _PEXPERT_I386_BOOT_H */
200

Archive Download this file

Revision: 2060