forked from Imagelibrary/rtems
bsp/leon3: Fix LEON3_Cpu_Index initialization
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user