47 #include "fputils/fp80.h"
56 panic(
"getArgument(): Floating point arguments not implemented\n");
57 }
else if (size != 8) {
58 panic(
"getArgument(): Can only handle 64-bit arguments.\n");
63 const int int_reg_map[] = {
64 INTREG_RDI, INTREG_RSI, INTREG_RDX,
67 if (number <
sizeof(int_reg_map) /
sizeof(*int_reg_map)) {
70 panic(
"getArgument(): Don't know how to handle stack arguments.\n");
109 for (
int i = 0;
i < 8;
i++) {
131 for (
int i = 0;
i < 5;
i++) {
141 for (
int i = 0;
i < 4;
i++) {
179 LocalApicBase lApicBase = 0;
180 lApicBase.base = 0xFEE00000 >> 12;
181 lApicBase.enable = 1;
182 lApicBase.bsp = (cpuId == 0);
186 tc->
getCpuPtr()->getInterruptController(0));
253 panic(
"Not implemented for x86\n");
268 return ((ncc_flags | cc_flags | cfof_bits | df_bit) & 0x3F7FD5)
292 for (
int i = 0;
i < 8; ++
i) {
294 const unsigned tag((ftw >> (2 *
i)) & 0x3);
317 for (
int i = 0;
i < 8; ++
i) {
318 const unsigned xtag(((ftwx >>
i) & 0x1));
323 ftw |= 0x3 << (2 *
i);
337 const uint8_t new_top((top + spm + 8) % 8);
341 for (
int i = top;
i != new_top;
i = (
i + 1 + 8) % 8)
342 ftw |= 0x3 << (2 *
i);
343 }
else if (spm < 0) {
347 for (
int i = new_top;
i != top;
i = (
i + 1 + 8) % 8)
348 ftw &= ~(0x3 << (2 *
i));
358 memcpy(fp80.bits, _mem, 10);
360 return fp80_cvtd(fp80);
366 fp80_t fp80 = fp80_cvfd(value);
367 memcpy(_mem, fp80.bits, 10);
void skipFunction(ThreadContext *tc)
uint64_t getRFlags(ThreadContext *tc)
Reconstruct the rflags register from the internal gem5 register state.
static MiscRegIndex MISCREG_PERF_EVT_CTR(int index)
void copyMiscRegs(ThreadContext *src, ThreadContext *dest)
void invoke(ThreadContext *tc, const StaticInstPtr &inst=StaticInst::nullStaticInstPtr)
virtual CCReg readCCReg(int reg_idx)=0
virtual void setFloatRegBitsFlat(int idx, FloatRegBits val)=0
void setRegNoEffect(ApicRegIndex reg, uint32_t val)
virtual uint64_t readIntRegFlat(int idx)=0
Flat register interfaces.
virtual MiscReg readMiscRegNoEffect(int misc_reg) const =0
virtual FloatRegBits readFloatRegBitsFlat(int idx)=0
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
virtual void setMiscReg(int misc_reg, const MiscReg &val)=0
virtual void setIntRegFlat(int idx, uint64_t val)=0
virtual void setIntReg(int reg_idx, uint64_t val)=0
virtual BaseCPU * getCpuPtr()=0
void storeFloat80(void *_mem, double value)
Convert and store a double as an 80-bit float.
virtual TheISA::PCState pcState()=0
static bool isValidMiscReg(int index)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
virtual CCReg readCCRegFlat(int idx)=0
virtual void setCCReg(int reg_idx, CCReg val)=0
virtual uint64_t readIntReg(int reg_idx)=0
virtual TheISA::TLB * getDTBPtr()=0
void copyRegs(ThreadContext *src, ThreadContext *dest)
uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
virtual void suspend()=0
Set the status to Suspended.
uint16_t convX87XTagsToTags(uint8_t ftwx)
Convert an x87 xtag word to normal tags format.
void setRFlags(ThreadContext *tc, uint64_t val)
Set update the rflags register and internal gem5 state.
static MiscRegIndex MISCREG_MTRR_PHYS_BASE(int index)
virtual void activate()=0
Set the status to Active.
const int NumImplicitIntRegs
virtual void setCCRegFlat(int idx, CCReg val)=0
const int NumMicroIntRegs
virtual MiscReg readMiscReg(int misc_reg)=0
void initCPU(ThreadContext *tc, int cpuId)
uint16_t genX87Tags(uint16_t ftw, uint8_t top, int8_t spm)
Generate and updated x87 tag register after a push/pop operation.
uint8_t convX87TagsToXTags(uint16_t ftw)
Convert an x87 tag word to abridged tag format.
static MiscRegIndex MISCREG_MTRR_PHYS_MASK(int index)
static MiscRegIndex MISCREG_PERF_EVT_SEL(int index)
static IntRegIndex INTREG_IMPLICIT(int index)
static MiscRegIndex MISCREG_MC_ADDR(int index)
static IntRegIndex INTREG_MICRO(int index)
static MiscRegIndex MISCREG_MC_CTL(int index)
const uint32_t ccFlagMask
double loadFloat80(const void *_mem)
Load an 80-bit float from memory and convert it to double.
static MiscRegIndex MISCREG_MC_MISC(int index)
static MiscRegIndex MISCREG_MC_STATUS(int index)
virtual void setMiscRegNoEffect(int misc_reg, const MiscReg &val)=0
const FlagsType init
This Stat is Initialized.
virtual TheISA::TLB * getITBPtr()=0
void startupCPU(ThreadContext *tc, int cpuId)