From 016a9b5b80a10afc6c8c9458cd86709083632326 Mon Sep 17 00:00:00 2001 From: Luca Valente Date: Thu, 23 Mar 2023 23:09:27 +0100 Subject: [PATCH] Further cleanup. --- kernel/cluster.c | 7 +------ kernel/crt0.S | 4 +--- kernel/init.c | 10 +++------- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/kernel/cluster.c b/kernel/cluster.c index 9c9072e..c1dc034 100644 --- a/kernel/cluster.c +++ b/kernel/cluster.c @@ -25,9 +25,6 @@ L1_DATA char *cluster_stacks; static volatile int cluster_running; static volatile int cluster_retval; -#ifdef ARCHI_NO_FC -extern int main(int argc, const char * const argv[]); -#endif static void pos_wait_forever() { @@ -54,10 +51,8 @@ void cluster_entry_stub() int retval = ((int (*)())cluster_entry)(); - #ifdef ARCHI_NO_FC synch_barrier(); - #endif - + if (hal_core_id() == 0) { cluster_retval = retval; diff --git a/kernel/crt0.S b/kernel/crt0.S index 08aa06f..76142e2 100644 --- a/kernel/crt0.S +++ b/kernel/crt0.S @@ -170,7 +170,7 @@ pe_start: addi a1, a1, 1 mul x1, x3, a1 add x2, x2, x1 - j cluster_entry_stub + j cluster_entry_stub #endif do_cl_boot: @@ -179,8 +179,6 @@ do_cl_boot: la x4, _start sw x4, 0x40(x2) sw x3, 8(x2) - li x2, 0x1a109800 - sw x0, 0(x2) loop: li x2, 0x1a109800 diff --git a/kernel/init.c b/kernel/init.c index eb37908..08a1cf6 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -58,9 +58,6 @@ void pos_init_start() hal_pmu_bypass_set (ARCHI_REG_FIELD_SET (hal_pmu_bypass_get (), 1, 11, 1) ); #endif - #ifdef ARCHI_NO_FC - if(hal_core_id()==0) { - #endif pos_soc_init(); pos_irq_init(); @@ -73,7 +70,7 @@ void pos_init_start() // available for constructors, especially to let them declare // callbacks //__rt_utils_init(); - + pos_allocs_init(); // Call global and static constructors @@ -88,13 +85,12 @@ void pos_init_start() #ifdef ARCHI_NO_FC cluster_start(hal_cluster_id(), main); - } - #else + #endif + if (!hal_is_fc()) { cluster_start(hal_cluster_id(), main); } - #endif }