Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Chazileon/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//Azi:include
29#include <pexpert/i386/boot.h>
30
31#include "bios.h"
32#include "device_tree.h"
33#include "saio_types.h"
34
35/*!
36 Kernel boot args global also used by booter for its own data.
37 */
38extern boot_args *bootArgs;
39extern Node *gMemoryMapNode;
40
41#define VGA_TEXT_MODE 0
42
43/*
44 * Maximum number of boot drivers that can be loaded.
45 */
46#define NDRIVERS 500
47
48#define CONFIG_SIZE (40 * 4096)
49
50/*
51 * Max size for config data array, in bytes.
52 */
53#define IO_CONFIG_DATA_SIZE163840
54
55#define kMemoryMapCountMax 40
56
57/*
58 * PCI bus information.
59 */
60typedef struct _PCI_bus_info_t {
61 union {
62 struct {
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 unsigned char maxBusNum;
72 unsigned char majorVersion;
73 unsigned char minorVersion;
74 unsigned char BIOSPresent;
75} PCI_bus_info_t;
76
77typedef struct {
78 unsigned long address; // address where driver was loaded
79 unsigned long size; // number of bytes
80 unsigned long type; // driver type
81} driver_config_t;
82
83/*
84 * INT15, E820h - Query System Address Map.
85 *
86 * Documented in ACPI Specification Rev 2.0,
87 * Chapter 15 (System Address Map Interfaces).
88 */
89
90/*
91 * ACPI defined memory range types.
92 */
93enum {
94 kMemoryRangeUsable = 1, // RAM usable by the OS.
95 kMemoryRangeReserved = 2, // Reserved. (Do not use)
96 kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.
97 kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use)
98
99 /* Undefined types should be treated as kMemoryRangeReserved */
100};
101
102/*!
103 PrivateBootInfo has fields used by the booter that used to be part of
104 KernelBootArgs_t *bootArgs. When the switch was made to EFI the structure
105 completely changed to boot_args *bootArgs. This (new to boot-132) structure
106 contains the fields the kernel no longer cares about but the booter still
107 uses internally. Some fields (e.g. the video information) remain interesting
108 to the kernel and are thus located in bootArgs although with different field names.
109 */
110typedef struct PrivateBootInfo
111{
112intconvmem;// conventional memory
113intextmem;// extended memory
114#if 0
115intnumBootDrivers;// number of drivers loaded
116#endif
117charbootFile[128];// kernel file name
118
119unsigned longmemoryMapCount;
120MemoryRangememoryMap[kMemoryMapCountMax];
121
122PCI_bus_info_tpciInfo;
123
124#if 0
125 driver_config_t driverConfig[NDRIVERS];
126#endif
127char *configEnd;// pointer to end of config files
128charconfig[CONFIG_SIZE];
129
130config_file_tbootConfig;// boot.plist
131config_file_toverrideConfig;// additional boot.plist which can override bootConfig keys
132 config_file_tthemeConfig;// theme.plist
133config_file_tsmbiosConfig;// smbios.plist
134config_file_thelperConfig;// boot helper partition's boot.plist
135config_file_tramdiskConfig;// RAMDisk.plist
136} PrivateBootInfo_t;
137
138extern PrivateBootInfo_t *bootInfo;
139
140#endif /* __BOOTSTRUCT_H */
141

Archive Download this file

Revision: 399