MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / PageFaultHandler

Function PageFaultHandler

src/arch/riscv64/interrupt_main.cpp:53–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53auto PageFaultHandler(uint64_t exception_code, cpu_io::TrapContext* context)
54 -> uint64_t {
55 auto addr = cpu_io::Stval::Read();
56 klog::Err("PageFault: {}({:#x}), addr: {:#x}",
57 cpu_io::ScauseInfo::kExceptionNames[exception_code], exception_code,
58 addr);
59 klog::Err("sepc: {:#x}", context->sepc);
60 DumpStack();
61 while (true) {
62 cpu_io::Pause();
63 }
64 return 0;
65}
66
67// 系统调用处理
68auto SyscallHandler(uint64_t /*cause*/, cpu_io::TrapContext* context)

Callers

nothing calls this directly

Calls 4

ReadFunction · 0.85
ErrFunction · 0.85
PauseFunction · 0.85
DumpStackFunction · 0.70

Tested by

no test coverage detected