20 #include "pedigree/kernel/processor/Processor.h" 21 #include "pedigree/kernel/Log.h" 29 size_t nBpNumber, DebugFlags::FaultType &nFaultType,
size_t &nLength,
34 ERROR(
"Breakpoint out of bounds.");
40 asm volatile(
"mfc0 %0, $18; nop" :
"=r"(watchLo));
42 switch (watchLo & 0x3)
46 nFaultType = DebugFlags::DataReadWrite;
50 nFaultType = DebugFlags::DataWrite;
54 nFaultType = DebugFlags::DataReadWrite;
58 nFaultType = DebugFlags::DataReadWrite;
62 return watchLo & 0xFFFFFFFC;
66 size_t nBpNumber, uintptr_t nLinearAddress,
67 DebugFlags::FaultType nFaultType,
size_t nLength)
71 ERROR(
"Breakpoint out of bounds.");
76 nLinearAddress &= ~0xc0000000;
78 if (nFaultType == DebugFlags::DataWrite)
79 nLinearAddress |= 0x1;
81 nLinearAddress |= 0x3;
83 asm volatile(
"mtc0 %0, $18; nop" : :
"r"(nLinearAddress));
90 ERROR(
"Breakpoint out of bounds.");
95 asm volatile(
"mtc0 %0, $18; nop" : :
"r"(watchLo));
101 asm volatile(
"mfc0 %0, $12;nop" :
"=r"(sr));
106 asm volatile(
"mtc0 %0, $12;nop" : :
"r"(sr));
112 ERROR(
"Single step unavailable on MIPS.");
115 void Processor::invalidateICache(uintptr_t nAddr)
117 asm volatile(
"cache 0x10, 0(%0)" : :
"r"(nAddr));
120 void Processor::invalidateDCache(uintptr_t nAddr)
122 asm volatile(
"cache 0x11, 0(%0)" : :
"r"(nAddr));
static uintptr_t getDebugBreakpoint(size_t nBpNumber, DebugFlags::FaultType &nFaultType, size_t &nLength, bool &bEnabled)
static void enableDebugBreakpoint(size_t nBpNumber, uintptr_t nLinearAddress, DebugFlags::FaultType nFaultType, size_t nLength)
static void setSingleStep(bool bEnable, InterruptState &state)
static void disableDebugBreakpoint(size_t nBpNumber)
static void setInterrupts(bool bEnable)
static size_t getDebugBreakpointCount()