From a9563bfd4c5f72f97b6eadf77a7aef9625cdb4eb Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Mon, 12 Jul 2021 16:15:20 +0200 Subject: [PATCH] base-hw: rename Core_thread Core_main_thread The class name Core_thread in Kernel for the object of the first thread of core is too generic as there can be an arbitrary number of threads in core besides this one. Furthermore, creating a core thread has its own syscall 'new_core_thread' that isn't related in any way to Core_thread. Therefore this commit introduces the more specific name Core_main_thread as replacement for Core_thread. Ref #4217 --- repos/base-hw/src/core/kernel/init.cc | 2 +- repos/base-hw/src/core/kernel/thread.cc | 14 +++++++------- repos/base-hw/src/core/kernel/thread.h | 6 +++--- repos/base-hw/src/core/thread_start.cc | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/repos/base-hw/src/core/kernel/init.cc b/repos/base-hw/src/core/kernel/init.cc index ffd514ce8c..c7cdc72755 100644 --- a/repos/base-hw/src/core/kernel/init.cc +++ b/repos/base-hw/src/core/kernel/init.cc @@ -84,7 +84,7 @@ extern "C" void kernel_init() Genode::log(""); Genode::log("kernel initialized"); - Core_thread::singleton(); + Core_main_thread::singleton(); kernel_ready = true; } else { /* secondary cpus spin until the kernel is initialized */ diff --git a/repos/base-hw/src/core/kernel/thread.cc b/repos/base-hw/src/core/kernel/thread.cc index b9ed0436c5..3899fdeaa7 100644 --- a/repos/base-hw/src/core/kernel/thread.cc +++ b/repos/base-hw/src/core/kernel/thread.cc @@ -844,11 +844,11 @@ void Thread::print(Genode::Output &out) const Genode::uint8_t __initial_stack_base[DEFAULT_STACK_SIZE]; -/***************** - ** Core_thread ** - *****************/ +/********************** + ** Core_main_thread ** + **********************/ -Core_thread::Core_thread() +Core_main_thread::Core_main_thread() : Core_object("core") { @@ -877,8 +877,8 @@ Core_thread::Core_thread() } -Thread & Core_thread::singleton() +Thread & Core_main_thread::singleton() { - static Core_thread ct; - return ct; + static Core_main_thread cmt; + return cmt; } diff --git a/repos/base-hw/src/core/kernel/thread.h b/repos/base-hw/src/core/kernel/thread.h index c0636901a2..9cebd72807 100644 --- a/repos/base-hw/src/core/kernel/thread.h +++ b/repos/base-hw/src/core/kernel/thread.h @@ -35,7 +35,7 @@ namespace Kernel { struct Thread_fault; class Thread; - class Core_thread; + class Core_main_thread; } @@ -422,9 +422,9 @@ class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout /** * The first core thread in the system bootstrapped by the Kernel */ -struct Kernel::Core_thread : Core_object +struct Kernel::Core_main_thread : Core_object { - Core_thread(); + Core_main_thread(); static Thread & singleton(); }; diff --git a/repos/base-hw/src/core/thread_start.cc b/repos/base-hw/src/core/thread_start.cc index e62ad8e732..d4fce6eb00 100644 --- a/repos/base-hw/src/core/thread_start.cc +++ b/repos/base-hw/src/core/thread_start.cc @@ -93,7 +93,7 @@ void Thread::_init_platform_thread(size_t, Type type) } /* remap initial main-thread UTCB according to stack-area spec */ - Genode::map_local(Platform::core_phys_addr((addr_t)Kernel::Core_thread::singleton().utcb()), + Genode::map_local(Platform::core_phys_addr((addr_t)Kernel::Core_main_thread::singleton().utcb()), (addr_t)&_stack->utcb(), max(sizeof(Native_utcb) / get_page_size(), (size_t)1));