From 466ad3aed48478119aae10403068ae4cb962eaae Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 27 Feb 2015 14:20:36 +0100 Subject: [PATCH] hw_x86_64: Implement Thread::_mmu_exception() for x86_64 The function is a copy of the ARM version minus the in_fault distinction. --- .../src/core/spec/x86_64/kernel/thread_base.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/repos/base-hw/src/core/spec/x86_64/kernel/thread_base.cc b/repos/base-hw/src/core/spec/x86_64/kernel/thread_base.cc index 677a2b8d6..f2bc3af0b 100644 --- a/repos/base-hw/src/core/spec/x86_64/kernel/thread_base.cc +++ b/repos/base-hw/src/core/spec/x86_64/kernel/thread_base.cc @@ -63,7 +63,20 @@ Thread_event Thread::* Thread::_event(unsigned const id) const void Thread::_mmu_exception() { - PDBG("not implemented"); + _become_inactive(AWAITS_RESUME); + _fault_pd = (addr_t)_pd->platform_pd(); + _fault_signal = _fault.signal_context_id(); + + /** + * core should never raise a page-fault, + * if this happens print out an error message with debug information + */ + if (_pd == Kernel::core_pd()) + PERR("Pagefault in core thread (%s): ip=%p fault=%p", + label(), (void*)ip, (void*)_fault_addr); + + _fault.submit(); + return; }