ia64/xen-unstable

view xen/include/asm-x86/x86_32/regs.h @ 3371:f913da82d617

bitkeeper revision 1.1159.212.1 (41d59cb5edkDeCOlUSEcFsW0oqB4mw)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
into scramble.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
author kaf24@scramble.cl.cam.ac.uk
date Fri Dec 31 18:38:45 2004 +0000 (2004-12-31)
parents 91d462a4e723 7b517e31b8e4
children aa7ce8a31f3d ed902e5c4b49
line source
1 #ifndef _I386_REGS_H
2 #define _I386_REGS_H
4 #include <asm/types.h>
6 struct xen_regs
7 {
8 /* All saved activations contain the following fields. */
9 u32 ebx;
10 u32 ecx;
11 u32 edx;
12 u32 esi;
13 u32 edi;
14 u32 ebp;
15 u32 eax;
16 u16 error_code;
17 u16 entry_vector;
18 u32 eip;
19 u32 cs;
20 u32 eflags;
22 /* Only saved guest activations contain the following fields. */
23 u32 esp;
24 u32 ss;
25 u32 es;
26 u32 ds;
27 u32 fs;
28 u32 gs;
29 } __attribute__ ((packed));
31 enum EFLAGS {
32 EF_CF = 0x00000001,
33 EF_PF = 0x00000004,
34 EF_AF = 0x00000010,
35 EF_ZF = 0x00000040,
36 EF_SF = 0x00000080,
37 EF_TF = 0x00000100,
38 EF_IE = 0x00000200,
39 EF_DF = 0x00000400,
40 EF_OF = 0x00000800,
41 EF_IOPL = 0x00003000,
42 EF_IOPL_RING0 = 0x00000000,
43 EF_IOPL_RING1 = 0x00001000,
44 EF_IOPL_RING2 = 0x00002000,
45 EF_NT = 0x00004000, /* nested task */
46 EF_RF = 0x00010000, /* resume */
47 EF_VM = 0x00020000, /* virtual mode */
48 EF_AC = 0x00040000, /* alignment */
49 EF_VIF = 0x00080000, /* virtual interrupt */
50 EF_VIP = 0x00100000, /* virtual interrupt pending */
51 EF_ID = 0x00200000, /* id */
52 };
54 #define VM86_MODE(_r) ((_r)->eflags & EF_VM)
55 #define RING_0(_r) (((_r)->cs & 3) == 0)
56 #define RING_1(_r) (((_r)->cs & 3) == 1)
57 #define RING_2(_r) (((_r)->cs & 3) == 2)
58 #define RING_3(_r) (((_r)->cs & 3) == 3)
60 #endif