diff options
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/startup/bspstart.c')
-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 +); |