trying to get rid of b1() in instruction class
This commit is contained in:
parent
369aba757d
commit
8308a47168
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: data_xfer8.cc,v 1.46 2009-12-04 16:53:12 sshwarts Exp $
|
||||
// $Id: data_xfer8.cc,v 1.47 2010-09-24 21:15:16 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001-2009 The Bochs Project
|
||||
@ -31,7 +31,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOV_RLIb(bxInstruction_c *i)
|
||||
|
||||
void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOV_RHIb(bxInstruction_c *i)
|
||||
{
|
||||
BX_WRITE_8BIT_REGH(i->b1() & 0x03, i->Ib());
|
||||
BX_WRITE_8BIT_REGH(i->opcodeReg() & 0x03, i->Ib());
|
||||
}
|
||||
|
||||
void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOV_EbGbM(bxInstruction_c *i)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: proc_ctrl.cc,v 1.337 2010-09-07 19:54:50 sshwarts Exp $
|
||||
// $Id: proc_ctrl.cc,v 1.338 2010-09-24 21:15:16 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001-2010 The Bochs Project
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
void BX_CPP_AttrRegparmN(1) BX_CPU_C::UndefinedOpcode(bxInstruction_c *i)
|
||||
{
|
||||
BX_DEBUG(("UndefinedOpcode: b1 = 0x%02x causes #UD exception", i->b1()));
|
||||
BX_DEBUG(("UndefinedOpcode: generate #UD exception"));
|
||||
exception(BX_UD_EXCEPTION, 0);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: sse_move.cc,v 1.118 2010-07-01 20:00:33 sshwarts Exp $
|
||||
// $Id: sse_move.cc,v 1.119 2010-09-24 21:15:16 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2003-2009 Stanislav Shwartsman
|
||||
@ -261,7 +261,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXSAVE(bxInstruction_c *i)
|
||||
// save XMM8-XMM15 only in 64-bit mode
|
||||
if (index < 8 || long64_mode()) {
|
||||
write_virtual_dqword(i->seg(),
|
||||
eaddr+index*16+160, (Bit8u *) &(BX_CPU_THIS_PTR xmm[index]));
|
||||
eaddr+index*16+160, (Bit8u *)(&BX_READ_XMM_REG(index)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -377,7 +377,8 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXRSTOR(bxInstruction_c *i)
|
||||
// restore XMM8-XMM15 only in 64-bit mode
|
||||
if (index < 8 || long64_mode()) {
|
||||
read_virtual_dqword(i->seg(),
|
||||
eaddr+index*16+160, (Bit8u *) &(BX_CPU_THIS_PTR xmm[index]));
|
||||
eaddr+index*16+160, (Bit8u *)(&BX_READ_XMM_REG(index)));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -698,15 +699,15 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MASKMOVDQU_VdqUdq(bxInstruction_c *i)
|
||||
|
||||
#if BX_SUPPORT_X86_64
|
||||
if (i->as64L()) { /* 64 bit address mode */
|
||||
rdi = RDI;
|
||||
rdi = RDI;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (i->as32L()) {
|
||||
rdi = EDI;
|
||||
rdi = EDI;
|
||||
}
|
||||
else { /* 16 bit address mode */
|
||||
rdi = DI;
|
||||
rdi = DI;
|
||||
}
|
||||
|
||||
/* implement as read-modify-write for efficiency */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vmexit.cc,v 1.28 2010-07-01 16:31:46 sshwarts Exp $
|
||||
// $Id: vmexit.cc,v 1.29 2010-09-24 21:15:16 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2009-2010 Stanislav Shwartsman
|
||||
@ -190,7 +190,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VMexit_RDTSC(bxInstruction_c *i)
|
||||
|
||||
if (VMEXIT(VMX_VM_EXEC_CTRL2_RDTSC_VMEXIT)) {
|
||||
BX_ERROR(("VMEXIT: RDTSC"));
|
||||
VMexit(i, (i->b1() == 0x31) ? VMX_VMEXIT_RDTSC : VMX_VMEXIT_RDTSCP, 0);
|
||||
VMexit(i, (i->getIaOpcode() == BX_IA_RDTSC) ? VMX_VMEXIT_RDTSC : VMX_VMEXIT_RDTSCP, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -433,43 +433,49 @@ void BX_CPP_AttrRegparmN(3) BX_CPU_C::VMexit_IO(bxInstruction_c *i, unsigned por
|
||||
|
||||
Bit32u qualification = 0;
|
||||
|
||||
switch(i->b1()) {
|
||||
case 0xe4: // IN_ALIb
|
||||
case 0xe5: // IN_AXIb, IN_EAXIb
|
||||
switch(i->getIaOpcode()) {
|
||||
case BX_IA_IN_ALIb:
|
||||
case BX_IA_IN_AXIb:
|
||||
case BX_IA_IN_EAXIb:
|
||||
qualification = VMX_VMEXIT_IO_PORTIN | VMX_VMEXIT_IO_INSTR_IMM;
|
||||
break;
|
||||
|
||||
case 0xe6: // OUT_IbAL
|
||||
case 0xe7: // OUT_IbAX, OUT_IbEAX
|
||||
case BX_IA_OUT_IbAL:
|
||||
case BX_IA_OUT_IbAX:
|
||||
case BX_IA_OUT_IbEAX:
|
||||
qualification = VMX_VMEXIT_IO_INSTR_IMM;
|
||||
break;
|
||||
|
||||
case 0xec: // IN_ALDX
|
||||
case 0xed: // IN_AXDX, IN_EAXDX
|
||||
case BX_IA_IN_ALDX:
|
||||
case BX_IA_IN_AXDX:
|
||||
case BX_IA_IN_EAXDX:
|
||||
qualification = VMX_VMEXIT_IO_PORTIN; // no immediate
|
||||
break;
|
||||
|
||||
case 0xee: // OUT_DXAL
|
||||
case 0xef: // OUT_DXAX, OUT_DXEAX
|
||||
case BX_IA_OUT_DXAL:
|
||||
case BX_IA_OUT_DXAX:
|
||||
case BX_IA_OUT_DXEAX:
|
||||
qualification = 0; // PORTOUT, no immediate
|
||||
break;
|
||||
|
||||
case 0x6c: // INSB_YbDX
|
||||
case 0x6d: // INSW_YwDX, INSD_YdDX
|
||||
case BX_IA_REP_INSB_YbDX:
|
||||
case BX_IA_REP_INSW_YwDX:
|
||||
case BX_IA_REP_INSD_YdDX:
|
||||
qualification = VMX_VMEXIT_IO_PORTIN | VMX_VMEXIT_IO_INSTR_STRING;
|
||||
if (i->repUsedL())
|
||||
qualification |= VMX_VMEXIT_IO_INSTR_REP;
|
||||
break;
|
||||
|
||||
case 0x6e: // OUTSB_DXXb
|
||||
case 0x6f: // OUTSW_DXXw, OUTSD_DXXd
|
||||
case BX_IA_REP_OUTSB_DXXb:
|
||||
case BX_IA_REP_OUTSW_DXXw:
|
||||
case BX_IA_REP_OUTSD_DXXd:
|
||||
qualification = VMX_VMEXIT_IO_INSTR_STRING; // PORTOUT
|
||||
if (i->repUsedL())
|
||||
qualification |= VMX_VMEXIT_IO_INSTR_REP;
|
||||
break;
|
||||
|
||||
default:
|
||||
BX_PANIC(("VMexit_IO: I/O instruction b1()=%x unknown", i->b1()));
|
||||
BX_PANIC(("VMexit_IO: I/O instruction %s unknown", get_bx_opcode_name(i->getIaOpcode())));
|
||||
}
|
||||
|
||||
if (qualification & VMX_VMEXIT_IO_INSTR_STRING) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vmx.cc,v 1.68 2010-04-29 20:03:03 sshwarts Exp $
|
||||
// $Id: vmx.cc,v 1.69 2010-09-24 21:15:16 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2009-2010 Stanislav Shwartsman
|
||||
@ -2754,8 +2754,8 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VMREAD(bxInstruction_c *i)
|
||||
case VMCS_64BIT_GUEST_LINK_POINTER:
|
||||
case VMCS_64BIT_GUEST_IA32_DEBUGCTL:
|
||||
case VMCS_64BIT_GUEST_IA32_PAT:
|
||||
case VMCS_64BIT_GUEST_IA32_EFER:
|
||||
#if BX_SUPPORT_VMX >= 2
|
||||
case VMCS_64BIT_GUEST_IA32_EFER:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE0:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE1:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE2:
|
||||
@ -2767,8 +2767,8 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VMREAD(bxInstruction_c *i)
|
||||
case VMCS_64BIT_GUEST_LINK_POINTER_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_DEBUGCTL_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_PAT_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_EFER_HI:
|
||||
#if BX_SUPPORT_VMX >= 2
|
||||
case VMCS_64BIT_GUEST_IA32_EFER_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE0_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE1_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE2_HI:
|
||||
@ -2780,12 +2780,16 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VMREAD(bxInstruction_c *i)
|
||||
/* VMCS 64-bit host state fields */
|
||||
/* binary 0010_11xx_xxxx_xxx0 */
|
||||
case VMCS_64BIT_HOST_IA32_PAT:
|
||||
#if BX_SUPPORT_VMX >= 2
|
||||
case VMCS_64BIT_HOST_IA32_EFER:
|
||||
#endif
|
||||
field_64 = VMread64(encoding);
|
||||
break;
|
||||
|
||||
case VMCS_64BIT_HOST_IA32_PAT_HI:
|
||||
#if BX_SUPPORT_VMX >= 2
|
||||
case VMCS_64BIT_HOST_IA32_EFER_HI:
|
||||
#endif
|
||||
field_64 = VMread32(encoding);
|
||||
break;
|
||||
|
||||
@ -3066,8 +3070,8 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VMWRITE(bxInstruction_c *i)
|
||||
case VMCS_64BIT_GUEST_LINK_POINTER_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_DEBUGCTL_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_PAT_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_EFER_HI:
|
||||
#if BX_SUPPORT_VMX >= 2
|
||||
case VMCS_64BIT_GUEST_IA32_EFER_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE0_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE1_HI:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE2_HI:
|
||||
@ -3078,7 +3082,9 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VMWRITE(bxInstruction_c *i)
|
||||
/* VMCS 64-bit host state fields */
|
||||
/* binary 0010_11xx_xxxx_xxx0 */
|
||||
case VMCS_64BIT_HOST_IA32_PAT_HI:
|
||||
#if BX_SUPPORT_VMX >= 2
|
||||
case VMCS_64BIT_HOST_IA32_EFER_HI:
|
||||
#endif
|
||||
VMwrite32(encoding, val_32);
|
||||
break;
|
||||
|
||||
@ -3104,8 +3110,8 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VMWRITE(bxInstruction_c *i)
|
||||
case VMCS_64BIT_GUEST_LINK_POINTER:
|
||||
case VMCS_64BIT_GUEST_IA32_DEBUGCTL:
|
||||
case VMCS_64BIT_GUEST_IA32_PAT:
|
||||
case VMCS_64BIT_GUEST_IA32_EFER:
|
||||
#if BX_SUPPORT_VMX >= 2
|
||||
case VMCS_64BIT_GUEST_IA32_EFER:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE0:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE1:
|
||||
case VMCS_64BIT_GUEST_IA32_PDPTE2:
|
||||
@ -3116,7 +3122,9 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::VMWRITE(bxInstruction_c *i)
|
||||
/* VMCS 64-bit host state fields */
|
||||
/* binary 0010_11xx_xxxx_xxx0 */
|
||||
case VMCS_64BIT_HOST_IA32_PAT:
|
||||
#if BX_SUPPORT_VMX >= 2
|
||||
case VMCS_64BIT_HOST_IA32_EFER:
|
||||
#endif
|
||||
// fall through
|
||||
|
||||
/* VMCS natural width control fields */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: xsave.cc,v 1.27 2010-07-01 20:00:33 sshwarts Exp $
|
||||
// $Id: xsave.cc,v 1.28 2010-09-24 21:15:16 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2008-2009 Stanislav Shwartsman
|
||||
@ -141,7 +141,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XSAVE(bxInstruction_c *i)
|
||||
// save XMM8-XMM15 only in 64-bit mode
|
||||
if (index < 8 || long64_mode()) {
|
||||
write_virtual_dqword(i->seg(),
|
||||
eaddr+index*16+160, (Bit8u *) &(BX_CPU_THIS_PTR xmm[index]));
|
||||
eaddr+index*16+160, (Bit8u *)(&BX_READ_XMM_REG(index)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XRSTOR(bxInstruction_c *i)
|
||||
// restore XMM8-XMM15 only in 64-bit mode
|
||||
if (index < 8 || long64_mode()) {
|
||||
read_virtual_dqword(i->seg(),
|
||||
eaddr+index*16+160, (Bit8u *) &(BX_CPU_THIS_PTR xmm[index]));
|
||||
eaddr+index*16+160, (Bit8u *)(&BX_READ_XMM_REG(index)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user