1 | /*␊ |
2 | * Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * Portions Copyright (c) 2002-2003 Apple Computer, Inc. All Rights␊ |
7 | * Reserved. This file contains Original Code and/or Modifications of␊ |
8 | * Original Code as defined in and that are subject to the Apple Public␊ |
9 | * Source License Version 2.0 (the "License"). You may not use this file␊ |
10 | * except in compliance with the License. Please obtain a copy of the␊ |
11 | * License at http://www.apple.com/publicsource and read it before using␊ |
12 | * this file.␊ |
13 | * ␊ |
14 | * The Original Code and all software distributed under the License are␊ |
15 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
16 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
17 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
18 | * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the␊ |
19 | * License for the specific language governing rights and limitations␊ |
20 | * under the License.␊ |
21 | * ␊ |
22 | * @APPLE_LICENSE_HEADER_END@␊ |
23 | */␊ |
24 | ␊ |
25 | #ifndef __BOOTSTRUCT_H␊ |
26 | #define __BOOTSTRUCT_H␊ |
27 | ␊ |
28 | #include "bootargs.h"␊ |
29 | #include "saio_types.h"␊ |
30 | #include "bios.h"␊ |
31 | #include "device_tree.h"␊ |
32 | ␊ |
33 | /*␊ |
34 | * Kernel boot args global also used by booter for its own data.␊ |
35 | */␊ |
36 | extern boot_args *bootArgs;␊ |
37 | extern boot_args_pre_lion *bootArgsPreLion;␊ |
38 | extern Node *gMemoryMapNode;␊ |
39 | ␊ |
40 | #define VGA_TEXT_MODE 0␊ |
41 | //defined in /usr/../boot.h␊ |
42 | ␊ |
43 | //#define GRAPHICS_MODE 1␊ |
44 | //#define FB_TEXT_MODE 2␊ |
45 | ␊ |
46 | ␊ |
47 | /*␊ |
48 | * Maximum number of boot drivers that can be loaded.␊ |
49 | */␊ |
50 | #define NDRIVERS 500␊ |
51 | ␊ |
52 | #define CONFIG_SIZE (40 * 4096)␊ |
53 | ␊ |
54 | #define kMemoryMapCountMax 1000␊ |
55 | ␊ |
56 | /*␊ |
57 | * PCI bus information.␊ |
58 | */␊ |
59 | typedef struct _PCI_bus_info_t␊ |
60 | {␊ |
61 | ␉union␊ |
62 | ␉{␊ |
63 | ␉␉struct␊ |
64 | ␉␉{␊ |
65 | ␉␉␉unsigned char configMethod1 :1;␊ |
66 | ␉␉␉unsigned char configMethod2 :1;␊ |
67 | ␉␉␉unsigned char :2;␊ |
68 | ␉␉␉unsigned char specialCycle1 :1;␊ |
69 | ␉␉␉unsigned char specialCycle2 :1;␊ |
70 | ␉␉} s;␊ |
71 | ␉␉unsigned char d;␊ |
72 | ␉} u_bus;␊ |
73 | ␊ |
74 | ␉unsigned char maxBusNum;␊ |
75 | ␉unsigned char majorVersion;␊ |
76 | ␉unsigned char minorVersion;␊ |
77 | ␉unsigned char BIOSPresent;␊ |
78 | } PCI_bus_info_t;␊ |
79 | ␊ |
80 | ␊ |
81 | typedef struct␊ |
82 | {␊ |
83 | ␉unsigned long address; // address where driver was loaded␊ |
84 | ␉unsigned long size; // number of bytes␊ |
85 | ␉unsigned long type; // driver type␊ |
86 | } driver_config_t;␊ |
87 | ␊ |
88 | /*␊ |
89 | * INT15, E820h - Query System Address Map.␊ |
90 | *␊ |
91 | * Documented in ACPI Specification Rev 2.0,␊ |
92 | * Chapter 15 (System Address Map Interfaces).␊ |
93 | */␊ |
94 | ␊ |
95 | /*␊ |
96 | * ACPI defined memory range types.␊ |
97 | */␊ |
98 | enum␊ |
99 | {␊ |
100 | ␉kMemoryRangeUsable = 1, // RAM usable by the OS.␊ |
101 | ␉kMemoryRangeReserved = 2, // Reserved. (Do not use)␊ |
102 | ␉kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.␊ |
103 | ␉kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use)␊ |
104 | ␊ |
105 | ␉/* Undefined types should be treated as kMemoryRangeReserved */␊ |
106 | };␊ |
107 | ␊ |
108 | /*!␊ |
109 | PrivateBootInfo has fields used by the booter that used to be part of␊ |
110 | KernelBootArgs_t *bootArgs. When the switch was made to EFI the structure␊ |
111 | completely changed to boot_args *bootArgs. This (new to boot-132) structure␊ |
112 | contains the fields the kernel no longer cares about but the booter still␊ |
113 | uses internally. Some fields (e.g. the video information) remain interesting␊ |
114 | to the kernel and are thus located in bootArgs although with different field names.␊ |
115 | */␊ |
116 | typedef struct PrivateBootInfo␊ |
117 | {␊ |
118 | ␉int convmem; // conventional memory␊ |
119 | ␉int extmem; // extended memory␊ |
120 | #if 0␊ |
121 | ␉int numBootDrivers; // number of drivers loaded␊ |
122 | #endif␊ |
123 | ␉char bootFile[128]; // kernel file name␊ |
124 | ␊ |
125 | ␉unsigned long memoryMapCount;␊ |
126 | ␉MemoryRange memoryMap[kMemoryMapCountMax];␊ |
127 | ␊ |
128 | ␉PCI_bus_info_t pciInfo;␊ |
129 | ␊ |
130 | #if 0␊ |
131 | ␉driver_config_t driverConfig[NDRIVERS];␊ |
132 | #endif␊ |
133 | ␉char * configEnd;␉␉// pointer to end of config files␊ |
134 | ␉char config[CONFIG_SIZE];␊ |
135 | ␊ |
136 | ␉config_file_t bootConfig;␉␉// com.apple.Boot.plist␊ |
137 | ␉config_file_t chameleonConfig;␉// org.chameleon.Boot.plist which can override bootConfig keys␊ |
138 | ␉config_file_t themeConfig;␉␉// theme.plist␊ |
139 | ␉config_file_t smbiosConfig;␉␉// smbios.plist␊ |
140 | ␉config_file_t helperConfig;␉␉// boot helper partition's boot.plist␊ |
141 | ␉config_file_t ramdiskConfig;␉␉// RAMDisk.plist␊ |
142 | ␊ |
143 | ␉bool memDetect;␊ |
144 | } PrivateBootInfo_t;␊ |
145 | ␊ |
146 | extern PrivateBootInfo_t *bootInfo;␊ |
147 | ␊ |
148 | #endif /* __BOOTSTRUCT_H */␊ |
149 | |