ReactOS 0.4.15-dev-7788-g1ad9096
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{
87
88#include <pshpack1.h>
89typedef struct
90{
91 unsigned long eax;
92 unsigned long ebx;
93 unsigned long ecx;
94 unsigned long edx;
95
96 unsigned long esi;
97 unsigned long edi;
98 unsigned long ebp;
99
100 unsigned short ds;
101 unsigned short es;
102 unsigned short fs;
103 unsigned short gs;
104
105 unsigned long eflags;
106
107} DWORDREGS;
108
109typedef struct
110{
111 unsigned short ax, _upper_ax;
112 unsigned short bx, _upper_bx;
113 unsigned short cx, _upper_cx;
114 unsigned short dx, _upper_dx;
115
116 unsigned short si, _upper_si;
117 unsigned short di, _upper_di;
118 unsigned short bp, _upper_bp;
119
120 unsigned short ds;
121 unsigned short es;
122 unsigned short fs;
123 unsigned short gs;
124
125 unsigned short flags, _upper_flags;
126
127} WORDREGS;
128
129typedef struct
130{
131 unsigned char al;
132 unsigned char ah;
133 unsigned short _upper_ax;
134 unsigned char bl;
135 unsigned char bh;
136 unsigned short _upper_bx;
137 unsigned char cl;
138 unsigned char ch;
139 unsigned short _upper_cx;
140 unsigned char dl;
141 unsigned char dh;
142 unsigned short _upper_dx;
143
144 unsigned short si, _upper_si;
145 unsigned short di, _upper_di;
146 unsigned short bp, _upper_bp;
147
148 unsigned short ds;
149 unsigned short es;
150 unsigned short fs;
151 unsigned short gs;
152
153 unsigned short flags, _upper_flags;
154
155} BYTEREGS;
156
157
158typedef union
159{
164} REGS;
165#include <poppack.h>
166
167// Int386()
168//
169// Real mode interrupt vector interface
170//
171// (E)FLAGS can *only* be returned by this function, not set.
172// Make sure all memory pointers are in SEG:OFFS format and
173// not linear addresses, unless the interrupt handler
174// specifically handles linear addresses.
175int __cdecl Int386(int ivec, REGS* in, REGS* out);
176
177// This macro tests the Carry Flag
178// If CF is set then the call failed (usually)
179#define INT386_SUCCESS(regs) ((regs.x.eflags & EFLAGS_CF) == 0)
180
182 IN UCHAR BootDrive OPTIONAL,
183 IN ULONG BootPartition OPTIONAL);
184
186 IN REGS* In,
187 IN USHORT StackSegment,
188 IN USHORT StackPointer,
189 IN USHORT CodeSegment,
190 IN USHORT CodePointer);
191
194
195#endif /* ! __ASM__ */
196
197/* Layout of the REGS structure */
198#define REGS_EAX 0
199#define REGS_EBX 4
200#define REGS_ECX 8
201#define REGS_EDX 12
202#define REGS_ESI 16
203#define REGS_EDI 20
204#define REGS_EBP 24
205#define REGS_DS 28
206#define REGS_ES 30
207#define REGS_FS 32
208#define REGS_GS 34
209#define REGS_EFLAGS 36
210#define REGS_SIZE 40
211
212#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
int __cdecl Int386(int ivec, REGS *in, REGS *out)
VOID __cdecl Relocator16Boot(IN REGS *In, IN USHORT StackSegment, IN USHORT StackPointer, IN USHORT CodeSegment, IN USHORT CodePointer)
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)
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:1745
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
static FILE * out
Definition: regtests2xml.c:44
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:136
unsigned short _upper_cx
Definition: pcbios.h:139
unsigned short _upper_ax
Definition: pcbios.h:133
unsigned short fs
Definition: pcbios.h:150
unsigned char bl
Definition: pcbios.h:134
unsigned char ch
Definition: pcbios.h:138
unsigned short _upper_flags
Definition: pcbios.h:153
unsigned char dl
Definition: pcbios.h:140
unsigned char cl
Definition: pcbios.h:137
unsigned short es
Definition: pcbios.h:149
unsigned short gs
Definition: pcbios.h:151
unsigned short _upper_si
Definition: pcbios.h:144
unsigned char al
Definition: pcbios.h:131
unsigned short _upper_di
Definition: pcbios.h:145
unsigned short ds
Definition: pcbios.h:148
unsigned short _upper_dx
Definition: pcbios.h:142
unsigned char ah
Definition: pcbios.h:132
unsigned char dh
Definition: pcbios.h:141
unsigned short _upper_bp
Definition: pcbios.h:146
unsigned char bh
Definition: pcbios.h:135
unsigned short es
Definition: pcbios.h:101
unsigned short gs
Definition: pcbios.h:103
unsigned long esi
Definition: pcbios.h:96
unsigned long ebx
Definition: pcbios.h:92
unsigned long eflags
Definition: pcbios.h:105
unsigned short fs
Definition: pcbios.h:102
unsigned long ebp
Definition: pcbios.h:98
unsigned long edx
Definition: pcbios.h:94
unsigned long eax
Definition: pcbios.h:91
unsigned short ds
Definition: pcbios.h:100
unsigned long edi
Definition: pcbios.h:97
unsigned long ecx
Definition: pcbios.h:93
unsigned short _upper_cx
Definition: pcbios.h:113
unsigned short _upper_flags
Definition: pcbios.h:125
unsigned short _upper_dx
Definition: pcbios.h:114
unsigned short es
Definition: pcbios.h:121
unsigned short _upper_bp
Definition: pcbios.h:118
unsigned short _upper_di
Definition: pcbios.h:117
unsigned short _upper_ax
Definition: pcbios.h:111
unsigned short ds
Definition: pcbios.h:120
unsigned short fs
Definition: pcbios.h:122
unsigned short _upper_bx
Definition: pcbios.h:112
unsigned short _upper_si
Definition: pcbios.h:116
unsigned short gs
Definition: pcbios.h:123
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:159
DWORDREGS d
Definition: pcbios.h:161
DWORDREGS x
Definition: pcbios.h:160
BYTEREGS b
Definition: pcbios.h:163
WORDREGS w
Definition: pcbios.h:162
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
unsigned char UCHAR
Definition: xmlstorage.h:181