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