From 7093258649a15f9c71ecebb0d3a31c21d02c8051 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 21 Jun 2023 17:00:06 +0200 Subject: [PATCH] base: move 'prepare_init_main_thread' to Genode:: Issue #4784 --- repos/base-fiasco/src/lib/base/thread_bootstrap.cc | 2 +- repos/base-foc/src/lib/base/thread_bootstrap.cc | 3 ++- repos/base-hw/src/lib/base/thread_bootstrap.cc | 4 ++-- repos/base-linux/src/lib/base/thread_env.cc | 6 +++++- repos/base-nova/src/lib/base/stack.cc | 5 ++--- repos/base-okl4/src/lib/base/thread_bootstrap.cc | 2 +- repos/base-pistachio/src/lib/base/thread_bootstrap.cc | 2 +- repos/base-sel4/src/lib/base/thread_bootstrap.cc | 2 +- repos/base/src/include/base/internal/globals.h | 1 + repos/base/src/lib/startup/init_main_thread.cc | 3 --- 10 files changed, 16 insertions(+), 14 deletions(-) diff --git a/repos/base-fiasco/src/lib/base/thread_bootstrap.cc b/repos/base-fiasco/src/lib/base/thread_bootstrap.cc index 7a4c9018d9..a2415bd40c 100644 --- a/repos/base-fiasco/src/lib/base/thread_bootstrap.cc +++ b/repos/base-fiasco/src/lib/base/thread_bootstrap.cc @@ -32,7 +32,7 @@ static Thread_capability main_thread_cap(Thread_capability main_cap = { }) ** Startup library support ** *****************************/ -void prepare_init_main_thread() { } +void Genode::prepare_init_main_thread() { } /************ diff --git a/repos/base-foc/src/lib/base/thread_bootstrap.cc b/repos/base-foc/src/lib/base/thread_bootstrap.cc index 4b08b05338..41149eec15 100644 --- a/repos/base-foc/src/lib/base/thread_bootstrap.cc +++ b/repos/base-foc/src/lib/base/thread_bootstrap.cc @@ -19,6 +19,7 @@ #include /* base-internal includes */ +#include #include #include @@ -29,7 +30,7 @@ using namespace Genode; ** Startup library support ** *****************************/ -void prepare_init_main_thread() +void Genode::prepare_init_main_thread() { enum { THREAD_CAP_ID = 1 }; Cap_index * ci(cap_map().insert(THREAD_CAP_ID, Foc::MAIN_THREAD_CAP)); diff --git a/repos/base-hw/src/lib/base/thread_bootstrap.cc b/repos/base-hw/src/lib/base/thread_bootstrap.cc index 0a7692c7ad..77e6dd0303 100644 --- a/repos/base-hw/src/lib/base/thread_bootstrap.cc +++ b/repos/base-hw/src/lib/base/thread_bootstrap.cc @@ -18,6 +18,7 @@ #include /* base-internal includes */ +#include #include #include #include @@ -35,9 +36,8 @@ namespace Hw { ** Startup library support ** *****************************/ -void prepare_init_main_thread() +void Genode::prepare_init_main_thread() { - using namespace Genode; using namespace Hw; /* diff --git a/repos/base-linux/src/lib/base/thread_env.cc b/repos/base-linux/src/lib/base/thread_env.cc index d7523d68a2..e2a5b51518 100644 --- a/repos/base-linux/src/lib/base/thread_env.cc +++ b/repos/base-linux/src/lib/base/thread_env.cc @@ -18,8 +18,12 @@ #include +/* base-internal includes */ +#include + using namespace Genode; + extern addr_t * __initial_sp; /* @@ -73,7 +77,7 @@ void lx_exception_signal_handlers() ** Startup library support ** *****************************/ -void prepare_init_main_thread() +void Genode::prepare_init_main_thread() { /* * Initialize the 'lx_environ' pointer diff --git a/repos/base-nova/src/lib/base/stack.cc b/repos/base-nova/src/lib/base/stack.cc index ae5be5605e..313974d42a 100644 --- a/repos/base-nova/src/lib/base/stack.cc +++ b/repos/base-nova/src/lib/base/stack.cc @@ -22,6 +22,7 @@ #include /* base-internal includes */ +#include #include #include #include @@ -72,10 +73,8 @@ Initial_cap_range &initial_cap_range() ** Startup library support ** *****************************/ -void prepare_init_main_thread() +void Genode::prepare_init_main_thread() { - using namespace Genode; - cap_map().insert(initial_cap_range()); /* for Core we can't perform the following code so early */ diff --git a/repos/base-okl4/src/lib/base/thread_bootstrap.cc b/repos/base-okl4/src/lib/base/thread_bootstrap.cc index cfe1b4ae0c..aa01bd65b1 100644 --- a/repos/base-okl4/src/lib/base/thread_bootstrap.cc +++ b/repos/base-okl4/src/lib/base/thread_bootstrap.cc @@ -63,7 +63,7 @@ using namespace Genode; ** Startup library support ** *****************************/ -void prepare_init_main_thread() +void Genode::prepare_init_main_thread() { /* copy thread ID to utcb */ main_thread_tid.raw = Okl4::copy_uregister_to_utcb(); diff --git a/repos/base-pistachio/src/lib/base/thread_bootstrap.cc b/repos/base-pistachio/src/lib/base/thread_bootstrap.cc index f07a3b5fae..36d74dcec8 100644 --- a/repos/base-pistachio/src/lib/base/thread_bootstrap.cc +++ b/repos/base-pistachio/src/lib/base/thread_bootstrap.cc @@ -37,7 +37,7 @@ static Thread_capability main_thread_cap(Thread_capability main_cap = { }) ** Startup library support ** *****************************/ -void prepare_init_main_thread() +void Genode::prepare_init_main_thread() { main_thread_tid = Pistachio::L4_Myself(); } diff --git a/repos/base-sel4/src/lib/base/thread_bootstrap.cc b/repos/base-sel4/src/lib/base/thread_bootstrap.cc index aa4cbae320..035b612d58 100644 --- a/repos/base-sel4/src/lib/base/thread_bootstrap.cc +++ b/repos/base-sel4/src/lib/base/thread_bootstrap.cc @@ -24,7 +24,7 @@ ** Startup library support ** *****************************/ -void prepare_init_main_thread() { } +void Genode::prepare_init_main_thread() { } /************ diff --git a/repos/base/src/include/base/internal/globals.h b/repos/base/src/include/base/internal/globals.h index 618a6183b4..ee904dc2c3 100644 --- a/repos/base/src/include/base/internal/globals.h +++ b/repos/base/src/include/base/internal/globals.h @@ -57,6 +57,7 @@ namespace Genode { Id_space &env_session_id_space(); Env &internal_env(); + void prepare_init_main_thread(); void bootstrap_component(); void binary_ready_hook_for_platform(); } diff --git a/repos/base/src/lib/startup/init_main_thread.cc b/repos/base/src/lib/startup/init_main_thread.cc index 0b95c89da4..a3d6f954ff 100644 --- a/repos/base/src/lib/startup/init_main_thread.cc +++ b/repos/base/src/lib/startup/init_main_thread.cc @@ -28,8 +28,6 @@ addr_t init_main_thread_result; namespace Genode { extern Region_map * env_stack_area_region_map; } -void prepare_init_main_thread(); - enum { MAIN_THREAD_STACK_SIZE = 16*1024 }; @@ -87,7 +85,6 @@ Main_thread * main_thread() */ extern "C" void init_main_thread() { - /* do platform specific preparation */ prepare_init_main_thread(); init_platform();