[ROSTESTS]
[reactos.git] / reactos / boot / freeldr / freeldr / include / arch / pc / pcbios.h
1 #ifndef __ASM__
2
3 #include <pshpack1.h>
4 typedef struct
5 {
6 unsigned long eax;
7 unsigned long ebx;
8 unsigned long ecx;
9 unsigned long edx;
10
11 unsigned long esi;
12 unsigned long edi;
13
14 unsigned short ds;
15 unsigned short es;
16 unsigned short fs;
17 unsigned short gs;
18
19 unsigned long eflags;
20
21 } DWORDREGS;
22
23 typedef struct
24 {
25 unsigned short ax, _upper_ax;
26 unsigned short bx, _upper_bx;
27 unsigned short cx, _upper_cx;
28 unsigned short dx, _upper_dx;
29
30 unsigned short si, _upper_si;
31 unsigned short di, _upper_di;
32
33 unsigned short ds;
34 unsigned short es;
35 unsigned short fs;
36 unsigned short gs;
37
38 unsigned short flags, _upper_flags;
39
40 } WORDREGS;
41
42 typedef struct
43 {
44 unsigned char al;
45 unsigned char ah;
46 unsigned short _upper_ax;
47 unsigned char bl;
48 unsigned char bh;
49 unsigned short _upper_bx;
50 unsigned char cl;
51 unsigned char ch;
52 unsigned short _upper_cx;
53 unsigned char dl;
54 unsigned char dh;
55 unsigned short _upper_dx;
56
57 unsigned short si, _upper_si;
58 unsigned short di, _upper_di;
59
60 unsigned short ds;
61 unsigned short es;
62 unsigned short fs;
63 unsigned short gs;
64
65 unsigned short flags, _upper_flags;
66
67 } BYTEREGS;
68
69
70 typedef union
71 {
72 DWORDREGS x;
73 DWORDREGS d;
74 WORDREGS w;
75 BYTEREGS b;
76 } REGS;
77 #include <poppack.h>
78
79 // Int386()
80 //
81 // Real mode interrupt vector interface
82 //
83 // (E)FLAGS can *only* be returned by this function, not set.
84 // Make sure all memory pointers are in SEG:OFFS format and
85 // not linear addresses, unless the interrupt handler
86 // specifically handles linear addresses.
87 int Int386(int ivec, REGS* in, REGS* out);
88
89 // This macro tests the Carry Flag
90 // If CF is set then the call failed (usually)
91 #define INT386_SUCCESS(regs) ((regs.x.eflags & EFLAGS_CF) == 0)
92
93 void EnableA20(void);
94 VOID ChainLoadBiosBootSectorCode(VOID); // Implemented in boot.S
95 VOID SoftReboot(VOID); // Implemented in boot.S
96 VOID DetectHardware(VOID); // Implemented in hardware.c
97
98 #endif /* ! __ASM__ */