20 #include "pedigree/kernel/processor/mips32/TlbManager.h" 21 #include "../mips_common/AsidManager.h" 22 #include "VirtualAddressSpace.h" 23 #include "pedigree/kernel/Log.h" 24 #include "pedigree/kernel/debugger/Debugger.h" 25 #include "pedigree/kernel/panic.h" 26 #include "pedigree/kernel/processor/InterruptManager.h" 27 #include "pedigree/kernel/processor/Processor.h" 76 uintptr_t badvaddr = state.m_BadVAddr;
77 uintptr_t chunkIdx = (badvaddr >> 12) & 0x7FF;
80 if ((badvaddr < 0xC0000000) || (badvaddr >= 0xC0800000))
85 str +=
"Page fault (";
86 str.append(badvaddr, 16);
94 uintptr_t chunkSelect = chunkIdx & 0x1;
105 "BadVaddr: " <<
Hex << badvaddr <<
", chunkIdx: " << chunkIdx
106 <<
", phys1: " << phys1 <<
", phys2: " << phys2);
108 if ((phys1 == 0 && chunkSelect == 0) || (phys2 == 0 && chunkSelect == 1))
119 uintptr_t curEntryHi;
120 CP0_READ_ENTRYHI(curEntryHi);
122 NOTICE(
"CurEntryHi: " <<
Hex << curEntryHi);
128 uintptr_t entryHi = (badvaddr & ~0x1FFF) | (curEntryHi & 0xFF);
131 uintptr_t entryLo0 = phys1;
135 entryLo0 |= MIPS32_PTE_VALID | MIPS32_PTE_CACHED | MIPS32_PTE_DIRTY;
139 uintptr_t entryLo1 = phys2;
143 entryLo1 |= MIPS32_PTE_VALID | MIPS32_PTE_CACHED | MIPS32_PTE_DIRTY;
147 writeTlb(entryHi, entryLo0, entryLo1);
virtual bool registerInterruptHandler(size_t nInterruptNumber, InterruptHandler *pHandler)=0
static void writeWired(uintptr_t wired)
void interrupt(size_t interruptNumber, InterruptState &state)
static Debugger & instance()
static EXPORTED_PUBLIC VirtualAddressSpace & getKernelAddressSpace()
static MIPS32TlbManager m_Instance
static void writePageMask(uintptr_t pageMask)
void start(InterruptState &state, LargeStaticString &description)
static void flush(uintptr_t numEntries)
static void writeTlb(uintptr_t entryHi, uintptr_t entryLo0, uintptr_t entryLo1)
static uintptr_t getNumEntries()
static void writeContext(uintptr_t context)
static MIPS32TlbManager & instance()
void EXPORTED_PUBLIC panic(const char *msg) NORETURN
static InterruptManager & instance()
uintptr_t getPageTableChunk(uintptr_t chunkIdx)