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 | ␊ |
31 | typedef union␊ |
32 | {␊ |
33 | ␉unsigned int rx;␊ |
34 | ␉unsigned short rr;␊ |
35 | ␊ |
36 | ␉struct␊ |
37 | ␉{␊ |
38 | ␉␉unsigned char l;␊ |
39 | ␉␉unsigned char h;␊ |
40 | ␉} r;␊ |
41 | } machineRegister_t;␊ |
42 | ␊ |
43 | ␊ |
44 | typedef struct␊ |
45 | {␊ |
46 | ␉unsigned short cf :1;␊ |
47 | ␉unsigned short :1;␊ |
48 | ␉unsigned short pf :1;␊ |
49 | ␉unsigned short :1;␊ |
50 | ␉unsigned short af :1;␊ |
51 | ␉unsigned short :1;␊ |
52 | ␉unsigned short zf :1;␊ |
53 | ␉unsigned short sf :1;␊ |
54 | ␉unsigned short tf :1;␊ |
55 | ␉unsigned short _if :1;␊ |
56 | ␉unsigned short df :1;␊ |
57 | ␉unsigned short of :1;␊ |
58 | ␉unsigned short iopl:2;␊ |
59 | ␉unsigned short nt :1;␊ |
60 | } machineFlags_t;␊ |
61 | ␊ |
62 | ␊ |
63 | typedef struct␊ |
64 | {␊ |
65 | ␉unsigned int intno;␊ |
66 | ␉machineRegister_t eax;␊ |
67 | ␉machineRegister_t ebx;␊ |
68 | ␉machineRegister_t ecx;␊ |
69 | ␉machineRegister_t edx;␊ |
70 | ␉machineRegister_t edi;␊ |
71 | ␉machineRegister_t esi;␊ |
72 | ␉machineRegister_t ebp;␊ |
73 | ␉unsigned short cs;␊ |
74 | ␉unsigned short ds;␊ |
75 | ␉unsigned short es;␊ |
76 | ␉machineFlags_t flags;␊ |
77 | } biosBuf_t;␊ |
78 | ␊ |
79 | #define EBIOS_FIXED_DISK_ACCESS␉␉0x01␊ |
80 | #define EBIOS_LOCKING_ACCESS␉␉0x02␊ |
81 | #define EBIOS_ENHANCED_DRIVE_INFO␉0x04␊ |
82 | ␊ |
83 | #define BASE_HD_DRIVE␉␉␉0x80␊ |
84 | ␊ |
85 | #if 0␊ |
86 | /* ␊ |
87 | * ACPI defined memory range types.␊ |
88 | */␊ |
89 | enum␊ |
90 | {␊ |
91 | ␉kMemoryRangeUsable = 1, // RAM usable by the OS.␊ |
92 | ␉kMemoryRangeReserved = 2, // Reserved. (Do not use)␊ |
93 | ␉kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.␊ |
94 | ␉kMemoryRangeNVS = 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 | */␊ |
103 | typedef struct MemoryRange␊ |
104 | {␊ |
105 | ␉unsigned long long base; // 64-bit base address␊ |
106 | ␉unsigned long long length; // 64-bit length in bytes␊ |
107 | ␉unsigned long type; // type of memory range␊ |
108 | ␉unsigned long reserved;␊ |
109 | } MemoryRange;␊ |
110 | ␊ |
111 | #endif /* !__LIBSAIO_BIOS_H */␊ |
112 | |