PCem
view src/x86_ops_msr.h @ 150:871b132c6158
Implemented CR4 register for Winchip. Currently only Time Stamp Disable (TSD) has an effect.
Fixed stupid bug in WRMSR - MSRs can now be written with values other than zero.
| author | TomW |
|---|---|
| date | Sat Aug 23 16:28:16 2014 +0100 |
| parents | 9c201151bb4b |
| children |
line source
1 static int opRDTSC(uint32_t fetchdat)
2 {
3 if (!cpu_hasrdtsc)
4 {
5 pc = oldpc;
6 x86illegal();
7 return 0;
8 }
9 if ((cr4 & CR4_TSD) && CPL)
10 {
11 x86gpf("RDTSC when TSD set and CPL != 0", 0);
12 return 0;
13 }
14 EAX = tsc & 0xffffffff;
15 EDX = tsc >> 32;
16 cycles--;
17 return 0;
18 }
