summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/i386/pentops.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/i386/pentops.hxx')
-rw-r--r--src/devices/cpu/i386/pentops.hxx22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/devices/cpu/i386/pentops.hxx b/src/devices/cpu/i386/pentops.hxx
index ee67c5ca050..d5f6f6ca592 100644
--- a/src/devices/cpu/i386/pentops.hxx
+++ b/src/devices/cpu/i386/pentops.hxx
@@ -56,14 +56,17 @@ void i386_device::WRITEXMM_HI64(uint32_t ea,i386_device::XMM_REG &r)
void i386_device::pentium_rdmsr() // Opcode 0x0f 32
{
uint64_t data;
- uint8_t valid_msr = 0;
+ bool valid_msr = false;
- data = MSR_READ(REG32(ECX),&valid_msr);
- REG32(EDX) = data >> 32;
- REG32(EAX) = data & 0xffffffff;
-
- if(m_CPL != 0 || valid_msr == 0) // if current privilege level isn't 0 or the register isn't recognized ...
- FAULT(FAULT_GP,0) // ... throw a general exception fault
+ // call the model specific implementation
+ data = opcode_rdmsr(valid_msr);
+ if (m_CPL != 0 || valid_msr == false) // if current privilege level isn't 0 or the register isn't recognized ...
+ FAULT(FAULT_GP, 0) // ... throw a general exception fault
+ else
+ {
+ REG32(EDX) = data >> 32;
+ REG32(EAX) = data & 0xffffffff;
+ }
CYCLES(CYCLES_RDMSR);
}
@@ -71,12 +74,13 @@ void i386_device::pentium_rdmsr() // Opcode 0x0f 32
void i386_device::pentium_wrmsr() // Opcode 0x0f 30
{
uint64_t data;
- uint8_t valid_msr = 0;
+ bool valid_msr = false;
data = (uint64_t)REG32(EAX);
data |= (uint64_t)(REG32(EDX)) << 32;
- MSR_WRITE(REG32(ECX),data,&valid_msr);
+ // call the model specific implementation
+ opcode_wrmsr(data, valid_msr);
if(m_CPL != 0 || valid_msr == 0) // if current privilege level isn't 0 or the register isn't recognized
FAULT(FAULT_GP,0) // ... throw a general exception fault