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