From 10e2e223cdb73724666cbb05b22997b3107f140f Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Mon, 8 May 2017 13:08:52 +0200 Subject: [PATCH] foc: remove obsolete features (ref #2405) Removes the following Fiasco.OC specific features: * GDB extensions for Fiasco.OC * i.MX53 support for Fiasco.OC * Kernel debugger terminal driver * Obsolete interface Native_pd * Obsolete function of interface Native_cpu --- repos/base-foc/config/imx53.kernel | 83 -------- repos/base-foc/config/imx53.user | 70 ------ .../base-foc/include/foc_native_cpu/client.h | 6 - .../include/foc_native_cpu/foc_native_cpu.h | 6 +- repos/base-foc/include/foc_native_pd/client.h | 32 --- .../include/foc_native_pd/foc_native_pd.h | 33 --- repos/base-foc/lib/mk/core-foc.inc | 1 - .../base-foc/lib/mk/spec/imx53/kernel-foc.mk | 3 - .../base-foc/lib/mk/spec/imx53/syscall-foc.mk | 5 - .../src/core/include/native_cpu_component.h | 2 - .../src/core/include/native_pd_component.h | 45 ---- .../base-foc/src/core/native_cpu_component.cc | 52 ----- .../base-foc/src/core/native_pd_component.cc | 40 ---- repos/gems/run/terminal_mux.run | 29 +-- .../cpu_sampler_platform-foc/native_cpu.cc | 14 -- repos/os/run/kdb_uart_drv.run | 4 +- .../src/drivers/uart/kdb/spec/foc/target.mk | 5 - .../mk/spec/arm/gdbserver_platform-arm.inc | 8 - .../lib/mk/spec/arm/gdbserver_platform-foc.mk | 12 -- .../mk/spec/x86_32/gdbserver_platform-foc.mk | 12 -- repos/ports/run/gdb_monitor.run | 7 +- repos/ports/run/noux_gdb.run | 4 +- .../lib/gdbserver_platform-foc/native_cpu.cc | 96 --------- .../gdbserver_platform-foc/spec/arm/low.cc | 200 ------------------ .../gdbserver_platform-foc/spec/x86_32/low.cc | 189 ----------------- .../src/lib/gdbserver_platform-foc/target.mk | 2 - tool/builddir/build.conf/foc_imx53 | 7 - tool/create_builddir | 7 +- 28 files changed, 15 insertions(+), 959 deletions(-) delete mode 100644 repos/base-foc/config/imx53.kernel delete mode 100644 repos/base-foc/config/imx53.user delete mode 100644 repos/base-foc/include/foc_native_pd/client.h delete mode 100644 repos/base-foc/include/foc_native_pd/foc_native_pd.h delete mode 100644 repos/base-foc/lib/mk/spec/imx53/kernel-foc.mk delete mode 100644 repos/base-foc/lib/mk/spec/imx53/syscall-foc.mk delete mode 100644 repos/base-foc/src/core/include/native_pd_component.h delete mode 100644 repos/base-foc/src/core/native_pd_component.cc delete mode 100644 repos/os/src/drivers/uart/kdb/spec/foc/target.mk delete mode 100644 repos/ports/lib/mk/spec/arm/gdbserver_platform-arm.inc delete mode 100644 repos/ports/lib/mk/spec/arm/gdbserver_platform-foc.mk delete mode 100644 repos/ports/lib/mk/spec/x86_32/gdbserver_platform-foc.mk delete mode 100644 repos/ports/src/lib/gdbserver_platform-foc/native_cpu.cc delete mode 100644 repos/ports/src/lib/gdbserver_platform-foc/spec/arm/low.cc delete mode 100644 repos/ports/src/lib/gdbserver_platform-foc/spec/x86_32/low.cc delete mode 100644 repos/ports/src/lib/gdbserver_platform-foc/target.mk delete mode 100644 tool/builddir/build.conf/foc_imx53 diff --git a/repos/base-foc/config/imx53.kernel b/repos/base-foc/config/imx53.kernel deleted file mode 100644 index 3d63b59c2..000000000 --- a/repos/base-foc/config/imx53.kernel +++ /dev/null @@ -1,83 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Fiasco configuration -# - -# -# Target configuration -# -# CONFIG_IA32 is not set -# CONFIG_AMD64 is not set -CONFIG_ARM=y -CONFIG_PF_IMX=y -# CONFIG_PF_REALVIEW is not set -# CONFIG_PF_S3C2410 is not set -# CONFIG_PF_TEGRA is not set -# CONFIG_PF_OMAP is not set -# CONFIG_PF_SA1100 is not set -# CONFIG_PF_XSCALE is not set -# CONFIG_PF_EXYNOS is not set -# CONFIG_PF_KIRKWOOD is not set -# CONFIG_PF_INTEGRATOR is not set -# CONFIG_PF_BCM2835 is not set -CONFIG_BSP_NAME="imx" -# CONFIG_PF_IMX_21 is not set -# CONFIG_PF_IMX_35 is not set -# CONFIG_PF_IMX_51 is not set -# CONFIG_PF_IMX_6 is not set -CONFIG_PF_IMX_53=y -CONFIG_PF_IMX_RAM_PHYS_BASE=0x70000000 -CONFIG_ABI_VF=y -CONFIG_CAN_ARM_CPU_CORTEX_A8=y -CONFIG_ARM_CORTEX_A8=y -# CONFIG_ARM_ALIGNMENT_CHECK is not set -CONFIG_ARM_EM_STD=y -# CONFIG_ARM_EM_NS is not set -# CONFIG_ARM_EM_TZ is not set -# CONFIG_FPU is not set -# CONFIG_ARM_CPU_ERRATA is not set - -# -# Kernel options -# -CONFIG_CONTEXT_4K=y -# CONFIG_FINE_GRAINED_CPUTIME is not set -CONFIG_SCHED_FIXED_PRIO=y -CONFIG_VIRT_OBJ_SPACE=y - -# -# Debugging -# -CONFIG_INLINE=y -# CONFIG_NDEBUG is not set -# CONFIG_NO_FRAME_PTR is not set -# CONFIG_STACK_DEPTH is not set -# CONFIG_LIST_ALLOC_SANITY is not set -CONFIG_SERIAL=y -CONFIG_JDB=y -# CONFIG_JDB_LOGGING is not set -# CONFIG_JDB_DISASM is not set -# CONFIG_JDB_GZIP is not set -# CONFIG_VMEM_ALLOC_TEST is not set -# CONFIG_DEBUG_KERNEL_PAGE_FAULTS is not set -# CONFIG_WARN_NONE is not set -CONFIG_WARN_WARNING=y -# CONFIG_WARN_ANY is not set - -# -# Compiling -# -CONFIG_CC="gcc" -CONFIG_CXX="g++" -CONFIG_HOST_CC="gcc" -CONFIG_HOST_CXX="g++" -# CONFIG_MAINTAINER_MODE is not set -CONFIG_LABEL="" -# CONFIG_EXPERIMENTAL is not set -CONFIG_PERF_CNT=y -CONFIG_BIT32=y -CONFIG_ARM_V7=y -CONFIG_ARM_V6PLUS=y -CONFIG_WARN_LEVEL=1 -CONFIG_XARCH="arm" -CONFIG_ABI="vf" diff --git a/repos/base-foc/config/imx53.user b/repos/base-foc/config/imx53.user deleted file mode 100644 index cc43ff891..000000000 --- a/repos/base-foc/config/imx53.user +++ /dev/null @@ -1,70 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# L4Re Configuration -# -# CONFIG_BUILD_ARCH_x86 is not set -# CONFIG_BUILD_ARCH_amd64 is not set -CONFIG_BUILD_ARCH_arm=y -# CONFIG_BUILD_ARCH_ppc32 is not set -# CONFIG_BUILD_ARCH_sparc is not set -CONFIG_BUILD_ARCH="arm" -CONFIG_BUILD_ABI_l4f=y -CONFIG_BUILD_ABI="l4f" -CONFIG_CPU="armv7a" -# CONFIG_CPU_ARM_ARMV4 is not set -# CONFIG_CPU_ARM_ARMV4T is not set -# CONFIG_CPU_ARM_ARMV5 is not set -# CONFIG_CPU_ARM_ARMV5T is not set -# CONFIG_CPU_ARM_ARMV5TE is not set -# CONFIG_CPU_ARM_ARMV6 is not set -# CONFIG_CPU_ARM_ARMV6T2 is not set -# CONFIG_CPU_ARM_ARMV6ZK is not set -CONFIG_CPU_ARM_ARMV7A=y -# CONFIG_CPU_ARM_ARMV7R is not set -CONFIG_CPU_ARMV6KPLUS=y -CONFIG_CPU_ARMV6PLUS=y -CONFIG_PLATFORM_TYPE_imx53=y -# CONFIG_PLATFORM_TYPE_imx35 is not set -# CONFIG_PLATFORM_TYPE_rv_pbx is not set -# CONFIG_PLATFORM_TYPE_exynos5 is not set -# CONFIG_PLATFORM_TYPE_rv is not set -# CONFIG_PLATFORM_TYPE_kirkwood is not set -# CONFIG_PLATFORM_TYPE_pandaboard is not set -# CONFIG_PLATFORM_TYPE_tegra3 is not set -# CONFIG_PLATFORM_TYPE_tegra2 is not set -# CONFIG_PLATFORM_TYPE_imx6 is not set -# CONFIG_PLATFORM_TYPE_exynos4 is not set -# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set -# CONFIG_PLATFORM_TYPE_rpi_b is not set -# CONFIG_PLATFORM_TYPE_rv_vexpress_a15 is not set -# CONFIG_PLATFORM_TYPE_imx51 is not set -# CONFIG_PLATFORM_TYPE_omap3evm is not set -# CONFIG_PLATFORM_TYPE_beagleboard is not set -# CONFIG_PLATFORM_TYPE_imx21 is not set -# CONFIG_PLATFORM_TYPE_rv_vexpress is not set -# CONFIG_PLATFORM_TYPE_rpi_a is not set -# CONFIG_PLATFORM_TYPE_integrator is not set -# CONFIG_PLATFORM_TYPE_custom is not set -CONFIG_PLATFORM_TYPE="imx53" -# CONFIG_USE_DROPS_STDDIR is not set -# CONFIG_USE_DICE is not set -CONFIG_DROPS_STDDIR="/path/to/l4re" -CONFIG_DROPS_INSTDIR="/path/to/l4re" -CONFIG_BID_COLORED_PHASES=y - -# -# Building -# -CONFIG_YACC="yacc" -CONFIG_LEX="flex" -CONFIG_CTAGS="ctags" -CONFIG_ETAGS="etags" -CONFIG_HAVE_LDSO=y -CONFIG_INT_CPP_NAME_SWITCH=y -CONFIG_INT_LD_NAME_SWITCH=y -# CONFIG_BID_STRIP_PROGS is not set -# CONFIG_BID_GCC_OMIT_FP is not set -# CONFIG_BID_GENERATE_MAPFILE is not set -# CONFIG_BID_BUILD_DOC is not set -# CONFIG_RELEASE_MODE is not set -CONFIG_MAKECONFS_ADD="" diff --git a/repos/base-foc/include/foc_native_cpu/client.h b/repos/base-foc/include/foc_native_cpu/client.h index 987bdb23f..22db880a1 100644 --- a/repos/base-foc/include/foc_native_cpu/client.h +++ b/repos/base-foc/include/foc_native_cpu/client.h @@ -26,15 +26,9 @@ struct Genode::Foc_native_cpu_client : Rpc_client explicit Foc_native_cpu_client(Capability cap) : Rpc_client(static_cap_cast(cap)) { } - void enable_vcpu(Thread_capability cap, addr_t vcpu_state) override { - call(cap, vcpu_state); } - Native_capability native_cap(Thread_capability cap) override { return call(cap); } - Native_capability alloc_irq() override { - return call(); } - Foc_thread_state thread_state(Thread_capability cap) override { return call(cap); } }; diff --git a/repos/base-foc/include/foc_native_cpu/foc_native_cpu.h b/repos/base-foc/include/foc_native_cpu/foc_native_cpu.h index 80bd1283b..10c4fe43d 100644 --- a/repos/base-foc/include/foc_native_cpu/foc_native_cpu.h +++ b/repos/base-foc/include/foc_native_cpu/foc_native_cpu.h @@ -24,9 +24,7 @@ namespace Genode { struct Foc_native_cpu; } struct Genode::Foc_native_cpu : Cpu_session::Native_cpu { - virtual void enable_vcpu(Thread_capability cap, addr_t vcpu_state) = 0; virtual Native_capability native_cap(Thread_capability) = 0; - virtual Native_capability alloc_irq() = 0; virtual Foc_thread_state thread_state(Thread_capability) = 0; @@ -34,12 +32,10 @@ struct Genode::Foc_native_cpu : Cpu_session::Native_cpu ** RPC declaration ** *********************/ - GENODE_RPC(Rpc_enable_vcpu, void, enable_vcpu, Thread_capability, addr_t); GENODE_RPC(Rpc_native_cap, Native_capability, native_cap, Thread_capability); - GENODE_RPC(Rpc_alloc_irq, Native_capability, alloc_irq); GENODE_RPC(Rpc_thread_state, Foc_thread_state, thread_state, Thread_capability); - GENODE_RPC_INTERFACE(Rpc_enable_vcpu, Rpc_native_cap, Rpc_alloc_irq, Rpc_thread_state); + GENODE_RPC_INTERFACE(Rpc_native_cap, Rpc_thread_state); }; #endif /* _INCLUDE__FOC_NATIVE_CPU__FOC_NATIVE_CPU_H_ */ diff --git a/repos/base-foc/include/foc_native_pd/client.h b/repos/base-foc/include/foc_native_pd/client.h deleted file mode 100644 index 3faef1c18..000000000 --- a/repos/base-foc/include/foc_native_pd/client.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * \brief Client-side Fiasco.OC specific PD session interface - * \author Stefan Kalkowski - * \author Norman Feske - * \date 2011-04-14 - */ - -/* - * Copyright (C) 2011-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. - */ - -#ifndef _INCLUDE__FOC_NATIVE_PD__CLIENT_H_ -#define _INCLUDE__FOC_NATIVE_PD__CLIENT_H_ - -#include -#include - -namespace Genode { struct Foc_native_pd_client; } - - -struct Genode::Foc_native_pd_client : Rpc_client -{ - explicit Foc_native_pd_client(Capability cap) - : Rpc_client(static_cap_cast(cap)) { } - - Native_capability task_cap() { return call(); } -}; - -#endif /* _INCLUDE__FOC_NATIVE_PD__CLIENT_H_ */ diff --git a/repos/base-foc/include/foc_native_pd/foc_native_pd.h b/repos/base-foc/include/foc_native_pd/foc_native_pd.h deleted file mode 100644 index 7e66afa54..000000000 --- a/repos/base-foc/include/foc_native_pd/foc_native_pd.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * \brief Fiasco.OC-specific part of the PD session interface - * \author Stefan Kalkowski - * \author Norman Feske - * \date 2011-04-14 - */ - -/* - * Copyright (C) 2011-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. - */ - -#ifndef _INCLUDE__FOC_NATIVE_PD__FOC_NATIVE_PD_H_ -#define _INCLUDE__FOC_NATIVE_PD__FOC_NATIVE_PD_H_ - -#include -#include -#include - -namespace Genode { struct Foc_native_pd; } - - -struct Genode::Foc_native_pd : Pd_session::Native_pd -{ - virtual Native_capability task_cap() = 0; - - GENODE_RPC(Rpc_task_cap, Native_capability, task_cap); - GENODE_RPC_INTERFACE(Rpc_task_cap); -}; - -#endif /* _INCLUDE__FOC_NATIVE_PD__FOC_NATIVE_PD_H_ */ diff --git a/repos/base-foc/lib/mk/core-foc.inc b/repos/base-foc/lib/mk/core-foc.inc index bfbbad555..fc9e76b6e 100644 --- a/repos/base-foc/lib/mk/core-foc.inc +++ b/repos/base-foc/lib/mk/core-foc.inc @@ -22,7 +22,6 @@ SRC_CC += stack_area.cc \ pd_session_component.cc \ pd_assign_pci.cc \ pd_upgrade_ram_quota.cc \ - native_pd_component.cc \ native_cpu_component.cc \ rpc_cap_factory.cc \ platform.cc \ diff --git a/repos/base-foc/lib/mk/spec/imx53/kernel-foc.mk b/repos/base-foc/lib/mk/spec/imx53/kernel-foc.mk deleted file mode 100644 index 373c58ffe..000000000 --- a/repos/base-foc/lib/mk/spec/imx53/kernel-foc.mk +++ /dev/null @@ -1,3 +0,0 @@ -KERNEL_CONFIG := $(REP_DIR)/config/imx53.kernel - -include $(REP_DIR)/lib/mk/kernel-foc.inc diff --git a/repos/base-foc/lib/mk/spec/imx53/syscall-foc.mk b/repos/base-foc/lib/mk/spec/imx53/syscall-foc.mk deleted file mode 100644 index 4d4fea59b..000000000 --- a/repos/base-foc/lib/mk/spec/imx53/syscall-foc.mk +++ /dev/null @@ -1,5 +0,0 @@ -L4_CONFIG := $(call select_from_repositories,config/imx53.user) - -L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/build/bin/arm_armv7a - -include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc diff --git a/repos/base-foc/src/core/include/native_cpu_component.h b/repos/base-foc/src/core/include/native_cpu_component.h index 4bc0f3412..c1b309d25 100644 --- a/repos/base-foc/src/core/include/native_cpu_component.h +++ b/repos/base-foc/src/core/include/native_cpu_component.h @@ -38,9 +38,7 @@ class Genode::Native_cpu_component : public Rpc_object - -/* core-local includes */ -#include - -namespace Genode { - - class Pd_session_component; - class Native_pd_component; -} - - -class Genode::Native_pd_component : public Rpc_object -{ - private: - - Pd_session_component &_pd_session; - - public: - - Native_capability task_cap() override; - - Native_pd_component(Pd_session_component &pd, char const *args); - - ~Native_pd_component(); -}; - -#endif /* _CORE__INCLUDE__NATIVE_PD_COMPONENT_H_ */ diff --git a/repos/base-foc/src/core/native_cpu_component.cc b/repos/base-foc/src/core/native_cpu_component.cc index ccfd85acc..815f96b2d 100644 --- a/repos/base-foc/src/core/native_cpu_component.cc +++ b/repos/base-foc/src/core/native_cpu_component.cc @@ -25,28 +25,6 @@ namespace Fiasco { #include } -static Genode::Avl_tree _irq_tree; - - - -void Genode::Native_cpu_component::enable_vcpu(Genode::Thread_capability thread_cap, - Genode::addr_t vcpu_state) -{ - using namespace Genode; - using namespace Fiasco; - - auto lambda = [&] (Cpu_thread_component *thread) { - if (!thread) return; - - l4_cap_idx_t tid = thread->platform_thread().thread().local.data()->kcap(); - - l4_msgtag_t tag = l4_thread_vcpu_control(tid, vcpu_state); - if (l4_msgtag_has_error(tag)) - warning("l4_thread_vcpu_control failed"); - }; - _thread_ep.apply(thread_cap, lambda); -} - Genode::Native_capability Genode::Native_cpu_component::native_cap(Genode::Thread_capability cap) @@ -61,36 +39,6 @@ Genode::Native_cpu_component::native_cap(Genode::Thread_capability cap) } -Genode::Native_capability Genode::Native_cpu_component::alloc_irq() -{ - using namespace Fiasco; - using namespace Genode; - - /* find irq object container of this cpu-session */ - Cpu_session_irqs* node = _irq_tree.first(); - if (node) - node = node->find_by_session(&_cpu_session); - - /* if not found, we've to create one */ - if (!node) { - node = new (&_cpu_session._md_alloc) Cpu_session_irqs(&_cpu_session); - _irq_tree.insert(node); - } - - /* construct irq kernel-object */ - Cap_index* i = cap_map()->insert(platform_specific()->cap_id_alloc()->alloc()); - l4_msgtag_t res = l4_factory_create_irq(L4_BASE_FACTORY_CAP, i->kcap()); - if (l4_error(res)) { - warning("Allocation of irq object failed!"); - return Genode::Native_capability(); - } - - /* construct cap and hold a reference in the irq container object */ - Genode::Native_capability cap(*i); - return (node->add(cap)) ? cap : Genode::Native_capability(); -} - - Genode::Foc_thread_state Genode::Native_cpu_component::thread_state(Genode::Thread_capability cap) { diff --git a/repos/base-foc/src/core/native_pd_component.cc b/repos/base-foc/src/core/native_pd_component.cc deleted file mode 100644 index 6b479a275..000000000 --- a/repos/base-foc/src/core/native_pd_component.cc +++ /dev/null @@ -1,40 +0,0 @@ -/* - * \brief Kernel-specific part of the PD-session interface - * \author Norman Feske - * \date 2016-01-19 - */ - -/* - * Copyright (C) 2016-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. - */ - -#include -#include - -using namespace Genode; - - -Native_capability Native_pd_component::task_cap() -{ - return Native_capability(_pd_session._pd.native_task()); -} - - -Native_pd_component::Native_pd_component(Pd_session_component &pd_session, - char const *args) -: - _pd_session(pd_session) -{ - _pd_session._ep.manage(this); -} - - -Native_pd_component::~Native_pd_component() -{ - _pd_session._ep.dissolve(this); -} - - diff --git a/repos/gems/run/terminal_mux.run b/repos/gems/run/terminal_mux.run index 27e65a0f3..696e24457 100644 --- a/repos/gems/run/terminal_mux.run +++ b/repos/gems/run/terminal_mux.run @@ -42,29 +42,14 @@ append config { - } - -# use kernel debugger as UART on Fiasco.OC -append_if [have_spec foc] config { - } - -append config { + - } - -# on Fiasco.OC the kdb_uart_drv is always UART 0 -append_if [have_spec foc] config { - } - -# on all other kernels, direct terminal_mux to UART 1 (Qemu stdio, see below) -append_if [expr ![have_spec foc]] config { + } - -append config { @@ -158,12 +143,9 @@ set boot_modules { core init timer ld.lib.so noux terminal_mux terminal_log test-signal cli_monitor test-resource_yield posix.lib.so libc.lib.so libm.lib.so libc_noux.lib.so libc_terminal.lib.so ncurses.lib.so - vim.tar + vim.tar uart_drv } -lappend_if [expr ![have_spec foc]] boot_modules uart_drv -lappend_if [have_spec foc] boot_modules kdb_uart_drv - set fiasco_serial_esc_arg "" build_boot_image $boot_modules @@ -172,11 +154,10 @@ append qemu_args " -m 256 " append qemu_args " -nographic " # -# On Fiasco.OC, we use only one UART via the kernel debugger. -# On all other kernels, we write the core debug output to the kdb.log file, +# On all kernels, we write the core debug output to the kdb.log file, # and use qemu's stdio as the UART used by terminal_mux. # -append_if [expr ![have_spec foc]] qemu_args " -serial file:kdb.log " +append qemu_args " -serial file:kdb.log " append qemu_args " -serial mon:stdio" run_genode_until forever diff --git a/repos/gems/src/lib/cpu_sampler_platform-foc/native_cpu.cc b/repos/gems/src/lib/cpu_sampler_platform-foc/native_cpu.cc index 6f956186d..01a7894b9 100644 --- a/repos/gems/src/lib/cpu_sampler_platform-foc/native_cpu.cc +++ b/repos/gems/src/lib/cpu_sampler_platform-foc/native_cpu.cc @@ -50,15 +50,6 @@ class Cpu_sampler::Native_cpu_component : public Rpc_objectparent_thread(), vcpu_state); - }; - - _cpu_session_component.thread_ep().apply(thread_cap, lambda); - } - Native_capability native_cap(Thread_capability thread_cap) override { auto lambda = [&] (Cpu_sampler::Cpu_thread_component *cpu_thread) { @@ -68,11 +59,6 @@ class Cpu_sampler::Native_cpu_component : public Rpc_object - -/* GDB monitor includes */ -#include "cpu_session_component.h" -#include "cpu_thread_component.h" - - -namespace Gdb_monitor { - class Native_cpu_component; -} - - -using namespace Genode; - - -class Gdb_monitor::Native_cpu_component : public Rpc_object -{ - private: - - Cpu_session_component &_cpu_session_component; - Foc_native_cpu_client _foc_native_cpu; - - public: - - Native_cpu_component(Cpu_session_component &cpu_session_component) - : _cpu_session_component(cpu_session_component), - _foc_native_cpu(_cpu_session_component.parent_cpu_session().native_cpu()) - { - _cpu_session_component.thread_ep().manage(this); - } - - ~Native_cpu_component() - { - _cpu_session_component.thread_ep().dissolve(this); - } - - void enable_vcpu(Thread_capability thread_cap, addr_t vcpu_state) override - { - Cpu_thread_component *cpu_thread = _cpu_session_component.lookup_cpu_thread(thread_cap); - _foc_native_cpu.enable_vcpu(cpu_thread->parent_thread_cap(), vcpu_state); - } - - Native_capability native_cap(Thread_capability thread_cap) override - { - Cpu_thread_component *cpu_thread = _cpu_session_component.lookup_cpu_thread(thread_cap); - return _foc_native_cpu.native_cap(cpu_thread->parent_thread_cap()); - } - - Native_capability alloc_irq() override - { - return _foc_native_cpu.alloc_irq(); - } - - Foc_thread_state thread_state(Thread_capability thread_cap) override - { - Cpu_thread_component *cpu_thread = _cpu_session_component.lookup_cpu_thread(thread_cap); - return _foc_native_cpu.thread_state(cpu_thread->parent_thread_cap()); - } -}; - - -Capability -Gdb_monitor::Cpu_session_component::_setup_native_cpu() -{ - Native_cpu_component *native_cpu_component = - new (_md_alloc) Native_cpu_component(*this); - - return native_cpu_component->cap(); -} - - -void Gdb_monitor::Cpu_session_component::_cleanup_native_cpu() -{ - Native_cpu_component *native_cpu_component = nullptr; - _ep.apply(_native_cpu_cap, [&] (Native_cpu_component *c) { native_cpu_component = c; }); - - if (!native_cpu_component) return; - - destroy(_md_alloc, native_cpu_component); -} diff --git a/repos/ports/src/lib/gdbserver_platform-foc/spec/arm/low.cc b/repos/ports/src/lib/gdbserver_platform-foc/spec/arm/low.cc deleted file mode 100644 index 36364204e..000000000 --- a/repos/ports/src/lib/gdbserver_platform-foc/spec/arm/low.cc +++ /dev/null @@ -1,200 +0,0 @@ -/* - * \brief Fiasco.OC(ARM)-specific helper functions for GDB server - * \author Christian Prochaska - * \date 2011-08-01 - */ - -/* - * Copyright (C) 2011-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. - */ - -/* Genode includes */ -#include - -/* GDB monitor includes */ -#include "cpu_session_component.h" -#include "reg-arm.h" -#include "gdbserver_platform_helper.h" - -#include "genode_child_resources.h" - -extern "C" { -#define private _private -#include "genode-low.h" -#define _private private -} - -using namespace Genode; - -static bool in_syscall(Thread_state const &ts) -{ - try { - /* looking for syscall pattern: - * (PC-8: e1a0e00f mov lr, pc) - * PC-4: e3e0f00b mvn pc, #11 - * (PC: e1a02004 mov r2, r4) - */ - if ((genode_read_memory_byte((void*)(ts.ip - 1)) == 0xe3) && - (genode_read_memory_byte((void*)(ts.ip - 2)) == 0xe0) && - (genode_read_memory_byte((void*)(ts.ip - 3)) == 0xf0) && - (genode_read_memory_byte((void*)(ts.ip - 4)) == 0x0b)) - return true; - } catch (No_memory_at_address) { - return false; - } - return false; -} - -extern "C" int genode_fetch_register(int regno, unsigned long *value) -{ - Thread_state ts; - - try { ts = get_current_thread_state(); } - catch (...) { - error(__PRETTY_FUNCTION__, ": could not get current thread state"); - return -1; - } - - if (in_syscall(ts) || ts.unresolved_page_fault) { - - switch((enum reg_index)regno) - { - case R0: cannot_fetch_register("R0"); return -1; - case R1: cannot_fetch_register("R1"); return -1; - case R2: cannot_fetch_register("R2"); return -1; - case R3: cannot_fetch_register("R3"); return -1; - case R4: cannot_fetch_register("R4"); return -1; - case R5: cannot_fetch_register("R5"); return -1; - case R6: cannot_fetch_register("R6"); return -1; - case R7: cannot_fetch_register("R7"); return -1; - case R8: cannot_fetch_register("R8"); return -1; - case R9: cannot_fetch_register("R9"); return -1; - case R10: cannot_fetch_register("R10"); return -1; - - case R11: - - if (in_syscall(ts)) { - /* R11 can be calculated from SP. The offset can be found in - * the disassembled 'Fiasco::l4_ipc()' function: - * add r11, sp, #8 -> r11 = sp + 8 - * sub sp, sp, #20 -> r11 = (sp + 20) + 8 - */ - *value = (ts.sp + 20) + 8; - - /* for the debug output, if enabled */ - fetch_register("R11", *value, *value); - - return 0; - } else { - - cannot_fetch_register("R11"); - - return -1; - } - - case R12: cannot_fetch_register("R12"); return -1; - case SP: fetch_register("SP ", ts.sp, *value); return 0; - case LR: cannot_fetch_register("LR"); return -1; - case PC: fetch_register("PC ", ts.ip, *value); return 0; - case F0: cannot_fetch_register("F0"); return -1; - case F1: cannot_fetch_register("F1"); return -1; - case F2: cannot_fetch_register("F2"); return -1; - case F3: cannot_fetch_register("F3"); return -1; - case F4: cannot_fetch_register("F4"); return -1; - case F5: cannot_fetch_register("F5"); return -1; - case F6: cannot_fetch_register("F6"); return -1; - case F7: cannot_fetch_register("F7"); return -1; - case FPS: cannot_fetch_register("FPS"); return -1; - case CPSR: cannot_fetch_register("CPSR"); return -1; - default: error("unhandled register ", regno); return -1; - } - - } else { - - switch((enum reg_index)regno) - { - case R0: fetch_register("R0 ", ts.r0, *value); return 0; - case R1: fetch_register("R1 ", ts.r1, *value); return 0; - case R2: fetch_register("R2 ", ts.r2, *value); return 0; - case R3: fetch_register("R3 ", ts.r3, *value); return 0; - case R4: fetch_register("R4 ", ts.r4, *value); return 0; - case R5: fetch_register("R5 ", ts.r5, *value); return 0; - case R6: fetch_register("R6 ", ts.r6, *value); return 0; - case R7: fetch_register("R7 ", ts.r7, *value); return 0; - case R8: fetch_register("R8 ", ts.r8, *value); return 0; - case R9: fetch_register("R9 ", ts.r9, *value); return 0; - case R10: fetch_register("R10 ", ts.r10, *value); return 0; - case R11: fetch_register("R11 ", ts.r11, *value); return 0; - case R12: fetch_register("R12 ", ts.r12, *value); return 0; - case SP: fetch_register("SP ", ts.sp, *value); return 0; - case LR: fetch_register("LR ", ts.lr, *value); return 0; - case PC: fetch_register("PC ", ts.ip, *value); return 0; - case F0: cannot_fetch_register("F0"); return -1; - case F1: cannot_fetch_register("F1"); return -1; - case F2: cannot_fetch_register("F2"); return -1; - case F3: cannot_fetch_register("F3"); return -1; - case F4: cannot_fetch_register("F4"); return -1; - case F5: cannot_fetch_register("F5"); return -1; - case F6: cannot_fetch_register("F6"); return -1; - case F7: cannot_fetch_register("F7"); return -1; - case FPS: cannot_fetch_register("FPS"); return -1; - case CPSR: fetch_register("CPSR", ts.cpsr, *value); return 0; - default: error("unhandled register ", regno); return -1; - } - } - - return -1; -} - - -extern "C" void genode_store_register(int regno, unsigned long value) -{ - Thread_state ts; - - try { ts = get_current_thread_state(); } - catch (...) { - error(__PRETTY_FUNCTION__, ": could not get current thread state"); - return; - } - - if (in_syscall(ts)) { - log("cannot set registers while thread is in syscall"); - return; - } - - switch((enum reg_index)regno) - { - case R0: if (!store_register("R0 ", ts.r0, value)) return; break; - case R1: if (!store_register("R1 ", ts.r1, value)) return; break; - case R2: if (!store_register("R2 ", ts.r2, value)) return; break; - case R3: if (!store_register("R3 ", ts.r3, value)) return; break; - case R4: if (!store_register("R4 ", ts.r4, value)) return; break; - case R5: if (!store_register("R5 ", ts.r5, value)) return; break; - case R6: if (!store_register("R6 ", ts.r6, value)) return; break; - case R7: if (!store_register("R7 ", ts.r7, value)) return; break; - case R8: if (!store_register("R8 ", ts.r8, value)) return; break; - case R9: if (!store_register("R9 ", ts.r9, value)) return; break; - case R10: if (!store_register("R10 ", ts.r10, value)) return; break; - case R11: if (!store_register("R11 ", ts.r11, value)) return; break; - case R12: if (!store_register("R12 ", ts.r12, value)) return; break; - case SP: if (!store_register("SP ", ts.sp, value)) return; break; - case LR: if (!store_register("LR ", ts.lr, value)) return; break; - case PC: if (!store_register("PC ", ts.ip, value)) return; break; - case F0: cannot_store_register("F0 ", value); return; - case F1: cannot_store_register("F1 ", value); return; - case F2: cannot_store_register("F2 ", value); return; - case F3: cannot_store_register("F3 ", value); return; - case F4: cannot_store_register("F4 ", value); return; - case F5: cannot_store_register("F5 ", value); return; - case F6: cannot_store_register("F6 ", value); return; - case F7: cannot_store_register("F7 ", value); return; - case FPS: cannot_store_register("FPS", value); return; - case CPSR: if (!store_register("CPSR", ts.cpsr, value)) return; break; - } - - set_current_thread_state(ts); -} - diff --git a/repos/ports/src/lib/gdbserver_platform-foc/spec/x86_32/low.cc b/repos/ports/src/lib/gdbserver_platform-foc/spec/x86_32/low.cc deleted file mode 100644 index 9b1bcbba9..000000000 --- a/repos/ports/src/lib/gdbserver_platform-foc/spec/x86_32/low.cc +++ /dev/null @@ -1,189 +0,0 @@ -/* - * \brief Fiasco.OC(x86_32)-specific helper functions for GDB server - * \author Christian Prochaska - * \date 2011-05-06 - */ - -/* - * Copyright (C) 2011-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. - */ - -/* Genode includes */ -#include - -/* GDB monitor includes */ -#include "i386.h" -#include "cpu_session_component.h" -#include "gdbserver_platform_helper.h" -#include "genode_child_resources.h" - -extern "C" { -#define private _private -#include "genode-low.h" -#define _private private -} - -using namespace Genode; - -static bool in_syscall(Thread_state const &thread_state) -{ - /* looking for syscall pattern: - * EIP-7: 55 push %ebp - * EIP-6: ff 93 call ... - * EIP: 5d pop %ebp - */ - if ((genode_read_memory_byte((void*)(thread_state.ip)) == 0x5d) && - (genode_read_memory_byte((void*)(thread_state.ip - 5)) == 0x93) && - (genode_read_memory_byte((void*)(thread_state.ip - 6)) == 0xff) && - (genode_read_memory_byte((void*)(thread_state.ip - 7)) == 0x55)) - return true; - - return false; -} - -extern "C" int genode_fetch_register(int regno, unsigned long *value) -{ - Thread_state ts; - - try { ts = get_current_thread_state(); } - catch (...) { - error(__PRETTY_FUNCTION__, ": could not get current thread state"); - return -1; - } - - if (in_syscall(ts) || ts.unresolved_page_fault) { - - switch((enum reg_index)regno) - { - case EAX: cannot_fetch_register("EAX"); return -1; - case ECX: cannot_fetch_register("ECX"); return -1; - case EDX: cannot_fetch_register("EDX"); return -1; - - case EBX: - - if (in_syscall(ts)) { - - /* When in a syscall, the user EBX has been pushed onto the stack at address ESP+4 */ - *value = genode_read_memory_byte((void*)(ts.sp + 4)) - + (genode_read_memory_byte((void*)(ts.sp + 5)) << 8) - + (genode_read_memory_byte((void*)(ts.sp + 6)) << 16) - + (genode_read_memory_byte((void*)(ts.sp + 7)) << 24); - - /* for the debug output, if enabled */ - fetch_register("EBX", *value, *value); - - return 0; - - } else { - - cannot_fetch_register("EBX"); - - return -1; - } - - case UESP: fetch_register("ESP", ts.sp, *value); return 0; - - case EBP: - - if (in_syscall(ts)) { - - /* When in a syscall, the user EBP has been pushed onto the stack at address ESP+0 */ - *value = genode_read_memory_byte((void*)(ts.sp + 0)) - + (genode_read_memory_byte((void*)(ts.sp + 1)) << 8) - + (genode_read_memory_byte((void*)(ts.sp + 2)) << 16) - + (genode_read_memory_byte((void*)(ts.sp + 3)) << 24); - - /* for the debug output, if enabled */ - fetch_register("EBP", *value, *value); - - return 0; - - } else { - - cannot_fetch_register("EBP"); - - return -1; - } - - case ESI: cannot_fetch_register("ESI"); return -1; - case EDI: cannot_fetch_register("EDI"); return -1; - case EIP: fetch_register("EIP", ts.ip, *value); return 0; - case EFL: cannot_fetch_register("EFL"); return -1; - case CS: cannot_fetch_register("CS"); return -1; - case SS: cannot_fetch_register("SS"); return -1; - case DS: cannot_fetch_register("DS"); return -1; - case ES: cannot_fetch_register("ES"); return -1; - case FS: cannot_fetch_register("FS"); return -1; - case GS: cannot_fetch_register("GS"); return -1; - default: error("unhandled register ", regno); return -1; - } - - } else { - - switch((enum reg_index)regno) - { - case EAX: fetch_register("EAX", ts.eax, *value); return 0; - case ECX: fetch_register("ECX", ts.ecx, *value); return 0; - case EDX: fetch_register("EDX", ts.edx, *value); return 0; - case EBX: fetch_register("EBX", ts.ebx, *value); return 0; - case UESP: fetch_register("ESP", ts.sp, *value); return 0; - case EBP: fetch_register("EBP", ts.ebp, *value); return 0; - case ESI: fetch_register("ESI", ts.esi, *value); return 0; - case EDI: fetch_register("EDI", ts.edi, *value); return 0; - case EIP: fetch_register("EIP", ts.ip, *value); return 0; - case EFL: fetch_register("EFL", ts.eflags, *value); return 0; - case CS: cannot_fetch_register("CS"); return -1; - case SS: cannot_fetch_register("SS"); return -1; - case DS: cannot_fetch_register("DS"); return -1; - case ES: cannot_fetch_register("ES"); return -1; - case FS: fetch_register("FS", ts.fs, *value); return 0; - case GS: fetch_register("GS", ts.gs, *value); return 0; - default: error("unhandled register ", regno); return -1; - } - } - - return -1; -} - -extern "C" void genode_store_register(int regno, unsigned long value) -{ - Thread_state ts; - - try { ts = get_current_thread_state(); } - catch (...) { - error(__PRETTY_FUNCTION__, ": could not get current thread state"); - return; - } - - if (in_syscall(ts)) { - log("cannot set registers while thread is in syscall"); - return; - } - - switch((enum reg_index)regno) - { - case EAX: if (!store_register("EAX", ts.eax, value)) return; break; - case ECX: if (!store_register("ECX", ts.ecx, value)) return; break; - case EDX: if (!store_register("EDX", ts.edx, value)) return; break; - case EBX: if (!store_register("EBX", ts.ebx, value)) return; break; - case UESP: if (!store_register("ESP", ts.sp, value)) return; break; - case EBP: if (!store_register("EBP", ts.ebp, value)) return; break; - case ESI: if (!store_register("ESI", ts.esi, value)) return; break; - case EDI: if (!store_register("EDI", ts.edi, value)) return; break; - case EIP: if (!store_register("EIP", ts.ip, value)) return; break; - case EFL: if (!store_register("EFL", ts.eflags, value)) return; break; - case CS: cannot_store_register("CS", value); return; - case SS: cannot_store_register("SS", value); return; - case DS: cannot_store_register("DS", value); return; - case ES: cannot_store_register("ES", value); return; - case FS: if (!store_register("FS ", ts.fs, value)) return; break; - case GS: if (!store_register("GS ", ts.gs, value)) return; break; - default: error("unhandled register ", regno); return; - } - - set_current_thread_state(ts); -} - diff --git a/repos/ports/src/lib/gdbserver_platform-foc/target.mk b/repos/ports/src/lib/gdbserver_platform-foc/target.mk deleted file mode 100644 index f29f9a42e..000000000 --- a/repos/ports/src/lib/gdbserver_platform-foc/target.mk +++ /dev/null @@ -1,2 +0,0 @@ -TARGET = gdbserver_platform-foc -LIBS = gdbserver_platform-foc diff --git a/tool/builddir/build.conf/foc_imx53 b/tool/builddir/build.conf/foc_imx53 deleted file mode 100644 index 42bcc1c76..000000000 --- a/tool/builddir/build.conf/foc_imx53 +++ /dev/null @@ -1,7 +0,0 @@ -REPOSITORIES = $(GENODE_DIR)/repos/base-foc - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/foc diff --git a/tool/create_builddir b/tool/create_builddir index 1618d5e84..7683337d6 100755 --- a/tool/create_builddir +++ b/tool/create_builddir @@ -17,7 +17,7 @@ PLATFORMS = x86_32 x86_64 panda pbxa9 rpi arndale imx53_qsb imx53_qsb_tz \ PLATFORMS_DEPR = linux_x86 linux_arm fiasco_x86 okl4_x86 pistachio_x86 \ nova_x86_32 nova_x86_64 hw_x86_64 foc_x86_32 foc_x86_64 \ sel4_x86_32 hw_panda foc_panda hw_pbxa9 foc_pbxa9 hw_rpi \ - foc_rpi hw_arndale foc_arndale hw_imx53_qsb foc_imx53 \ + foc_rpi hw_arndale foc_arndale hw_imx53_qsb \ hw_imx53_qsb_tz hw_usb_armory hw_wand_quad hw_odroid_xu \ hw_zynq hw_x86_64_muen hw_riscv foc_odroid_x2 @@ -41,7 +41,6 @@ PLATFORM_ALT(foc_rpi) = rpi PLATFORM_ALT(hw_arndale) = arndale PLATFORM_ALT(foc_arndale) = arndale PLATFORM_ALT(hw_imx53_qsb) = imx53_qsb -PLATFORM_ALT(foc_imx53) = imx53_qsb PLATFORM_ALT(hw_imx53_qsb_tz) = imx53_qsb_tz PLATFORM_ALT(hw_usb_armory) = usb_armory PLATFORM_ALT(hw_wand_quad) = wand_quad @@ -140,7 +139,7 @@ BUILD_CONF(pbxa9) := run_kernel_hw_foc $(BUILD_CONF_PBXA9) BUILD_CONF(panda) := run_kernel_hw_foc run_boot_dir repos BUILD_CONF(rpi) := run_kernel_hw_foc run_boot_dir repos BUILD_CONF(arndale) := run_kernel_hw_foc run_boot_dir repos -BUILD_CONF(imx53_qsb) := run_kernel_hw_foc run_boot_dir repos +BUILD_CONF(imx53_qsb) := run_kernel_hw run_boot_dir repos BUILD_CONF(imx53_qsb_tz) := run_kernel_hw run_boot_dir repos BUILD_CONF(usb_armory) := run_kernel_hw run_boot_dir repos BUILD_CONF(wand_quad) := run_kernel_hw run_boot_dir repos @@ -172,7 +171,6 @@ BUILD_CONF(foc_rpi) := run_kernel_foc run_boot_dir repos BUILD_CONF(hw_arndale) := ${BUILD_CONF(arndale)} BUILD_CONF(foc_arndale) := run_kernel_foc run_boot_dir repos BUILD_CONF(hw_imx53_qsb) := ${BUILD_CONF(imx53_qsb)} -BUILD_CONF(foc_imx53) := run_kernel_foc run_boot_dir repos BUILD_CONF(hw_imx53_qsb_tz) := ${BUILD_CONF(imx53_qsb_tz)} BUILD_CONF(hw_usb_armory) := ${BUILD_CONF(usb_armory)} BUILD_CONF(hw_wand_quad) := ${BUILD_CONF(wand_quad)} @@ -255,7 +253,6 @@ SPECS(foc_rpi) := foc_rpi rpi SPECS(hw_arndale) := ${SPECS(arndale)} SPECS(foc_arndale) := foc_arndale arndale SPECS(hw_imx53_qsb) := ${SPECS(imx53_qsb)} -SPECS(foc_imx53) := foc_imx53 imx53_qsb SPECS(hw_imx53_qsb_tz) := ${SPECS(imx53_qsb_tz)} SPECS(hw_usb_armory) := ${SPECS(usb_armory)} SPECS(hw_wand_quad) := ${SPECS(wand_quad)}