0x4400: wmb({{ }}, IsWriteBarrier, MemWriteOp);
}
- 0xe000: decode FullSystem {
+ 0xe000: decode FullSystemInt {
0: FailUnimpl::rc_se();
default: BasicOperate::rc({{
Ra = IntrFlag;
IntrFlag = 0;
}}, IsNonSpeculative, IsUnverifiable);
}
- 0xf000: decode FullSystem {
+ 0xf000: decode FullSystemInt {
0: FailUnimpl::rs_se();
default: BasicOperate::rs({{
Ra = IntrFlag;
}
}
- 0x00: decode FullSystem {
+ 0x00: decode FullSystemInt {
0: decode PALFUNC {
format EmulatedCallPal {
0x00: halt ({{
format BasicOp {
0x2: movz({{ Rd = (Rt == 0) ? Rs : Rd; }});
0x3: movn({{ Rd = (Rt != 0) ? Rs : Rd; }});
- 0x4: decode FullSystem {
+ 0x4: decode FullSystemInt {
0: syscall_se({{ xc->syscall(R2); }},
IsSerializeAfter, IsNonSpeculative);
default: syscall({{ fault = new SystemCallFault(); }});
}
}
0x3: decode OP default FailUnimpl::rdhwr() {
- 0x0: decode FullSystem {
+ 0x0: decode FullSystemInt {
0: decode RD {
29: BasicOp::rdhwr_se({{ Rt = TpValue; }});
}
default: Inst::RET_FAR();
}
0x4: int3();
- 0x5: decode FullSystem default int_Ib() {
+ 0x5: decode FullSystemInt default int_Ib() {
0: decode IMMEDIATE {
// Really only the LSB matters, but the predecoder
// will sign extend it, and there's no easy way to
default: Inst::UD2();
}
}
- 0x05: decode FullSystem {
+ 0x05: decode FullSystemInt {
0: SyscallInst::syscall('xc->syscall(Rax)',
IsSyscall, IsNonSpeculative, IsSerializeAfter);
default: decode MODE_MODE {
0x1: Inst::RDTSC();
0x2: Inst::RDMSR();
0x3: rdpmc();
- 0x4: decode FullSystem {
+ 0x4: decode FullSystemInt {
0: SyscallInst::sysenter('xc->syscall(Rax)',
IsSyscall, IsNonSpeculative, IsSerializeAfter);
default: sysenter();
#include "sim/full_system.hh"
#include "sim/insttracer.hh"
-class BaseCPUParams;
+struct BaseCPUParams;
class BranchPred;
class CheckerCPU;
class ThreadContext;
#ifndef __SIM_FULL_SYSTEM_HH__
#define __SIM_FULL_SYSTEM_HH__
+/**
+ * The FullSystem variable can be used to determine the current mode
+ * of simulation.
+ */
extern bool FullSystem;
+/**
+ * In addition to the boolean flag we make use of an unsigned int
+ * since the CPU instruction decoder makes use of the variable in
+ * switch statements. A value of 0 signifies syscall emulation, and
+ * any other value full system.
+ */
+extern unsigned int FullSystemInt;
+
#endif // __SIM_FULL_SYSTEM_HH__
}
bool FullSystem;
+unsigned int FullSystemInt;
Root *
RootParams::create()
created = true;
FullSystem = full_system;
+ FullSystemInt = full_system ? 1 : 0;
return new Root(this);
}