Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/arch/i386/libsaio/saio_types.h

Source at commit 1407 created 12 years 10 months ago.
By meklort, Revert drivers.c so that kexts are only loaded when OSBundleRequired is set and that value is not safe mode.
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
40typedef unsigned long entry_t;
41
42typedef struct {
43unsigned int sectors:8;
44unsigned int heads:8;
45unsigned int cylinders:16;
46} compact_diskinfo_t;
47
48struct driveParameters {
49int cylinders;
50int sectors;
51int heads;
52int totalDrives;
53};
54
55struct iob {
56unsigned int i_flgs;/* see F_* below */
57unsigned int i_offset;/* seek byte offset in file */
58int i_filesize;/* size of file */
59char * 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
73enum {
74kBVFlagPrimary= 0x01,
75kBVFlagNativeBoot= 0x02,
76kBVFlagForeignBoot= 0x04,
77kBVFlagBootable= 0x08,
78kBVFlagEFISystem= 0x10,
79kBVFlagBooter= 0x20,
80kBVFlagSystemVolume= 0x40
81};
82
83enum {
84kBIOSDevTypeFloppy= 0x00,
85kBIOSDevTypeHardDrive= 0x80,
86kBIOSDevTypeNetwork= 0xE0,
87kBIOSDevUnitMask= 0x0F,
88kBIOSDevTypeMask= 0xF0,
89kBIOSDevMask= 0xFF
90};
91
92enum {
93kPartitionTypeHFS= 0xAF,
94kPartitionTypeHPFS= 0x07,
95kPartitionTypeFAT16= 0x06,
96kPartitionTypeFAT32= 0x0c,
97kPartitionTypeEXT3= 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 */
106enum {
107DEV_SD = 0,
108DEV_HD = 1,
109DEV_FD = 2,
110DEV_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
130enum {
131kNetworkDeviceType = kBIOSDevTypeNetwork,
132kBlockDeviceType = kBIOSDevTypeHardDrive
133}; //gBootFileType_t;
134
135enum {
136kCursorTypeHidden = 0x0100,
137kCursorTypeUnderline = 0x0607
138};
139
140#endif /* !__LIBSAIO_SAIO_TYPES_H */
141

Archive Download this file

Revision: 1407