]> git.saurik.com Git - apple/boot.git/blob - i386/libsaio/bootstruct.h
boot-132.tar.gz
[apple/boot.git] / 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
30 #include "bios.h"
31 #include "device_tree.h"
32
33 extern boot_args *bootArgs;
34 extern Node *gMemoryMapNode;
35
36 /*
37 * Maximum number of boot drivers that can be loaded.
38 */
39 #define NDRIVERS 500
40
41 #define CONFIG_SIZE (12 * 4096)
42
43 #define kMemoryMapCountMax 40
44
45 /*
46 * PCI bus information.
47 */
48 typedef struct _PCI_bus_info_t {
49 union {
50 struct {
51 unsigned char configMethod1 :1;
52 unsigned char configMethod2 :1;
53 unsigned char :2;
54 unsigned char specialCycle1 :1;
55 unsigned char specialCycle2 :1;
56 } s;
57 unsigned char d;
58 } u_bus;
59 unsigned char maxBusNum;
60 unsigned char majorVersion;
61 unsigned char minorVersion;
62 unsigned char BIOSPresent;
63 } PCI_bus_info_t;
64
65 typedef struct {
66 unsigned long address; // address where driver was loaded
67 unsigned long size; // number of bytes
68 unsigned long type; // driver type
69 } driver_config_t;
70
71 /*
72 * INT15, E820h - Query System Address Map.
73 *
74 * Documented in ACPI Specification Rev 2.0,
75 * Chapter 15 (System Address Map Interfaces).
76 */
77
78 /*
79 * ACPI defined memory range types.
80 */
81 enum {
82 kMemoryRangeUsable = 1, // RAM usable by the OS.
83 kMemoryRangeReserved = 2, // Reserved. (Do not use)
84 kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.
85 kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use)
86
87 /* Undefined types should be treated as kMemoryRangeReserved */
88 };
89
90 typedef struct PrivateBootInfo {
91 int kernDev; // device kernel was fetched from
92
93 int convmem; // conventional memory
94 int extmem; // extended memory
95 int numBootDrivers; // number of drivers loaded
96 char bootFile[128]; // kernel file name
97
98 unsigned long memoryMapCount;
99 MemoryRange memoryMap[kMemoryMapCountMax];
100
101 PCI_bus_info_t pciInfo;
102
103 driver_config_t driverConfig[NDRIVERS];
104 char * configEnd; // pointer to end of config files
105 char config[CONFIG_SIZE];
106 } PrivateBootInfo_t;
107
108 extern PrivateBootInfo_t *bootInfo;
109
110 #endif /* __BOOTSTRUCT_H */