2015-02-06 17:29:30 +01:00
|
|
|
/*
|
2015-08-24 15:35:54 +02:00
|
|
|
* \brief Kernel back-end for execution contexts in userland
|
2015-02-06 17:29:30 +01:00
|
|
|
* \author Martin Stein
|
2015-03-13 09:20:28 +01:00
|
|
|
* \author Reto Buerki
|
2015-02-06 17:29:30 +01:00
|
|
|
* \author Stefan Kalkowski
|
|
|
|
* \date 2013-11-11
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2015-08-24 15:35:54 +02:00
|
|
|
* Copyright (C) 2013-2015 Genode Labs GmbH
|
2015-02-06 17:29:30 +01:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* core includes */
|
|
|
|
#include <kernel/thread.h>
|
|
|
|
#include <kernel/pd.h>
|
|
|
|
|
2015-08-24 16:14:56 +02:00
|
|
|
void Kernel::Thread::_mmu_exception()
|
2015-02-06 17:29:30 +01:00
|
|
|
{
|
2015-02-27 14:20:36 +01:00
|
|
|
_become_inactive(AWAITS_RESUME);
|
2015-03-12 09:21:38 +01:00
|
|
|
_fault_pd = (addr_t)_pd->platform_pd();
|
2015-05-19 14:18:40 +02:00
|
|
|
_fault_signal = (addr_t)_fault.signal_context();
|
2015-03-12 09:21:38 +01:00
|
|
|
_fault_addr = Cpu::Cr2::read();
|
2015-02-27 14:20:36 +01:00
|
|
|
|
base: avoid use of deprecated base/printf.h
Besides adapting the components to the use of base/log.h, the patch
cleans up a few base headers, i.e., it removes unused includes from
root/component.h, specifically base/heap.h and
ram_session/ram_session.h. Hence, components that relied on the implicit
inclusion of those headers have to manually include those headers now.
While adjusting the log messages, I repeatedly stumbled over the problem
that printing char * arguments is ambiguous. It is unclear whether to
print the argument as pointer or null-terminated string. To overcome
this problem, the patch introduces a new type 'Cstring' that allows the
caller to express that the argument should be handled as null-terminated
string. As a nice side effect, with this type in place, the optional len
argument of the 'String' class could be removed. Instead of supplying a
pair of (char const *, size_t), the constructor accepts a 'Cstring'.
This, in turn, clears the way let the 'String' constructor use the new
output mechanism to assemble a string from multiple arguments (and
thereby getting rid of snprintf within Genode in the near future).
To enforce the explicit resolution of the char * ambiguity, the 'char *'
overload of the 'print' function is marked as deleted.
Issue #1987
2016-07-13 19:07:09 +02:00
|
|
|
/*
|
|
|
|
* Core should never raise a page-fault. If this happens, print out an
|
|
|
|
* error message with debug information.
|
2015-02-27 14:20:36 +01:00
|
|
|
*/
|
|
|
|
if (_pd == Kernel::core_pd())
|
base: avoid use of deprecated base/printf.h
Besides adapting the components to the use of base/log.h, the patch
cleans up a few base headers, i.e., it removes unused includes from
root/component.h, specifically base/heap.h and
ram_session/ram_session.h. Hence, components that relied on the implicit
inclusion of those headers have to manually include those headers now.
While adjusting the log messages, I repeatedly stumbled over the problem
that printing char * arguments is ambiguous. It is unclear whether to
print the argument as pointer or null-terminated string. To overcome
this problem, the patch introduces a new type 'Cstring' that allows the
caller to express that the argument should be handled as null-terminated
string. As a nice side effect, with this type in place, the optional len
argument of the 'String' class could be removed. Instead of supplying a
pair of (char const *, size_t), the constructor accepts a 'Cstring'.
This, in turn, clears the way let the 'String' constructor use the new
output mechanism to assemble a string from multiple arguments (and
thereby getting rid of snprintf within Genode in the near future).
To enforce the explicit resolution of the char * ambiguity, the 'char *'
overload of the 'print' function is marked as deleted.
Issue #1987
2016-07-13 19:07:09 +02:00
|
|
|
Genode::error("page fault in core thread (", label(), "): "
|
|
|
|
"ip=", Genode::Hex(ip), " fault=", Genode::Hex(_fault_addr));
|
2015-02-27 14:20:36 +01:00
|
|
|
|
|
|
|
_fault.submit();
|
|
|
|
return;
|
2015-02-06 17:29:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-08-24 16:14:56 +02:00
|
|
|
void Kernel::Thread::_init() { }
|
2015-08-24 15:35:54 +02:00
|
|
|
|
|
|
|
|
2015-08-24 16:14:56 +02:00
|
|
|
void Kernel::Thread::_call_update_pd() { }
|