43#include "arch/x86/generated/decoder.hh"
51#include "debug/Faults.hh"
71 using namespace X86ISAInst::rom_labels;
74 if (m5reg.mode == LongMode) {
75 entry = extern_label_longModeInterrupt;
78 entry = extern_label_realModeInterrupt;
80 entry = extern_label_legacyModeInterrupt;
86 if (m5reg.mode == LongMode) {
87 entry = extern_label_longModeInterruptWithError;
89 panic(
"Legacy mode interrupts with error codes "
90 "aren't implemented.");
102 std::stringstream
ss;
121 panic(
"Abort exception!");
131 panic(
"Unrecognized/invalid instruction executed:\n %s",
148 if (m5reg.mode == LongMode)
154 const char *modeStr =
"";
164 panic(
"Tried to %s unmapped address %#x.", modeStr,
addr);
166 panic(
"Tried to %s unmapped address %#x.\nPC: %#x, Instr: %s",
177 std::stringstream
ss;
185 DPRINTF(Faults,
"Init interrupt.\n");
204 SegAttr dataAttr = 0;
206 dataAttr.unusable = 0;
207 dataAttr.defaultSize = 0;
208 dataAttr.longMode = 0;
210 dataAttr.granularity = 0;
211 dataAttr.present = 1;
213 dataAttr.writable = 1;
214 dataAttr.readable = 1;
215 dataAttr.expandDown = 0;
226 SegAttr codeAttr = 0;
228 codeAttr.unusable = 0;
229 codeAttr.defaultSize = 0;
230 codeAttr.longMode = 0;
232 codeAttr.granularity = 0;
233 codeAttr.present = 1;
235 codeAttr.writable = 0;
236 codeAttr.readable = 1;
237 codeAttr.expandDown = 0;
257 tslAttr.unusable = 1;
294 MicroPC entry = X86ISAInst::rom_labels::extern_label_initIntHalt;
303 DPRINTF(Faults,
"Startup interrupt with vector %#x.\n",
vector);
305 if (m5Reg.mode != LegacyMode || m5Reg.submode !=
RealMode) {
306 panic(
"Startup IPI recived outside of real mode. "
307 "Don't know what to do. %d, %d", m5Reg.mode, m5Reg.submode);
void demapPage(Addr vaddr, uint64_t asn)
virtual void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr)
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
bool fixupFault(Addr vaddr)
Attempt to fix up a fault at vaddr by allocating a page on the stack.
T * get() const
Directly access the pointer itself without taking a reference.
virtual const std::string & disassemble(Addr pc, const loader::SymbolTable *symtab=nullptr) const
Return string representation of disassembled instruction.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal readMiscReg(RegIndex misc_reg)=0
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
virtual void setReg(const RegId ®, RegVal val)
virtual const PCStateBase & pcState() const =0
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
virtual BaseMMU * getMMUPtr()=0
virtual Process * getProcessPtr()=0
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr)
virtual std::string describe() const
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
virtual const char * mnemonic() const
virtual std::string describe() const
Base class for all X86 static instructions.
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
#define panic(...)
This implements a cprintf based panic() function.
static RegIndex segSel(int index)
static RegIndex segAttr(int index)
static RegIndex segBase(int index)
static RegIndex segLimit(int index)
static RegIndex segEffBase(int index)
static constexpr RegId intRegMicro(int index)
constexpr RegClass intRegClass
SymbolTable debugSymbolTable
Global unified debugging symbol table (for target).
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
static MicroPC romMicroPC(MicroPC upc)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
void ccprintf(cp::Print &print)