static unsigned long current_cr0, current_cr3;
static void lguest_write_cr0(unsigned long val)
{
- /* 8 == TS bit. */
- lazy_hcall(LHCALL_TS, val & 8, 0, 0);
+ lazy_hcall(LHCALL_TS, val & X86_CR0_TS, 0, 0);
current_cr0 = val;
}
static void lguest_clts(void)
{
lazy_hcall(LHCALL_TS, 0, 0, 0);
- current_cr0 &= ~8U;
+ current_cr0 &= ~X86_CR0_TS;
}
/* CR2 is the virtual address of the last page fault, which the Guest only ever
* is supposed to always be "1". Bit 9 (0x200) controls whether
* interrupts are enabled. We always leave interrupts enabled while
* running the Guest. */
- regs->eflags = 0x202;
+ regs->eflags = X86_EFLAGS_IF | 0x2;
/* The "Extended Instruction Pointer" register says where the Guest is
* running. */