Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 1031