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
This commit is contained in:
Martin Stein 2015-08-24 16:14:56 +02:00 committed by Christian Helmuth
parent 4e98a0f64a
commit 91cb3decdb
3 changed files with 29 additions and 26 deletions

View File

@ -17,6 +17,7 @@ SRC_S += spec/x86_64/crt0.s
SRC_CC += spec/x86_64/kernel/thread.cc
SRC_CC += spec/x86_64/idt.cc
SRC_CC += spec/x86_64/tss.cc
SRC_CC += spec/x86_64/kernel/cpu_context.cc
# include less specific configuration
include $(REP_DIR)/lib/mk/x86/core.inc

View File

@ -0,0 +1,25 @@
/*
* \brief Kernel cpu context specific implementation
* \author Stefan Kalkowski
* \date 2015-02-11
*/
/*
* Copyright (C) 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/cpu.h>
void Kernel::Cpu_context::_init(size_t const stack_size, addr_t const table)
{
/*
* The stack pointer already contains the stack base address
* of all CPU's kernel stacks, on this uni-processor platform
* it is sufficient to increase it by the stack's size
*/
sp = sp + stack_size;
}

View File

@ -16,16 +16,8 @@
/* core includes */
#include <kernel/thread.h>
#include <kernel/pd.h>
#include <kernel/kernel.h>
using namespace Kernel;
/********************
** Kernel::Thread **
********************/
void Thread::_mmu_exception()
void Kernel::Thread::_mmu_exception()
{
_become_inactive(AWAITS_RESUME);
_fault_pd = (addr_t)_pd->platform_pd();
@ -45,22 +37,7 @@ void Thread::_mmu_exception()
}
void Thread::_init() { }
void Kernel::Thread::_init() { }
void Thread::_call_update_pd() { }
/*************************
** Kernel::Cpu_context **
*************************/
void Kernel::Cpu_context::_init(size_t const stack_size, addr_t const table)
{
/*
* the stack pointer already contains the stack base address
* of all CPU's kernel stacks, on this uni-processor platform
* it is sufficient to increase it by the stack's size
*/
sp = sp + stack_size;
}
void Kernel::Thread::_call_update_pd() { }