compiler.h is now always included on the command line.
[people/balajirrao/gpxe.git] / src / arch / i386 / include / registers.h
1 #ifndef REGISTERS_H
2 #define REGISTERS_H
3
4 #include "stdint.h"
5
6 /* Basic 16-bit and 32-bit register types */
7 typedef union {
8         struct {
9                 union {
10                         uint8_t l;
11                         uint8_t byte;
12                 };
13                 uint8_t h;
14         } PACKED;
15         uint16_t word;
16 } PACKED reg16_t;
17
18 typedef union {
19         reg16_t;
20         uint32_t dword;
21 } PACKED reg32_t;
22
23 /* As created by pushal / read by popal */
24 struct i386_regs {
25         union {
26                 uint16_t di;
27                 uint32_t edi;
28         };
29         union {
30                 uint16_t si;
31                 uint32_t esi;
32         };
33         union {
34                 uint16_t bp;
35                 uint32_t ebp;
36         };
37         union {
38                 uint16_t sp;
39                 uint32_t esp;
40         };
41         union {
42                 struct {
43                         uint8_t bl;
44                         uint8_t bh;
45                 } PACKED;
46                 uint16_t bx;
47                 uint32_t ebx;
48         };
49         union {
50                 struct {
51                         uint8_t dl;
52                         uint8_t dh;
53                 } PACKED;
54                 uint16_t dx;
55                 uint32_t edx;
56         };
57         union {
58                 struct {
59                         uint8_t cl;
60                         uint8_t ch;
61                 } PACKED;
62                 uint16_t cx;
63                 uint32_t ecx;
64         };
65         union {
66                 struct {
67                         uint8_t al;
68                         uint8_t ah;
69                 } PACKED;
70                 uint16_t ax;
71                 uint32_t eax;
72         };
73 } PACKED;
74
75 /* Our pushal/popal equivalent for segment registers */
76 struct i386_seg_regs {
77         uint16_t cs;
78         uint16_t ss;
79         uint16_t ds;
80         uint16_t es;
81         uint16_t fs;
82         uint16_t gs;
83 } PACKED;
84
85 /* All i386 registers, as passed in by prot_call or kir_call */
86 struct i386_all_regs {
87         struct i386_seg_regs;
88         struct i386_regs;
89         uint32_t i386_flags;
90 } PACKED;
91
92 #endif /* REGISTERS_H */