]> git.saurik.com Git - apple/xnu.git/blame - pexpert/pexpert/i386/boot.h
xnu-792.25.20.tar.gz
[apple/xnu.git] / pexpert / pexpert / i386 / boot.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
6601e61a 4 * @APPLE_LICENSE_HEADER_START@
1c79356b 5 *
6601e61a
A
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
8f6c56a5 11 *
6601e61a
A
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
8f6c56a5
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
6601e61a
A
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
8f6c56a5 19 *
6601e61a 20 * @APPLE_LICENSE_HEADER_END@
1c79356b
A
21 */
22#ifndef _PEXPERT_I386_BOOT_H
23#define _PEXPERT_I386_BOOT_H
24
0c530ab8 25#include <stdint.h>
21362eb3 26
6601e61a 27/*
0c530ab8 28 * What the booter leaves behind for the kernel.
6601e61a 29 */
6601e61a 30
0b4e3aa0
A
31/*
32 * Types of boot driver that may be loaded by the booter.
1c79356b 33 */
0b4e3aa0
A
34enum {
35 kBootDriverTypeInvalid = 0,
36 kBootDriverTypeKEXT = 1,
37 kBootDriverTypeMKEXT = 2
38};
1c79356b 39
1c79356b 40/*
0b4e3aa0 41 * Video information.
1c79356b 42 */
1c79356b 43struct boot_video {
0c530ab8
A
44 uint32_t v_baseAddr; // Base address of video memory
45 uint32_t v_display; // Display Code
46 uint32_t v_rowBytes; // Number of bytes per pixel row
47 uint32_t v_width; // Width
48 uint32_t v_height; // Height
49 uint32_t v_depth; // Pixel Depth
1c79356b
A
50};
51
0b4e3aa0
A
52typedef struct boot_video boot_video;
53
0c530ab8
A
54/* Values for v_display */
55
56#define VGA_TEXT_MODE 0
0b4e3aa0 57#define GRAPHICS_MODE 1
0c530ab8 58#define FB_TEXT_MODE 2
8f6c56a5 59
8ad349bb 60
55e303ae 61enum {
0c530ab8
A
62 kEfiReservedMemoryType = 0,
63 kEfiLoaderCode = 1,
64 kEfiLoaderData = 2,
65 kEfiBootServicesCode = 3,
66 kEfiBootServicesData = 4,
67 kEfiRuntimeServicesCode = 5,
68 kEfiRuntimeServicesData = 6,
69 kEfiConventionalMemory = 7,
70 kEfiUnusableMemory = 8,
71 kEfiACPIReclaimMemory = 9,
72 kEfiACPIMemoryNVS = 10,
73 kEfiMemoryMappedIO = 11,
74 kEfiMemoryMappedIOPortSpace = 12,
75 kEfiPalCode = 13,
76 kEfiMaxMemoryType = 14
55e303ae
A
77};
78
79/*
80 * Memory range descriptor.
81 */
0c530ab8
A
82typedef struct EfiMemoryRange {
83 uint32_t Type;
84 uint32_t pad;
85 uint64_t PhysicalStart;
86 uint64_t VirtualStart;
87 uint64_t NumberOfPages;
88 uint64_t Attribute;
89} EfiMemoryRange;
90
91#define BOOT_LINE_LENGTH 1024
92#define BOOT_STRING_LEN BOOT_LINE_LENGTH
1c79356b
A
93
94/*
95 * Video information..
96 */
97
98struct Boot_Video {
0c530ab8
A
99 uint32_t v_baseAddr; /* Base address of video memory */
100 uint32_t v_display; /* Display Code (if Applicable */
101 uint32_t v_rowBytes; /* Number of bytes per pixel row */
102 uint32_t v_width; /* Width */
103 uint32_t v_height; /* Height */
104 uint32_t v_depth; /* Pixel Depth */
105} __attribute__((aligned(4)));
1c79356b
A
106
107typedef struct Boot_Video Boot_Video;
108
1c79356b
A
109
110/* Boot argument structure - passed into Mach kernel at boot time.
111 */
0c530ab8 112#define kBootArgsRevision 4
1c79356b 113#define kBootArgsVersion 1
0c530ab8
A
114
115#define kBootArgsEfiMode32 32
116#define kBootArgsEfiMode64 64
1c79356b
A
117
118typedef struct boot_args {
0c530ab8
A
119 uint16_t Revision; /* Revision of boot_args structure */
120 uint16_t Version; /* Version of boot_args structure */
121
122 char CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */
123
124 uint32_t MemoryMap;
125 uint32_t MemoryMapSize;
126 uint32_t MemoryMapDescriptorSize;
127 uint32_t MemoryMapDescriptorVersion;
1c79356b 128
0c530ab8 129 Boot_Video Video; /* Video Information */
1c79356b 130
0c530ab8
A
131 uint32_t deviceTreeP; /* Base of flattened device tree */
132 uint32_t deviceTreeLength;/* Length of flattened tree */
55e303ae 133
0c530ab8
A
134 uint32_t kaddr;
135 uint32_t ksize;
55e303ae 136
0c530ab8
A
137 uint32_t efiRuntimeServicesPageStart;
138 uint32_t efiRuntimeServicesPageCount;
139 uint32_t efiSystemTable;
55e303ae 140
0c530ab8
A
141 uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */
142 uint8_t __reserved1[3];
143 uint32_t __reserved2[7];
55e303ae 144
0c530ab8 145} __attribute__((aligned(4))) boot_args;
55e303ae 146
1c79356b
A
147#endif /* _PEXPERT_I386_BOOT_H */
148