19 const uintptr_t address = state.far;
20 const uintptr_t page = address & ~(PAGE_SIZE - 1);
21 const size_t faultStatus = state.esr & 0x3f;
22 const size_t exceptionClass = (state.esr >> 26) & 0x3f;
23 const bool fetch = exceptionClass == 0x20 || exceptionClass == 0x21;
24 const bool write = !fetch && (state.esr & (1U << 6));
25 const bool present = (faultStatus & 0x3c) == 0x0c;
27 if (present && write &&
31 if (dispatchHandlers(state, address, write, present)) {
36 if (thread && !state.kernelMode()) {
38 if (process && process->getSubsystem()) {
39 const uintptr_t errorCode = (present ? 1 : 0) | (write ? 2 : 0) | 4 | (fetch ? 16 : 0);
45 ERROR(
"ARM64: page fault at " <<
Hex << address <<
" PC " << state.pc <<
" ESR " << state.esr);
46 panic(
"ARM64: unrecoverable page fault");
static EXPORTED_PUBLIC PageFaultHandler m_Instance
virtual void interrupt(size_t interruptNumber, InterruptState &state)