Chameleon

Chameleon Svn Source Tree

Root/branches/slice/old749m/i386/libsaio/bootstruct.h

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

Archive Download this file

Revision: 1174