8 * This file defines data structures that allow easy access to i386
13 FILE_LICENCE ( GPL2_OR_LATER
);
18 * A 16-bit general register.
20 * This type encapsulates a 16-bit register such as %ax, %bx, %cx,
21 * %dx, %si, %di, %bp or %sp.
31 } __attribute__ (( packed
));
33 } __attribute__ (( packed
)) reg16_t
;
36 * A 32-bit general register.
38 * This type encapsulates a 32-bit register such as %eax, %ebx, %ecx,
39 * %edx, %esi, %edi, %ebp or %esp.
49 } __attribute__ (( packed
));
52 } __attribute__ (( packed
)) reg32_t
;
55 * A 32-bit general register dump.
57 * This is the data structure that is created on the stack by the @c
58 * pushal instruction, and can be read back using the @c popal
83 } __attribute__ (( packed
));
91 } __attribute__ (( packed
));
99 } __attribute__ (( packed
));
107 } __attribute__ (( packed
));
111 } __attribute__ (( packed
));
114 * A segment register dump.
116 * The i386 has no equivalent of the @c pushal or @c popal
117 * instructions for the segment registers. We adopt the convention of
118 * always using the sequences
122 * pushw %gs ; pushw %fs ; pushw %es ; pushw %ds ; pushw %ss ; pushw %cs
130 * addw $4, %sp ; popw %ds ; popw %es ; popw %fs ; popw %gs
134 * This is the data structure that is created and read back by these
135 * instruction sequences.
138 struct i386_seg_regs
{
145 } __attribute__ (( packed
));
148 * A full register dump.
150 * This data structure is created by the instructions
156 * pushw %gs ; pushw %fs ; pushw %es ; pushw %ds ; pushw %ss ; pushw %cs
160 * and can be read back using the instructions
164 * addw $4, %sp ; popw %ds ; popw %es ; popw %fs ; popw %gs
170 * prot_call() and kir_call() create this data structure on the stack
171 * and pass in a pointer to this structure.
174 struct i386_all_regs
{
175 struct i386_seg_regs segs
;
176 struct i386_regs regs
;
178 } __attribute__ (( packed
));
181 #define CF ( 1 << 0 )
182 #define PF ( 1 << 2 )
183 #define AF ( 1 << 4 )
184 #define ZF ( 1 << 6 )
185 #define SF ( 1 << 7 )
186 #define OF ( 1 << 11 )
188 /* Segment:offset structure. Note that the order within the structure
194 } __attribute__ (( packed
));
196 typedef struct segoff segoff_t
;
198 #endif /* REGISTERS_H */