From b5b958c276612edd2fd04a4b64e781ac0a03ddef Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Thu, 17 Feb 2022 15:57:50 +0100 Subject: [PATCH] hw: unify architectural kernel interface header Fix genodelabs/genode#4345 --- repos/base-hw/include/kernel/interface.h | 1 - repos/base-hw/include/kernel/types.h | 9 +++++-- .../spec/arm/kernel/interface_support.h | 26 ------------------- .../spec/arm_64/kernel/interface_support.h | 26 ------------------- .../spec/riscv/kernel/interface_support.h | 26 ------------------- .../spec/x86_64/kernel/interface_support.h | 26 ------------------- repos/base-hw/src/core/spec/arm/cpu_support.h | 3 +-- .../src/core/spec/riscv/kernel/interface.cc | 2 +- repos/base-hw/src/core/spec/x86_64/cpu.h | 1 - .../src/lib/base/riscv/kernel/interface.cc | 2 +- 10 files changed, 10 insertions(+), 112 deletions(-) delete mode 100644 repos/base-hw/include/spec/arm/kernel/interface_support.h delete mode 100644 repos/base-hw/include/spec/arm_64/kernel/interface_support.h delete mode 100644 repos/base-hw/include/spec/riscv/kernel/interface_support.h delete mode 100644 repos/base-hw/include/spec/x86_64/kernel/interface_support.h diff --git a/repos/base-hw/include/kernel/interface.h b/repos/base-hw/include/kernel/interface.h index f1f0d48e62..af8255b218 100644 --- a/repos/base-hw/include/kernel/interface.h +++ b/repos/base-hw/include/kernel/interface.h @@ -16,7 +16,6 @@ /* base-hw includes */ #include -#include namespace Kernel { diff --git a/repos/base-hw/include/kernel/types.h b/repos/base-hw/include/kernel/types.h index 4c8c2420e4..2828363e4c 100644 --- a/repos/base-hw/include/kernel/types.h +++ b/repos/base-hw/include/kernel/types.h @@ -14,8 +14,8 @@ #ifndef _KERNEL__TYPES_H_ #define _KERNEL__TYPES_H_ -/* base-hw includes */ -#include +/* Genode includes */ +#include namespace Kernel { @@ -25,6 +25,11 @@ namespace Kernel { using time_t = Genode::uint64_t; using timeout_t = Genode::uint32_t; + using Call_arg = Genode::umword_t; + using Call_ret = Genode::umword_t; + + using Call_ret_64 = Genode::uint64_t; + constexpr capid_t cap_id_invalid() { return 0; } } diff --git a/repos/base-hw/include/spec/arm/kernel/interface_support.h b/repos/base-hw/include/spec/arm/kernel/interface_support.h deleted file mode 100644 index f0cfa20c40..0000000000 --- a/repos/base-hw/include/spec/arm/kernel/interface_support.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * \brief Interface between kernel and userland - * \author Martin Stein - * \date 2011-11-30 - */ - -/* - * 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__SPEC__ARM__KERNEL__INTERFACE_SUPPORT_H_ -#define _INCLUDE__SPEC__ARM__KERNEL__INTERFACE_SUPPORT_H_ - -/* Genode includes */ -#include - -namespace Kernel { - typedef Genode::uint32_t Call_arg; - typedef Genode::uint32_t Call_ret; - typedef Genode::uint64_t Call_ret_64; -} - -#endif /* _INCLUDE__SPEC__ARM__KERNEL__INTERFACE_SUPPORT_H_ */ diff --git a/repos/base-hw/include/spec/arm_64/kernel/interface_support.h b/repos/base-hw/include/spec/arm_64/kernel/interface_support.h deleted file mode 100644 index 5326ad2e83..0000000000 --- a/repos/base-hw/include/spec/arm_64/kernel/interface_support.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * \brief Interface between kernel and userland - * \author Stefan Kalkowski - * \date 2019-05-09 - */ - -/* - * Copyright (C) 2019 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__SPEC__ARM_64__KERNEL__INTERFACE_SUPPORT_H_ -#define _INCLUDE__SPEC__ARM_64__KERNEL__INTERFACE_SUPPORT_H_ - -/* Genode includes */ -#include - -namespace Kernel { - typedef Genode::uint64_t Call_arg; - typedef Genode::uint64_t Call_ret; - typedef Genode::uint64_t Call_ret_64; -} - -#endif /* _INCLUDE__SPEC__ARM_64__KERNEL__INTERFACE_SUPPORT_H_ */ diff --git a/repos/base-hw/include/spec/riscv/kernel/interface_support.h b/repos/base-hw/include/spec/riscv/kernel/interface_support.h deleted file mode 100644 index 8c1ad36336..0000000000 --- a/repos/base-hw/include/spec/riscv/kernel/interface_support.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * \brief Interface between kernel and userland - * \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. - */ - -#ifndef _KERNEL__INTERFACE_SUPPORT_H_ -#define _KERNEL__INTERFACE_SUPPORT_H_ - -/* Genode includes */ -#include - -namespace Kernel { - typedef Genode::uint64_t Call_arg; - typedef Genode::uint64_t Call_ret; - typedef Genode::uint64_t Call_ret_64; -} - -#endif /* _KERNEL__INTERFACE_SUPPORT_H_ */ diff --git a/repos/base-hw/include/spec/x86_64/kernel/interface_support.h b/repos/base-hw/include/spec/x86_64/kernel/interface_support.h deleted file mode 100644 index d3bff559cc..0000000000 --- a/repos/base-hw/include/spec/x86_64/kernel/interface_support.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * \brief Interface between kernel and userland - * \author Reto Buerki - * \date 2015-02-06 - */ - -/* - * 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. - */ - -#ifndef _INCLUDE__SPEC__X86_64__KERNEL__INTERFACE_SUPPORT_H_ -#define _INCLUDE__SPEC__X86_64__KERNEL__INTERFACE_SUPPORT_H_ - -/* Genode includes */ -#include - -namespace Kernel { - typedef Genode::uint64_t Call_arg; - typedef Genode::uint64_t Call_ret; - typedef Genode::uint64_t Call_ret_64; -} - -#endif /* _INCLUDE__SPEC__X86_64__KERNEL__INTERFACE_SUPPORT_H_ */ diff --git a/repos/base-hw/src/core/spec/arm/cpu_support.h b/repos/base-hw/src/core/spec/arm/cpu_support.h index 4654daf93e..bba89ce42a 100644 --- a/repos/base-hw/src/core/spec/arm/cpu_support.h +++ b/repos/base-hw/src/core/spec/arm/cpu_support.h @@ -25,9 +25,8 @@ /* base-hw internal includes */ #include -/* base-hw Core includes */ +/* base-hw core includes */ #include -#include #include namespace Kernel { struct Thread_fault; } diff --git a/repos/base-hw/src/core/spec/riscv/kernel/interface.cc b/repos/base-hw/src/core/spec/riscv/kernel/interface.cc index 0b416b50f6..5e2d2f3d11 100644 --- a/repos/base-hw/src/core/spec/riscv/kernel/interface.cc +++ b/repos/base-hw/src/core/spec/riscv/kernel/interface.cc @@ -82,7 +82,7 @@ extern Genode::addr_t _kernel_entry; ** Kernel calls ** ******************/ -Call_ret Kernel::call64(Call_arg arg_0) +Call_ret_64 Kernel::call64(Call_arg arg_0) { CALL_1_FILL_ARG_REGS asm volatile(CALL_1_SWI : "ra"); diff --git a/repos/base-hw/src/core/spec/x86_64/cpu.h b/repos/base-hw/src/core/spec/x86_64/cpu.h index 0e4be02227..35073dcc93 100644 --- a/repos/base-hw/src/core/spec/x86_64/cpu.h +++ b/repos/base-hw/src/core/spec/x86_64/cpu.h @@ -19,7 +19,6 @@ /* base includes */ #include -#include #include /* base-hw internal includes */ diff --git a/repos/base-hw/src/lib/base/riscv/kernel/interface.cc b/repos/base-hw/src/lib/base/riscv/kernel/interface.cc index 5690c466f6..f92f0949a5 100644 --- a/repos/base-hw/src/lib/base/riscv/kernel/interface.cc +++ b/repos/base-hw/src/lib/base/riscv/kernel/interface.cc @@ -51,7 +51,7 @@ using namespace Kernel; ** Kernel calls ** ******************/ -Call_ret Kernel::call64(Call_arg arg_0) +Call_ret_64 Kernel::call64(Call_arg arg_0) { CALL_1_FILL_ARG_REGS asm volatile(CALL_1_SWI);