diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-21 09:10:28 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-21 15:54:18 +0200 |
commit | 4c927c79004069fe98c20c79bdbcef596114786c (patch) | |
tree | e4f70944b10ad045ccc4fd6644a968ab3caa9edd /c/src/lib/libbsp/sparc/leon3/startup/bspstart.c | |
parent | sptests/spcpucounter01: Resurrect workaround (diff) | |
download | rtems-4c927c79004069fe98c20c79bdbcef596114786c.tar.bz2 |
bsp/leon3: Fix LEON3_Cpu_Index initialization
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/sparc/leon3/startup/bspstart.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c index ec041f182d..35fe233561 100644 --- a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c +++ b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c @@ -19,6 +19,7 @@ #include <bsp.h> #include <leon.h> #include <bsp/bootcard.h> +#include <rtems/sysinit.h> #if defined(RTEMS_SMP) || defined(RTEMS_MULTIPROCESSING) /* Irq used by shared memory driver and for inter-processor interrupts. @@ -58,12 +59,21 @@ void bsp_start( void ) { CPU_SPARC_HAS_SNOOPING = set_snooping(); + leon3_cpu_counter_initialize(); +} + +static void leon3_cpu_index_init(void) +{ /* Get the LEON3 CPU index, normally 0, but for MP systems we do * _not_ assume that this is CPU0. One may run another OS on CPU0 * and RTEMS on this CPU, and AMP system with mixed operating * systems */ LEON3_Cpu_Index = _LEON3_Get_current_processor(); - - leon3_cpu_counter_initialize(); } + +RTEMS_SYSINIT_ITEM( + leon3_cpu_index_init, + RTEMS_SYSINIT_BSP_START, + RTEMS_SYSINIT_ORDER_FIRST +); |