From d452f37c257d3c40778f6f6568fc3f122e233ea2 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Thu, 20 Nov 2014 15:25:08 +0100 Subject: [PATCH] hw: print page faults of core (fix #1286) --- repos/base-hw/src/core/spec/arm/kernel/thread_base.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/repos/base-hw/src/core/spec/arm/kernel/thread_base.cc b/repos/base-hw/src/core/spec/arm/kernel/thread_base.cc index 4551db55c..15656325f 100644 --- a/repos/base-hw/src/core/spec/arm/kernel/thread_base.cc +++ b/repos/base-hw/src/core/spec/arm/kernel/thread_base.cc @@ -15,6 +15,7 @@ /* core includes */ #include #include +#include using namespace Kernel; @@ -82,6 +83,15 @@ void Thread::_mmu_exception() if (in_fault(_fault_addr, _fault_writes)) { _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; }