ReactOS 0.4.16-dev-1946-g52006dd
pcbios.h
Go to the documentation of this file.
1#ifndef _PCBIOS_H_
2#define _PCBIOS_H_
3
4#ifdef __ASM__
5#define EFLAGS_CF HEX(01)
6#define EFLAGS_ZF HEX(40)
7#define EFLAGS_SF HEX(80)
8#endif
9
10#ifndef __ASM__
11
12#define MAX_BIOS_DESCRIPTORS 80
13
14typedef enum
15{
16 // ACPI 1.0.
21 // ACPI 3.0.
23 // ACPI 4.0.
25 // ACPI 6.0.
32 // BiosMemoryUndefinedNN = 13-0xEFFFFFFF
33 // BiosMemoryOemDefinedNN = 0xF0000000-0xFFFFFFFF
35
36typedef struct
37{
38 // ACPI 1.0.
41 ULONG Type;
42 // ACPI 3.0.
43 union
44 {
46
47 struct
48 {
49 // Bit 0. ACPI 3.0.
50 // As of ACPI 4.0, became "Reserved -> must be 1".
52 // Bit 1. ACPI 3.0.
53 // As of ACPI 6.1, became "Unimplemented -> Deprecated".
54 // As of ACPI 6.3, became "Reserved -> must be 0".
56 // Bit 2. ACPI 4.0.
57 // As of ACPI 6.1, became "Unimplemented -> Deprecated".
58 // As of ACPI 6.3, became "Reserved -> must be 0".
60 // Bit 3. ACPI 4.0.
61 // ACPI 5.0-A added "Used only on PC-AT BIOS" (not UEFI).
63 // Bits 4-31. ACPI 3.0.
64 ULONG Reserved : 28;
65 } ExtendedAttributes;
66 };
68
69/* Int 15h AX=E820h Entry minimal size. */
70C_ASSERT(FIELD_OFFSET(BIOS_MEMORY_MAP, ExtendedAttributes) == 20);
71/* Int 15h AX=E820h Entry maximal size. */
73
74/* FIXME: Should be moved to NDK, and respective ACPI header files */
75typedef struct _ACPI_BIOS_DATA
76{
79 BIOS_MEMORY_MAP MemoryMap[1]; /* Count of BIOS memory map entries */
81
83{
89
90#include <pshpack1.h>
91typedef struct
92{
93 unsigned long eax;
94 unsigned long ebx;
95 unsigned long ecx;
96 unsigned long edx;
97
98 unsigned long esi;
99 unsigned long edi;
100 unsigned long ebp;
101
102 unsigned short ds;
103 unsigned short es;
104 unsigned short fs;
105 unsigned short gs;
106
107 unsigned long eflags;
108
109} DWORDREGS;
110
111typedef struct
112{
113 unsigned short ax, _upper_ax;
114 unsigned short bx, _upper_bx;
115 unsigned short cx, _upper_cx;
116 unsigned short dx, _upper_dx;
117
118 unsigned short si, _upper_si;
119 unsigned short di, _upper_di;
120 unsigned short bp, _upper_bp;
121
122 unsigned short ds;
123 unsigned short es;
124 unsigned short fs;
125 unsigned short gs;
126
127 unsigned short flags, _upper_flags;
128
129} WORDREGS;
130
131typedef struct
132{
133 unsigned char al;
134 unsigned char ah;
135 unsigned short _upper_ax;
136 unsigned char bl;
137 unsigned char bh;
138 unsigned short _upper_bx;
139 unsigned char cl;
140 unsigned char ch;
141 unsigned short _upper_cx;
142 unsigned char dl;
143 unsigned char dh;
144 unsigned short _upper_dx;
145
146 unsigned short si, _upper_si;
147 unsigned short di, _upper_di;
148 unsigned short bp, _upper_bp;
149
150 unsigned short ds;
151 unsigned short es;
152 unsigned short fs;
153 unsigned short gs;
154
155 unsigned short flags, _upper_flags;
156
157} BYTEREGS;
158
159
160typedef union
161{
166} REGS;
167#include <poppack.h>
168
169// Int386()
170//
171// Real mode interrupt vector interface
172//
173// (E)FLAGS can *only* be returned by this function, not set.
174// Make sure all memory pointers are in SEG:OFFS format and
175// not linear addresses, unless the interrupt handler
176// specifically handles linear addresses.
177int __cdecl Int386(int ivec, REGS* in, REGS* out);
178
179// This macro tests the Carry Flag
180// If CF is set then the call failed (usually)
181#define INT386_SUCCESS(regs) ((regs.x.eflags & EFLAGS_CF) == 0)
182
184 IN UCHAR BootDrive OPTIONAL,
185 IN ULONG BootPartition OPTIONAL);
186
189 IN REGS* In,
190 IN USHORT StackSegment,
191 IN USHORT StackPointer,
192 IN USHORT CodeSegment,
193 IN USHORT CodePointer);
194
197
199
200#endif /* ! __ASM__ */
201
202/* Layout of the REGS structure */
203#define REGS_EAX 0
204#define REGS_EBX 4
205#define REGS_ECX 8
206#define REGS_EDX 12
207#define REGS_ESI 16
208#define REGS_EDI 20
209#define REGS_EBP 24
210#define REGS_DS 28
211#define REGS_ES 30
212#define REGS_FS 32
213#define REGS_GS 34
214#define REGS_EFLAGS 36
215#define REGS_SIZE 40
216
217#endif /* _PCBIOS_H_ */
Type
Definition: Type.h:7
#define __cdecl
Definition: accygwin.h:79
@ Reboot
Definition: bl.h:891
@ In
GLuint in
Definition: glext.h:9616
GLbitfield flags
Definition: glext.h:7161
#define C_ASSERT(e)
Definition: intsafe.h:73
GLint dx
Definition: linetemp.h:97
#define DECLSPEC_NORETURN
Definition: ntbasedef.h:179
int __cdecl Int386(int ivec, REGS *in, REGS *out)
struct _ACPI_BIOS_DATA ACPI_BIOS_DATA
BIOS_MEMORY_TYPE
Definition: pcbios.h:15
@ BiosMemoryUsable
Definition: pcbios.h:17
@ BiosMemoryOemDefined12
Definition: pcbios.h:31
@ BiosMemoryUndefined09
Definition: pcbios.h:28
@ BiosMemoryUndefined11
Definition: pcbios.h:30
@ BiosMemoryPersistent
Definition: pcbios.h:26
@ BiosMemoryDisabled
Definition: pcbios.h:24
@ BiosMemoryUnusable
Definition: pcbios.h:22
@ BiosMemoryReserved
Definition: pcbios.h:18
@ BiosMemoryAcpiReclaim
Definition: pcbios.h:19
@ BiosMemoryUndefined10
Definition: pcbios.h:29
@ BiosMemoryUndefined08
Definition: pcbios.h:27
@ BiosMemoryAcpiNvs
Definition: pcbios.h:20
VOID DetectHardware(VOID)
DECLSPEC_NORETURN VOID __cdecl Relocator16Boot(IN REGS *In, IN USHORT StackSegment, IN USHORT StackPointer, IN USHORT CodeSegment, IN USHORT CodePointer)
struct _ACPI_BIOS_DATA * PACPI_BIOS_DATA
struct _DOCKING_STATE_INFORMATION DOCKING_STATE_INFORMATION
VOID __cdecl ChainLoadBiosBootSectorCode(IN UCHAR BootDrive OPTIONAL, IN ULONG BootPartition OPTIONAL)
Definition: machpc.c:1744
struct BIOS_MEMORY_MAP * PBIOS_MEMORY_MAP
struct _DOCKING_STATE_INFORMATION * PDOCKING_STATE_INFORMATION
unsigned short USHORT
Definition: pedump.c:61
_Out_opt_ int * cx
Definition: commctrl.h:585
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
ULONG ExtendedAttributesAsULONG
Definition: pcbios.h:45
ULONGLONG BaseAddress
Definition: pcbios.h:39
ULONGLONG Length
Definition: pcbios.h:40
ULONG Enabled_Reserved
Definition: pcbios.h:51
ULONG NonVolatile_Deprecated_Reserved
Definition: pcbios.h:55
ULONG SlowAccess_Deprecated_Reserved
Definition: pcbios.h:59
ULONG ErrorLog
Definition: pcbios.h:62
unsigned short _upper_bx
Definition: pcbios.h:138
unsigned short _upper_cx
Definition: pcbios.h:141
unsigned short _upper_ax
Definition: pcbios.h:135
unsigned short fs
Definition: pcbios.h:152
unsigned char bl
Definition: pcbios.h:136
unsigned char ch
Definition: pcbios.h:140
unsigned short _upper_flags
Definition: pcbios.h:155
unsigned char dl
Definition: pcbios.h:142
unsigned char cl
Definition: pcbios.h:139
unsigned short es
Definition: pcbios.h:151
unsigned short gs
Definition: pcbios.h:153
unsigned short _upper_si
Definition: pcbios.h:146
unsigned char al
Definition: pcbios.h:133
unsigned short _upper_di
Definition: pcbios.h:147
unsigned short ds
Definition: pcbios.h:150
unsigned short _upper_dx
Definition: pcbios.h:144
unsigned char ah
Definition: pcbios.h:134
unsigned char dh
Definition: pcbios.h:143
unsigned short _upper_bp
Definition: pcbios.h:148
unsigned char bh
Definition: pcbios.h:137
unsigned short es
Definition: pcbios.h:103
unsigned short gs
Definition: pcbios.h:105
unsigned long esi
Definition: pcbios.h:98
unsigned long ebx
Definition: pcbios.h:94
unsigned long eflags
Definition: pcbios.h:107
unsigned short fs
Definition: pcbios.h:104
unsigned long ebp
Definition: pcbios.h:100
unsigned long edx
Definition: pcbios.h:96
unsigned long eax
Definition: pcbios.h:93
unsigned short ds
Definition: pcbios.h:102
unsigned long edi
Definition: pcbios.h:99
unsigned long ecx
Definition: pcbios.h:95
unsigned short _upper_cx
Definition: pcbios.h:115
unsigned short _upper_flags
Definition: pcbios.h:127
unsigned short _upper_dx
Definition: pcbios.h:116
unsigned short es
Definition: pcbios.h:123
unsigned short _upper_bp
Definition: pcbios.h:120
unsigned short _upper_di
Definition: pcbios.h:119
unsigned short _upper_ax
Definition: pcbios.h:113
unsigned short ds
Definition: pcbios.h:122
unsigned short fs
Definition: pcbios.h:124
unsigned short _upper_bx
Definition: pcbios.h:114
unsigned short _upper_si
Definition: pcbios.h:118
unsigned short gs
Definition: pcbios.h:125
PHYSICAL_ADDRESS RSDTAddress
Definition: pcbios.h:77
BIOS_MEMORY_MAP MemoryMap[1]
Definition: pcbios.h:79
ULONGLONG Count
Definition: pcbios.h:78
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx movl TEMP incl eax andl eax ecx incl ebx testl eax jnz xchgl ecx incl TEMP esp ecx subl ebx pushl ecx ecx edx ecx shrl ecx mm0 mm4 mm0 mm4 mm1 mm5 mm1 mm5 mm2 mm6 mm2 mm6 mm3 mm7 mm3 mm7 paddd mm0 paddd mm4 paddd mm0 paddd mm4 paddd mm0 paddd mm4 movq mm1 movq mm5 psrlq mm1 psrlq mm5 paddd mm0 paddd mm4 psrad mm0 psrad mm4 packssdw mm0 packssdw mm4 mm1 punpckldq mm0 pand mm1 pand mm0 por mm1 movq edi esi edx edi decl ecx jnz popl ecx andl ecx jecxz mm0 mm0 mm1 mm1 mm2 mm2 mm3 mm3 paddd mm0 paddd mm0 paddd mm0 movq mm1 psrlq mm1 paddd mm0 psrad mm0 packssdw mm0 movd eax movw ax
Definition: synth_sse3d.h:180
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
Definition: pcbios.h:161
DWORDREGS d
Definition: pcbios.h:163
DWORDREGS x
Definition: pcbios.h:162
BYTEREGS b
Definition: pcbios.h:165
WORDREGS w
Definition: pcbios.h:164
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
unsigned char UCHAR
Definition: xmlstorage.h:181