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 | * Maximum number of boot drivers that can be loaded.␊ |
47 | */␊ |
48 | #define NDRIVERS 500␊ |
49 | ␊ |
50 | #define CONFIG_SIZE (40 * 4096)␊ |
51 | ␊ |
52 | #define kMemoryMapCountMax 40␊ |
53 | ␊ |
54 | /*␊ |
55 | * PCI bus information.␊ |
56 | */␊ |
57 | typedef struct _PCI_bus_info_t␊ |
58 | {␊ |
59 | ␉union␊ |
60 | ␉{␊ |
61 | ␉␉struct␊ |
62 | ␉␉{␊ |
63 | ␉␉␉unsigned char configMethod1 :1;␊ |
64 | ␉␉␉unsigned char configMethod2 :1;␊ |
65 | ␉␉␉unsigned char :2;␊ |
66 | ␉␉␉unsigned char specialCycle1 :1;␊ |
67 | ␉␉␉unsigned char specialCycle2 :1;␊ |
68 | ␉␉} s;␊ |
69 | ␉␉unsigned char d;␊ |
70 | ␉} u_bus;␊ |
71 | ␊ |
72 | ␉unsigned char maxBusNum;␊ |
73 | ␉unsigned char majorVersion;␊ |
74 | ␉unsigned char minorVersion;␊ |
75 | ␉unsigned char BIOSPresent;␊ |
76 | } PCI_bus_info_t;␊ |
77 | ␊ |
78 | ␊ |
79 | typedef struct␊ |
80 | {␊ |
81 | ␉unsigned long address; // address where driver was loaded␊ |
82 | ␉unsigned long size; // number of bytes␊ |
83 | ␉unsigned long type; // driver type␊ |
84 | } driver_config_t;␊ |
85 | ␊ |
86 | /*␊ |
87 | * INT15, E820h - Query System Address Map.␊ |
88 | *␊ |
89 | * Documented in ACPI Specification Rev 2.0,␊ |
90 | * Chapter 15 (System Address Map Interfaces).␊ |
91 | */␊ |
92 | ␊ |
93 | /*␊ |
94 | * ACPI defined memory range types.␊ |
95 | */␊ |
96 | enum␊ |
97 | {␊ |
98 | ␉kMemoryRangeUsable = 1, // RAM usable by the OS.␊ |
99 | ␉kMemoryRangeReserved = 2, // Reserved. (Do not use)␊ |
100 | ␉kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.␊ |
101 | ␉kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use)␊ |
102 | ␊ |
103 | ␉/* Undefined types should be treated as kMemoryRangeReserved */␊ |
104 | };␊ |
105 | ␊ |
106 | /*!␊ |
107 | PrivateBootInfo has fields used by the booter that used to be part of␊ |
108 | KernelBootArgs_t *bootArgs. When the switch was made to EFI the structure␊ |
109 | completely changed to boot_args *bootArgs. This (new to boot-132) structure␊ |
110 | contains the fields the kernel no longer cares about but the booter still␊ |
111 | uses internally. Some fields (e.g. the video information) remain interesting␊ |
112 | to the kernel and are thus located in bootArgs although with different field names.␊ |
113 | */␊ |
114 | typedef struct PrivateBootInfo␊ |
115 | {␊ |
116 | ␉int convmem; // conventional memory␊ |
117 | ␉int extmem; // extended memory␊ |
118 | #if 0␊ |
119 | ␉int numBootDrivers; // number of drivers loaded␊ |
120 | #endif␊ |
121 | ␉char bootFile[128]; // kernel file name␊ |
122 | ␊ |
123 | ␉unsigned long memoryMapCount;␊ |
124 | ␉MemoryRange memoryMap[kMemoryMapCountMax];␊ |
125 | ␊ |
126 | ␉PCI_bus_info_t pciInfo;␊ |
127 | ␊ |
128 | #if 0␊ |
129 | ␉driver_config_t driverConfig[NDRIVERS];␊ |
130 | #endif␊ |
131 | ␉char * configEnd;␉␉// pointer to end of config files␊ |
132 | ␉char config[CONFIG_SIZE];␊ |
133 | ␊ |
134 | ␉config_file_t bootConfig;␉␉// com.apple.Boot.plist␊ |
135 | ␉config_file_t chameleonConfig;␉// org.chameleon.Boot.plist which can override bootConfig keys␊ |
136 | ␉config_file_t themeConfig;␉␉// theme.plist␊ |
137 | ␉config_file_t smbiosConfig;␉␉// smbios.plist␊ |
138 | ␉config_file_t helperConfig;␉␉// boot helper partition's boot.plist␊ |
139 | ␉config_file_t ramdiskConfig;␉␉// RAMDisk.plist␊ |
140 | ␊ |
141 | ␉bool memDetect;␊ |
142 | } PrivateBootInfo_t;␊ |
143 | ␊ |
144 | extern PrivateBootInfo_t *bootInfo;␊ |
145 | ␊ |
146 | #endif /* __BOOTSTRUCT_H */␊ |
147 | |