Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Enoch_Modules/i386/libsaio/bios.h

1/*
2 * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
3 *
4 *
5 * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
6 * Reserved. This file contains Original Code and/or Modifications of
7 * Original Code as defined in and that are subject to the Apple Public
8 * Source License Version 2.0 (the "License"). You may not use this file
9 * except in compliance with the License. Please obtain a copy of the
10 * License at http://www.apple.com/publicsource and read it before using
11 * this file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
18 * License for the specific language governing rights and limitations
19 * under the License.
20 *
21 *
22 * Copyright 1994 NeXT Computer, Inc.
23 * All rights reserved.
24 */
25
26#ifndef __LIBSAIO_BIOS_H
27#define __LIBSAIO_BIOS_H
28
29#include "bootargs.h"
30
31typedef union
32{
33unsigned int rx;
34unsigned short rr;
35
36struct
37{
38unsigned char l;
39unsigned char h;
40} r;
41} machineRegister_t;
42
43
44typedef struct
45{
46unsigned short cf :1;
47unsigned short :1;
48unsigned short pf :1;
49unsigned short :1;
50unsigned short af :1;
51unsigned short :1;
52unsigned short zf :1;
53unsigned short sf :1;
54unsigned short tf :1;
55unsigned short _if :1;
56unsigned short df :1;
57unsigned short of :1;
58unsigned short iopl:2;
59unsigned short nt :1;
60} machineFlags_t;
61
62
63typedef struct
64{
65unsigned int intno;
66machineRegister_t eax;
67machineRegister_t ebx;
68machineRegister_t ecx;
69machineRegister_t edx;
70machineRegister_t edi;
71machineRegister_t esi;
72machineRegister_t ebp;
73unsigned short cs;
74unsigned short ds;
75unsigned short es;
76machineFlags_t flags;
77} biosBuf_t;
78
79
80/*
81 * Used in biosfn.c and disk.c
82 */
83
84#define EBIOS_FIXED_DISK_ACCESS0x01
85#define EBIOS_LOCKING_ACCESS0x02
86#define EBIOS_ENHANCED_DRIVE_INFO0x04
87
88#define BASE_HD_DRIVE0x80
89
90#if 0
91/*
92 * ACPI defined memory range types.
93 */
94enum
95{
96kMemoryRangeUsable = 1, // RAM usable by the OS.
97kMemoryRangeReserved = 2, // Reserved. (Do not use)
98kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.
99kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use)
100
101/* Undefined types should be treated as kMemoryRangeReserved */
102};
103#endif
104
105/*
106 * Memory range descriptor.
107 */
108typedef struct MemoryRange
109{
110unsigned long long base; // 64-bit base address
111unsigned long long length; // 64-bit length in bytes
112unsigned long type; // type of memory range
113unsigned long reserved;
114} MemoryRange;
115
116#endif /* !__LIBSAIO_BIOS_H */
117

Archive Download this file

Revision: 2238