debuggers.hg

view xen/include/asm-x86/x86_64/regs.h @ 3770:d21fbb46b9d8

bitkeeper revision 1.1159.253.1 (4208f8a54Zaz-XgC11YTHeLxPHPoZg)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk
author kaf24@scramble.cl.cam.ac.uk
date Tue Feb 08 17:36:37 2005 +0000 (2005-02-08)
parents f5f2757b3aa2 cb87fd290eb0
children 12104922e743
line source
1 #ifndef _X86_64_REGS_H
2 #define _X86_64_REGS_H
4 #include <asm/types.h>
6 struct xen_regs
7 {
8 u64 r15;
9 u64 r14;
10 u64 r13;
11 u64 r12;
12 union { u64 rbp; u64 ebp; } __attribute__ ((packed));
13 union { u64 rbx; u64 ebx; } __attribute__ ((packed));
14 /* NB. Above here is C callee-saves. */
15 u64 r11;
16 u64 r10;
17 u64 r9;
18 u64 r8;
19 union { u64 rax; u64 eax; } __attribute__ ((packed));
20 union { u64 rcx; u64 ecx; } __attribute__ ((packed));
21 union { u64 rdx; u64 edx; } __attribute__ ((packed));
22 union { u64 rsi; u64 esi; } __attribute__ ((packed));
23 union { u64 rdi; u64 edi; } __attribute__ ((packed));
24 u32 error_code;
25 u32 entry_vector;
26 union { u64 rip; u64 eip; } __attribute__ ((packed));
27 u64 cs;
28 union { u64 rflags; u64 eflags; } __attribute__ ((packed));
29 union { u64 rsp; u64 esp; } __attribute__ ((packed));
30 u64 ss;
31 } __attribute__ ((packed));
33 #define VM86_MODE(_r) ((_r)->eflags & EF_VM)
34 #define RING_0(_r) (((_r)->cs & 3) == 0)
35 #define RING_1(_r) (((_r)->cs & 3) == 1)
36 #define RING_2(_r) (((_r)->cs & 3) == 2)
37 #define RING_3(_r) (((_r)->cs & 3) == 3)
39 #define GUESTOS_FAULT(_r) (!VM86_MODE(_r) && RING_3(_r))
41 #endif