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 | //Azi: this is acting now as a mini libsaio.h :P␊ |
29 | //#include "libsaio.h"␊ |
30 | //#include "bios.h"␊ |
31 | //#include "bootargs.h" - included on saio_types.h␊ |
32 | #include "libsa.h"␊ |
33 | #include "saio_types.h"␊ |
34 | #include "saio_internal.h"␊ |
35 | #include "device_tree.h"␊ |
36 | ␊ |
37 | /*!␊ |
38 | Kernel boot args global also used by booter for its own data.␊ |
39 | */␊ |
40 | extern boot_args *bootArgs;␊ |
41 | extern boot_args_pre_lion *bootArgsPreLion;␊ |
42 | extern Node *gMemoryMapNode;␊ |
43 | //extern Node *efiPlatformNode; //Azi: test␊ |
44 | ␊ |
45 | #define VGA_TEXT_MODE 0␊ |
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 | /*␊ |
55 | * Max size for config data array, in bytes.␊ |
56 | */␊ |
57 | #define IO_CONFIG_DATA_SIZE␉␉163840␊ |
58 | ␊ |
59 | #define kMemoryMapCountMax 40␊ |
60 | ␊ |
61 | /*␊ |
62 | * PCI bus information.␊ |
63 | */␊ |
64 | typedef struct _PCI_bus_info_t {␊ |
65 | union {␊ |
66 | struct {␊ |
67 | unsigned char configMethod1 :1;␊ |
68 | unsigned char configMethod2 :1;␊ |
69 | unsigned char :2;␊ |
70 | unsigned char specialCycle1 :1;␊ |
71 | unsigned char specialCycle2 :1;␊ |
72 | } s;␊ |
73 | unsigned char d;␊ |
74 | } u_bus;␊ |
75 | unsigned char maxBusNum;␊ |
76 | unsigned char majorVersion;␊ |
77 | unsigned char minorVersion;␊ |
78 | unsigned char BIOSPresent;␊ |
79 | } PCI_bus_info_t;␊ |
80 | ␊ |
81 | typedef struct {␊ |
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 | 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 | int convmem; // conventional memory␊ |
116 | int extmem; // extended memory␊ |
117 | #if 0␊ |
118 | int numBootDrivers; // number of drivers loaded␊ |
119 | #endif␊ |
120 | char bootFile[128]; // kernel file name␊ |
121 | ␊ |
122 | unsigned long memoryMapCount;␊ |
123 | MemoryRange memoryMap[kMemoryMapCountMax];␊ |
124 | ␊ |
125 | PCI_bus_info_t pciInfo;␊ |
126 | ␊ |
127 | #if 0␊ |
128 | driver_config_t driverConfig[NDRIVERS];␊ |
129 | #endif␊ |
130 | char * configEnd; // pointer to end of config files␊ |
131 | char config[CONFIG_SIZE];␊ |
132 | ␊ |
133 | config_file_t bootConfig;␉␉ // boot.plist␊ |
134 | config_file_t overrideConfig; // additional boot.plist which can override bootConfig keys␊ |
135 | config_file_t themeConfig;␉␉␉␉ // theme.plist␊ |
136 | config_file_t smbiosConfig;␉␉␉␉ // smbios.plist␊ |
137 | config_file_t helperConfig; // boot helper partition's boot.plist␊ |
138 | config_file_t ramdiskConfig; // RAMDisk.plist␊ |
139 | } PrivateBootInfo_t;␊ |
140 | ␊ |
141 | extern PrivateBootInfo_t *bootInfo; ␊ |
142 | ␊ |
143 | #endif /* __BOOTSTRUCT_H */␊ |
144 | |