genode/repos/base-hw/src/core/spec/x86_64/kernel/thread.cc
Martin Stein 91cb3decdb hw_x86_64: move Cpu_context stuff to extra unit
Other platforms implement Kernel::Cpu_context stuff in
kernel/cpu_context.cc. On x86_64, it was implemented in
kernel/thread.cc. The commit fixes this inconsistency to the other
platforms.

Ref #1652
2015-09-09 15:14:27 +02:00

44 lines
1004 B
C++

/*
* \brief Kernel back-end for execution contexts in userland
* \author Martin Stein
* \author Reto Buerki
* \author Stefan Kalkowski
* \date 2013-11-11
*/
/*
* Copyright (C) 2013-2015 Genode Labs GmbH
*
* 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>
void Kernel::Thread::_mmu_exception()
{
_become_inactive(AWAITS_RESUME);
_fault_pd = (addr_t)_pd->platform_pd();
_fault_signal = (addr_t)_fault.signal_context();
_fault_addr = Cpu::Cr2::read();
/**
* 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;
}
void Kernel::Thread::_init() { }
void Kernel::Thread::_call_update_pd() { }