Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Trunk/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#define EBIOS_FIXED_DISK_ACCESS0x01
80#define EBIOS_LOCKING_ACCESS0x02
81#define EBIOS_ENHANCED_DRIVE_INFO0x04
82
83#define BASE_HD_DRIVE0x80
84
85#if 0
86/*
87 * ACPI defined memory range types.
88 */
89enum
90{
91kMemoryRangeUsable = 1, // RAM usable by the OS.
92kMemoryRangeReserved = 2, // Reserved. (Do not use)
93kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.
94kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use)
95
96/* Undefined types should be treated as kMemoryRangeReserved */
97};
98#endif
99
100/*
101 * Memory range descriptor.
102 */
103typedef struct MemoryRange
104{
105unsigned long long base; // 64-bit base address
106unsigned long long length; // 64-bit length in bytes
107unsigned long type; // type of memory range
108unsigned long reserved;
109} MemoryRange;
110
111#endif /* !__LIBSAIO_BIOS_H */
112

Archive Download this file

Revision: 2045