From 91cb3decdb5f832fcd837849c3ae8902c3a6577e Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Mon, 24 Aug 2015 16:14:56 +0200 Subject: [PATCH] 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 --- repos/base-hw/lib/mk/x86_64/core.inc | 1 + .../core/spec/x86_64/kernel/cpu_context.cc | 25 ++++++++++++++++ .../src/core/spec/x86_64/kernel/thread.cc | 29 ++----------------- 3 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 repos/base-hw/src/core/spec/x86_64/kernel/cpu_context.cc diff --git a/repos/base-hw/lib/mk/x86_64/core.inc b/repos/base-hw/lib/mk/x86_64/core.inc index d6ed7481a..77370fc75 100644 --- a/repos/base-hw/lib/mk/x86_64/core.inc +++ b/repos/base-hw/lib/mk/x86_64/core.inc @@ -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 diff --git a/repos/base-hw/src/core/spec/x86_64/kernel/cpu_context.cc b/repos/base-hw/src/core/spec/x86_64/kernel/cpu_context.cc new file mode 100644 index 000000000..6737bf9d3 --- /dev/null +++ b/repos/base-hw/src/core/spec/x86_64/kernel/cpu_context.cc @@ -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 + +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; +} diff --git a/repos/base-hw/src/core/spec/x86_64/kernel/thread.cc b/repos/base-hw/src/core/spec/x86_64/kernel/thread.cc index 8b20add08..07fa8e359 100644 --- a/repos/base-hw/src/core/spec/x86_64/kernel/thread.cc +++ b/repos/base-hw/src/core/spec/x86_64/kernel/thread.cc @@ -16,16 +16,8 @@ /* core includes */ #include #include -#include -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() { }