From 84331ac0f7b439975035e70f2b872192ac55abd7 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Thu, 5 Oct 2017 11:49:57 +0200 Subject: [PATCH] hw: remove obsolete Kernel::Cpu_context Due to the changes when fixing issue #2091 the Kernel::Cpu_context became superfluent and is not used anymore. Fix #2538 --- repos/base-hw/lib/mk/spec/arm_v6/core-hw.inc | 1 - repos/base-hw/lib/mk/spec/arndale/core-hw.mk | 1 - .../lib/mk/spec/cortex_a15/core-hw.inc | 1 - .../base-hw/lib/mk/spec/cortex_a8/core-hw.inc | 1 - .../base-hw/lib/mk/spec/cortex_a9/core-hw.inc | 3 +- .../base-hw/lib/mk/spec/imx53_qsb/core-hw.mk | 2 +- repos/base-hw/lib/mk/spec/muen/core-hw.mk | 1 - .../base-hw/lib/mk/spec/odroid_xu/core-hw.mk | 1 - repos/base-hw/lib/mk/spec/riscv/core-hw.mk | 1 - repos/base-hw/lib/mk/spec/rpi/core-hw.mk | 2 +- .../base-hw/lib/mk/spec/usb_armory/core-hw.mk | 2 +- repos/base-hw/lib/mk/spec/x86_pc/core-hw.mk | 1 - repos/base-hw/src/core/kernel/cpu.cc | 16 ----------- repos/base-hw/src/core/kernel/cpu.h | 27 ------------------ .../core/spec/arm/{cpu_context.cc => cpu.cc} | 0 ..._context_trustzone.cc => cpu_trustzone.cc} | 0 .../src/core/spec/arm/kernel/cpu_context.cc | 24 ---------------- .../virtualization/kernel/cpu_context.cc | 26 ----------------- .../src/core/spec/riscv/kernel/cpu_context.cc | 28 ------------------- .../core/spec/x86_64/kernel/cpu_context.cc | 27 ------------------ 20 files changed, 4 insertions(+), 161 deletions(-) rename repos/base-hw/src/core/spec/arm/{cpu_context.cc => cpu.cc} (100%) rename repos/base-hw/src/core/spec/arm/{cpu_context_trustzone.cc => cpu_trustzone.cc} (100%) delete mode 100644 repos/base-hw/src/core/spec/arm/kernel/cpu_context.cc delete mode 100644 repos/base-hw/src/core/spec/arm_v7/virtualization/kernel/cpu_context.cc delete mode 100644 repos/base-hw/src/core/spec/riscv/kernel/cpu_context.cc delete mode 100644 repos/base-hw/src/core/spec/x86_64/kernel/cpu_context.cc diff --git a/repos/base-hw/lib/mk/spec/arm_v6/core-hw.inc b/repos/base-hw/lib/mk/spec/arm_v6/core-hw.inc index 7c5901af8..a6c3ad887 100644 --- a/repos/base-hw/lib/mk/spec/arm_v6/core-hw.inc +++ b/repos/base-hw/lib/mk/spec/arm_v6/core-hw.inc @@ -11,7 +11,6 @@ INC_DIR += $(BASE_DIR)/../base-hw/src/core/spec/arm_v6 # add C++ sources SRC_CC += spec/arm_v6/cpu.cc SRC_CC += spec/arm_v6/perf_counter.cc -SRC_CC += spec/arm/kernel/cpu_context.cc SRC_CC += spec/arm/kernel/cpu.cc SRC_CC += spec/arm/kernel/thread_update_pd.cc SRC_CC += kernel/vm_thread_off.cc diff --git a/repos/base-hw/lib/mk/spec/arndale/core-hw.mk b/repos/base-hw/lib/mk/spec/arndale/core-hw.mk index 014407ccb..f1b3b2cdb 100644 --- a/repos/base-hw/lib/mk/spec/arndale/core-hw.mk +++ b/repos/base-hw/lib/mk/spec/arndale/core-hw.mk @@ -13,7 +13,6 @@ SRC_CC += spec/arm_gic/pic.cc SRC_CC += spec/arndale/platform_services.cc SRC_CC += kernel/vm_thread_on.cc SRC_CC += spec/arm_v7/virtualization/kernel/vm.cc -SRC_CC += spec/arm_v7/virtualization/kernel/cpu_context.cc SRC_CC += spec/arm_v7/vm_session_component.cc SRC_CC += spec/arm_v7/virtualization/vm_session_component.cc diff --git a/repos/base-hw/lib/mk/spec/cortex_a15/core-hw.inc b/repos/base-hw/lib/mk/spec/cortex_a15/core-hw.inc index 59f542402..0fe9f92e4 100644 --- a/repos/base-hw/lib/mk/spec/cortex_a15/core-hw.inc +++ b/repos/base-hw/lib/mk/spec/cortex_a15/core-hw.inc @@ -12,7 +12,6 @@ INC_DIR += $(BASE_DIR)/../base-hw/src/core/spec/arm_gic SRC_CC += spec/cortex_a15/kernel/cpu.cc SRC_CC += spec/arm/smp/kernel/thread_update_pd.cc SRC_CC += spec/arm/smp/kernel/cpu.cc -SRC_CC += spec/arm/cpu_context.cc # include less specific configuration include $(BASE_DIR)/../base-hw/lib/mk/spec/smp/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/cortex_a8/core-hw.inc b/repos/base-hw/lib/mk/spec/cortex_a8/core-hw.inc index 615934f3e..5bccf8caa 100644 --- a/repos/base-hw/lib/mk/spec/cortex_a8/core-hw.inc +++ b/repos/base-hw/lib/mk/spec/cortex_a8/core-hw.inc @@ -9,7 +9,6 @@ INC_DIR += $(BASE_DIR)/../base-hw/src/core/spec/cortex_a8 # add C++ sources SRC_CC += spec/cortex_a8/cpu.cc -SRC_CC += spec/arm/kernel/cpu_context.cc SRC_CC += spec/arm/kernel/cpu.cc SRC_CC += spec/arm/kernel/thread_update_pd.cc SRC_CC += kernel/kernel.cc diff --git a/repos/base-hw/lib/mk/spec/cortex_a9/core-hw.inc b/repos/base-hw/lib/mk/spec/cortex_a9/core-hw.inc index b3917e601..87d5a1f76 100644 --- a/repos/base-hw/lib/mk/spec/cortex_a9/core-hw.inc +++ b/repos/base-hw/lib/mk/spec/cortex_a9/core-hw.inc @@ -13,10 +13,9 @@ SRC_CC += spec/cortex_a9/kernel/cpu.cc SRC_CC += spec/cortex_a9/fpu.cc SRC_CC += spec/cortex_a9/board.cc SRC_CC += spec/cortex_a9/timer.cc -SRC_CC += spec/arm/cpu_context.cc +SRC_CC += spec/arm/cpu.cc SRC_CC += spec/arm/smp/kernel/thread_update_pd.cc SRC_CC += spec/arm/smp/kernel/cpu.cc -SRC_CC += spec/arm/kernel/cpu_context.cc SRC_CC += spec/arm_gic/pic.cc SRC_CC += kernel/vm_thread_off.cc diff --git a/repos/base-hw/lib/mk/spec/imx53_qsb/core-hw.mk b/repos/base-hw/lib/mk/spec/imx53_qsb/core-hw.mk index 978904391..fc280493d 100644 --- a/repos/base-hw/lib/mk/spec/imx53_qsb/core-hw.mk +++ b/repos/base-hw/lib/mk/spec/imx53_qsb/core-hw.mk @@ -11,7 +11,7 @@ INC_DIR += $(REP_DIR)/src/core/spec/imx53 SRC_CC += spec/imx53/pic.cc SRC_CC += spec/imx53/timer.cc -SRC_CC += spec/arm/cpu_context_trustzone.cc +SRC_CC += spec/arm/cpu_trustzone.cc ifneq ($(filter-out $(SPECS),trustzone),) SRC_CC += kernel/vm_thread_off.cc diff --git a/repos/base-hw/lib/mk/spec/muen/core-hw.mk b/repos/base-hw/lib/mk/spec/muen/core-hw.mk index e89c96ad3..25b9ddafe 100644 --- a/repos/base-hw/lib/mk/spec/muen/core-hw.mk +++ b/repos/base-hw/lib/mk/spec/muen/core-hw.mk @@ -34,7 +34,6 @@ SRC_CC += spec/x86_64/bios_data_area.cc SRC_CC += spec/x86_64/cpu.cc SRC_CC += spec/x86_64/fpu.cc SRC_CC += spec/x86_64/kernel/cpu.cc -SRC_CC += spec/x86_64/kernel/cpu_context.cc SRC_CC += spec/x86_64/kernel/pd.cc SRC_CC += spec/x86_64/kernel/thread.cc SRC_CC += spec/x86_64/kernel/thread.cc diff --git a/repos/base-hw/lib/mk/spec/odroid_xu/core-hw.mk b/repos/base-hw/lib/mk/spec/odroid_xu/core-hw.mk index 3dab9b210..3cb7739e3 100644 --- a/repos/base-hw/lib/mk/spec/odroid_xu/core-hw.mk +++ b/repos/base-hw/lib/mk/spec/odroid_xu/core-hw.mk @@ -8,7 +8,6 @@ INC_DIR += $(REP_DIR)/src/core/spec/odroid_xu # add C++ sources -SRC_CC += spec/arm/kernel/cpu_context.cc SRC_CC += spec/arm_gic/pic.cc SRC_CC += kernel/vm_thread_off.cc SRC_CC += platform_services.cc diff --git a/repos/base-hw/lib/mk/spec/riscv/core-hw.mk b/repos/base-hw/lib/mk/spec/riscv/core-hw.mk index bba7102cc..c34e512d0 100644 --- a/repos/base-hw/lib/mk/spec/riscv/core-hw.mk +++ b/repos/base-hw/lib/mk/spec/riscv/core-hw.mk @@ -5,7 +5,6 @@ CC_OPT += -fno-delete-null-pointer-checks # add C++ sources SRC_CC += platform_services.cc SRC_CC += kernel/vm_thread_off.cc kernel/kernel.cc -SRC_CC += spec/riscv/kernel/cpu_context.cc SRC_CC += spec/riscv/kernel/thread.cc SRC_CC += spec/riscv/kernel/pd.cc SRC_CC += spec/riscv/kernel/cpu.cc diff --git a/repos/base-hw/lib/mk/spec/rpi/core-hw.mk b/repos/base-hw/lib/mk/spec/rpi/core-hw.mk index ef12aab5e..825a33115 100644 --- a/repos/base-hw/lib/mk/spec/rpi/core-hw.mk +++ b/repos/base-hw/lib/mk/spec/rpi/core-hw.mk @@ -9,7 +9,7 @@ INC_DIR += $(REP_DIR)/src/core/spec/rpi # add C++ sources SRC_CC += platform_services.cc -SRC_CC += spec/arm/cpu_context.cc +SRC_CC += spec/arm/cpu.cc SRC_CC += spec/rpi/timer.cc SRC_CC += spec/rpi/pic.cc diff --git a/repos/base-hw/lib/mk/spec/usb_armory/core-hw.mk b/repos/base-hw/lib/mk/spec/usb_armory/core-hw.mk index b180addbd..ebf3b1bf2 100644 --- a/repos/base-hw/lib/mk/spec/usb_armory/core-hw.mk +++ b/repos/base-hw/lib/mk/spec/usb_armory/core-hw.mk @@ -18,7 +18,7 @@ SRC_CC += spec/arm_v7/vm_session_component.cc SRC_CC += spec/arm_v7/trustzone/vm_session_component.cc SRC_CC += spec/imx53/pic.cc SRC_CC += spec/imx53/timer.cc -SRC_CC += spec/arm/cpu_context_trustzone.cc +SRC_CC += spec/arm/cpu_trustzone.cc # add assembly sources SRC_S += spec/arm_v7/trustzone/exception_vector.s diff --git a/repos/base-hw/lib/mk/spec/x86_pc/core-hw.mk b/repos/base-hw/lib/mk/spec/x86_pc/core-hw.mk index e30600ad2..760a4cb0a 100644 --- a/repos/base-hw/lib/mk/spec/x86_pc/core-hw.mk +++ b/repos/base-hw/lib/mk/spec/x86_pc/core-hw.mk @@ -28,7 +28,6 @@ SRC_CC += spec/x86_64/bios_data_area.cc SRC_CC += spec/x86_64/cpu.cc SRC_CC += spec/x86_64/fpu.cc SRC_CC += spec/x86_64/kernel/cpu.cc -SRC_CC += spec/x86_64/kernel/cpu_context.cc SRC_CC += spec/x86_64/kernel/pd.cc SRC_CC += spec/x86_64/kernel/thread.cc SRC_CC += spec/x86_64/kernel/thread.cc diff --git a/repos/base-hw/src/core/kernel/cpu.cc b/repos/base-hw/src/core/kernel/cpu.cc index c1c86792b..959aff4da 100644 --- a/repos/base-hw/src/core/kernel/cpu.cc +++ b/repos/base-hw/src/core/kernel/cpu.cc @@ -218,10 +218,6 @@ Cpu_domain_update::Cpu_domain_update() { for (unsigned i = 0; i < NR_OF_CPUS; i++) { _pending[i] = false; } } -/***************** - ** Cpu_context ** - *****************/ - /** * FIXME THIS IS ONLY USED BY IDLE THREAD * Enable kernel-entry assembly to get an exclusive stack for every CPU @@ -239,15 +235,3 @@ Cpu_domain_update::Cpu_domain_update() { Genode::size_t kernel_stack_size = Cpu::KERNEL_STACK_SIZE; Genode::uint8_t kernel_stack[NR_OF_CPUS][Cpu::KERNEL_STACK_SIZE] __attribute__((aligned(Genode::get_page_size()))); - -Cpu_context::Cpu_context(Hw::Page_table * const table) -{ - sp = (addr_t)kernel_stack; - ip = (addr_t)kernel; - - /* - * platform specific initialization, has to be done after - * setting the registers by now - */ - _init(Cpu::KERNEL_STACK_SIZE, (addr_t)table); -} diff --git a/repos/base-hw/src/core/kernel/cpu.h b/repos/base-hw/src/core/kernel/cpu.h index 4898cf3d1..c2b29f269 100644 --- a/repos/base-hw/src/core/kernel/cpu.h +++ b/repos/base-hw/src/core/kernel/cpu.h @@ -25,11 +25,6 @@ namespace Hw { class Page_table; } namespace Kernel { - /** - * CPU context of a kernel stack - */ - class Cpu_context; - /** * Context of a job (thread, VM, idle) that shall be executed by a CPU */ @@ -61,28 +56,6 @@ namespace Kernel Cpu_pool * cpu_pool(); } -class Kernel::Cpu_context : public Genode::Cpu::Context -{ - private: - - /** - * Hook for environment specific initializations - * - * \param stack_size size of kernel stack - * \param table base of transit translation table - */ - void _init(size_t const stack_size, addr_t const table); - - public: - - /** - * Constructor - * - * \param table mode-transition table - */ - Cpu_context(Hw::Page_table * const table); -}; - class Kernel::Cpu_domain_update : public Double_list_item { friend class Cpu_domain_update_list; diff --git a/repos/base-hw/src/core/spec/arm/cpu_context.cc b/repos/base-hw/src/core/spec/arm/cpu.cc similarity index 100% rename from repos/base-hw/src/core/spec/arm/cpu_context.cc rename to repos/base-hw/src/core/spec/arm/cpu.cc diff --git a/repos/base-hw/src/core/spec/arm/cpu_context_trustzone.cc b/repos/base-hw/src/core/spec/arm/cpu_trustzone.cc similarity index 100% rename from repos/base-hw/src/core/spec/arm/cpu_context_trustzone.cc rename to repos/base-hw/src/core/spec/arm/cpu_trustzone.cc diff --git a/repos/base-hw/src/core/spec/arm/kernel/cpu_context.cc b/repos/base-hw/src/core/spec/arm/kernel/cpu_context.cc deleted file mode 100644 index 18620795d..000000000 --- a/repos/base-hw/src/core/spec/arm/kernel/cpu_context.cc +++ /dev/null @@ -1,24 +0,0 @@ -/* - * \brief Kernel cpu context specific implementation - * \author Stefan Kalkowski - * \date 2015-02-11 - */ - -/* - * Copyright (C) 2015-2017 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -/* core includes */ -#include -#include - -void Kernel::Cpu_context::_init(size_t const stack_size, addr_t const table) -{ - r12 = stack_size; - cpu_exception = Genode::Cpu::Ttbr0::init(table); - protection_domain(0); - translation_table(table); -} diff --git a/repos/base-hw/src/core/spec/arm_v7/virtualization/kernel/cpu_context.cc b/repos/base-hw/src/core/spec/arm_v7/virtualization/kernel/cpu_context.cc deleted file mode 100644 index 595e2f4b3..000000000 --- a/repos/base-hw/src/core/spec/arm_v7/virtualization/kernel/cpu_context.cc +++ /dev/null @@ -1,26 +0,0 @@ -/* - * \brief Kernel cpu context specific implementation - * \author Stefan Kalkowski - * \date 2015-02-11 - */ - -/* - * Copyright (C) 2015-2017 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -/* core includes */ -#include - -void Kernel::Cpu_context::_init(size_t const stack_size, addr_t const table) -{ - r12 = stack_size; - cpu_exception = Genode::Cpu::Ttbr0::init(table); - protection_domain(0); - translation_table(table); - sctlr = 0x00003805; // FIXME - ttbrc = 0x80002500; // FIXME - mair0 = 0x04ff0444; // FIXME -} diff --git a/repos/base-hw/src/core/spec/riscv/kernel/cpu_context.cc b/repos/base-hw/src/core/spec/riscv/kernel/cpu_context.cc deleted file mode 100644 index 61038edb5..000000000 --- a/repos/base-hw/src/core/spec/riscv/kernel/cpu_context.cc +++ /dev/null @@ -1,28 +0,0 @@ -/** - * \brief Kernel cpu context specific implementation - * \author Sebastian Sumpf - * \date 2015-06-02 - */ - -/* - * Copyright (C) 2015-2017 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -/* Core includes */ -#include - -void Kernel::Cpu_context::_init(size_t const stack_size, addr_t const table) -{ - /* - * The stack pointer currently contains the base address of the - * kernel stack area that contains the kernel stacks of all CPUs. As this - * is a uni-processor platform, we merely have to select the first kernel - * stack, i.e. increasing sp by the size of one stack. - */ - sp = sp + stack_size; - translation_table(table); - protection_domain(0); -} 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 deleted file mode 100644 index 0150a074f..000000000 --- a/repos/base-hw/src/core/spec/x86_64/kernel/cpu_context.cc +++ /dev/null @@ -1,27 +0,0 @@ -/* - * \brief Kernel cpu context specific implementation - * \author Stefan Kalkowski - * \date 2015-02-11 - */ - -/* - * Copyright (C) 2015-2017 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -/* core includes */ -#include -#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; - cr3 = Genode::Cpu::Cr3::init(table); -}