debuggers.hg

view xen/include/asm-x86/x86_64/regs.h @ 22906:700ac6445812

Now add KDB to the non-kdb tree
author Mukesh Rathor
date Thu Feb 03 15:42:41 2011 -0800 (2011-02-03)
parents 405573aedd24
children
line source
1 #ifndef _X86_64_REGS_H
2 #define _X86_64_REGS_H
4 #include <xen/types.h>
5 #include <public/xen.h>
7 #define vm86_mode(r) (0) /* No VM86 support in long mode. */
8 #define ring_0(r) (((r)->cs & 3) == 0)
9 #define ring_1(r) (((r)->cs & 3) == 1)
10 #define ring_2(r) (((r)->cs & 3) == 2)
11 #define ring_3(r) (((r)->cs & 3) == 3)
13 #define guest_kernel_mode(v, r) \
14 (!is_pv_32bit_vcpu(v) ? \
15 (ring_3(r) && ((v)->arch.flags & TF_kernel_mode)) : \
16 (ring_1(r)))
18 #define permit_softint(dpl, v, r) \
19 ((dpl) >= (guest_kernel_mode(v, r) ? 1 : 3))
21 /* Check for null trap callback handler: Is the EIP null? */
22 #define null_trap_bounce(v, tb) \
23 (!is_pv_32bit_vcpu(v) ? ((tb)->eip == 0) : (((tb)->cs & ~3) == 0))
25 /* Number of bytes of on-stack execution state to be context-switched. */
26 /* NB. Segment registers and bases are not saved/restored on x86/64 stack. */
27 #define CTXT_SWITCH_STACK_BYTES (offsetof(struct cpu_user_regs, es))
29 #endif