Root/
Source at commit 1381 created 12 years 10 months ago. By azimutz, Import Package from trunk (r1379). | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * Portions Copyright (c) 1999-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 | /* Useful types. */␊ |
25 | ␊ |
26 | #ifndef __LIBSAIO_SAIO_TYPES_H␊ |
27 | #define __LIBSAIO_SAIO_TYPES_H␊ |
28 | ␊ |
29 | #include <sys/reboot.h>␊ |
30 | #include <sys/types.h>␊ |
31 | #include <sys/param.h>␊ |
32 | #include "bios.h"␊ |
33 | ␊ |
34 | #if DEBUG␊ |
35 | #define DEBUG_DISK(x) printf x␊ |
36 | #else␊ |
37 | #define DEBUG_DISK(x)␊ |
38 | #endif␊ |
39 | ␊ |
40 | typedef unsigned long entry_t;␊ |
41 | ␊ |
42 | typedef struct {␊ |
43 | ␉unsigned int sectors:8;␊ |
44 | ␉unsigned int heads:8;␊ |
45 | ␉unsigned int cylinders:16;␊ |
46 | } compact_diskinfo_t;␊ |
47 | ␊ |
48 | struct driveParameters {␊ |
49 | ␉int cylinders;␊ |
50 | ␉int sectors;␊ |
51 | ␉int heads;␊ |
52 | ␉int totalDrives;␊ |
53 | };␊ |
54 | ␊ |
55 | struct iob {␊ |
56 | ␉unsigned int i_flgs;␉␉␉/* see F_* below */␊ |
57 | ␉unsigned int i_offset;␉␉/* seek byte offset in file */␊ |
58 | ␉int␉␉␉ i_filesize;␉␉/* size of file */␊ |
59 | ␉char *␉␉ i_buf;␉␉␉/* file load address */␊ |
60 | };␊ |
61 | ␊ |
62 | #define BPS␉␉ 512␉␉␉␉/* sector size of the device */␊ |
63 | #define F_READ␉ 0x1␉␉␉␉/* file opened for reading */␊ |
64 | #define F_WRITE␉ 0x2␉␉␉␉/* file opened for writing */␊ |
65 | #define F_ALLOC␉ 0x4␉␉␉␉/* buffer allocated */␊ |
66 | #define F_FILE␉ 0x8␉␉␉␉/* file instead of device */␊ |
67 | #define F_NBSF␉ 0x10␉␉␉␉/* no bad sector forwarding */␊ |
68 | #define F_SSI␉ 0x40␉␉␉␉/* set skip sector inhibit */␊ |
69 | #define F_MEM␉ 0x80␉␉␉␉/* memory instead of file or device */␊ |
70 | ␊ |
71 | #define BVSTRLEN 32␊ |
72 | ␊ |
73 | enum {␊ |
74 | ␉kBVFlagPrimary␉␉␉= 0x01,␊ |
75 | ␉kBVFlagNativeBoot␉␉= 0x02,␊ |
76 | ␉kBVFlagForeignBoot␉␉= 0x04,␊ |
77 | ␉kBVFlagBootable␉␉␉= 0x08,␊ |
78 | ␉kBVFlagEFISystem␉␉= 0x10,␊ |
79 | ␉kBVFlagBooter␉␉␉= 0x20,␊ |
80 | ␉kBVFlagSystemVolume␉␉= 0x40␊ |
81 | };␊ |
82 | ␊ |
83 | enum {␊ |
84 | ␉kBIOSDevTypeFloppy␉␉= 0x00,␊ |
85 | ␉kBIOSDevTypeHardDrive␉= 0x80,␊ |
86 | ␉kBIOSDevTypeNetwork␉␉= 0xE0,␊ |
87 | ␉kBIOSDevUnitMask␉␉= 0x0F,␊ |
88 | ␉kBIOSDevTypeMask␉␉= 0xF0,␊ |
89 | ␉kBIOSDevMask␉␉␉= 0xFF␊ |
90 | };␊ |
91 | ␊ |
92 | enum {␊ |
93 | ␉kPartitionTypeHFS␉␉= 0xAF,␊ |
94 | ␉kPartitionTypeHPFS␉␉= 0x07,␊ |
95 | ␉kPartitionTypeFAT16␉␉= 0x06,␊ |
96 | ␉kPartitionTypeFAT32␉␉= 0x0c,␊ |
97 | ␉kPartitionTypeEXT3␉␉= 0x83␊ |
98 | };␊ |
99 | ␊ |
100 | //#define BIOS_DEV_TYPE(d)␉((d) & kBIOSDevTypeMask)␊ |
101 | #define BIOS_DEV_UNIT(bvr)␉((bvr)->biosdev - (bvr)->type)␊ |
102 | ␊ |
103 | /*␊ |
104 | * KernBootStruct device types.␊ |
105 | */␊ |
106 | enum {␊ |
107 | ␉DEV_SD = 0,␊ |
108 | ␉DEV_HD = 1,␊ |
109 | ␉DEV_FD = 2,␊ |
110 | ␉DEV_EN = 3␊ |
111 | };␊ |
112 | ␊ |
113 | /*␊ |
114 | * min/max Macros.␊ |
115 | * counting and rounding Macros.␊ |
116 | *␊ |
117 | * Azi: defined on <sys/param.h>,␊ |
118 | *␉␉i386/include/IOKit/IOLib.h (min/max), and others...␊ |
119 | *␊ |
120 | #ifndef MIN␊ |
121 | #define MIN(a,b) ( ((a) < (b)) ? (a) : (b) )␊ |
122 | #endif␊ |
123 | #ifndef MAX␊ |
124 | #define MAX(a,b) ( ((a) > (b)) ? (a) : (b) )␊ |
125 | #endif␊ |
126 | ␊ |
127 | #define round2(x, m)␉(((x) + (m / 2)) & ~(m - 1))␊ |
128 | #define roundup2(x, m)␉(((x) + m - 1) & ~(m - 1))*/␊ |
129 | ␊ |
130 | enum {␊ |
131 | ␉kNetworkDeviceType = kBIOSDevTypeNetwork,␊ |
132 | ␉kBlockDeviceType = kBIOSDevTypeHardDrive␊ |
133 | }; //gBootFileType_t;␊ |
134 | ␊ |
135 | enum {␊ |
136 | ␉kCursorTypeHidden␉ = 0x0100,␊ |
137 | ␉kCursorTypeUnderline = 0x0607␊ |
138 | };␊ |
139 | ␊ |
140 | #endif /* !__LIBSAIO_SAIO_TYPES_H */␊ |
141 |