bsp/leon3: Fix LEON3_Cpu_Index initialization

This commit is contained in:
Sebastian Huber
2016-06-21 09:10:28 +02:00
parent 7222a65f0e
commit 4c927c7900
3 changed files with 14 additions and 4 deletions

View File

@@ -162,5 +162,5 @@ static void amba_initialize(void)
RTEMS_SYSINIT_ITEM(
amba_initialize,
RTEMS_SYSINIT_BSP_START,
RTEMS_SYSINIT_ORDER_FIRST
RTEMS_SYSINIT_ORDER_SECOND
);

View File

@@ -80,7 +80,7 @@ static void bsp_debug_uart_init(void)
RTEMS_SYSINIT_ITEM(
bsp_debug_uart_init,
RTEMS_SYSINIT_BSP_START,
RTEMS_SYSINIT_ORDER_THIRD
RTEMS_SYSINIT_ORDER_FOURTH
);
/* putchar/getchar for printk */

View File

@@ -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
);