Chameleon

Chameleon Svn Source Tree

Root/branches/Bungo/i386/libsaio/bios.h

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/*
25 * Copyright 1994 NeXT Computer, Inc.
26 * All rights reserved.
27 */
28
29#ifndef __LIBSAIO_BIOS_H
30#define __LIBSAIO_BIOS_H
31
32#include "bootargs.h"
33
34typedef union {
35unsigned int rx;
36unsigned short rr;
37struct {
38unsigned char l;
39unsigned char h;
40} r;
41} machineRegister_t;
42
43typedef struct {
44unsigned short cf :1;
45unsigned short :1;
46unsigned short pf :1;
47unsigned short :1;
48unsigned short af :1;
49unsigned short :1;
50unsigned short zf :1;
51unsigned short sf :1;
52unsigned short tf :1;
53unsigned short _if :1;
54unsigned short df :1;
55unsigned short of :1;
56unsigned short iopl:2;
57unsigned short nt :1;
58} machineFlags_t;
59
60typedef struct {
61unsigned int intno;
62machineRegister_t eax;
63machineRegister_t ebx;
64machineRegister_t ecx;
65machineRegister_t edx;
66machineRegister_t edi;
67machineRegister_t esi;
68machineRegister_t ebp;
69unsigned short cs;
70unsigned short ds;
71unsigned short es;
72machineFlags_t flags;
73} biosBuf_t;
74
75#define EBIOS_FIXED_DISK_ACCESS0x01
76#define EBIOS_LOCKING_ACCESS0x02
77#define EBIOS_ENHANCED_DRIVE_INFO0x04
78
79#define BASE_HD_DRIVE0x80
80
81#if 0
82/*
83 * ACPI defined memory range types.
84 */
85enum {
86kMemoryRangeUsable = 1, // RAM usable by the OS.
87kMemoryRangeReserved = 2, // Reserved. (Do not use)
88kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.
89kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use)
90
91/* Undefined types should be treated as kMemoryRangeReserved */
92};
93#endif
94
95/*
96 * Memory range descriptor.
97 */
98typedef struct MemoryRange {
99unsigned long long base; // 64-bit base address
100unsigned long long length; // 64-bit length in bytes
101unsigned long type; // type of memory range
102unsigned long reserved;
103} MemoryRange;
104
105#endif /* !__LIBSAIO_BIOS_H */
106

Archive Download this file

Revision: 2340