sparc: Add LEON3_ASR17_PROCESSOR_INDEX_SHIFT

Add _LEON3_Get_current_processor().
This commit is contained in:
Sebastian Huber
2014-02-13 13:00:00 +01:00
parent 945853b7cf
commit ad563618ca
6 changed files with 20 additions and 17 deletions

View File

@@ -123,7 +123,7 @@ extern volatile struct irqmp_regs *LEON3_IrqCtrl_Regs; /* LEON3 Interrupt Contr
extern volatile struct gptimer_regs *LEON3_Timer_Regs; /* LEON3 GP Timer */
/* LEON3 CPU Index of boot CPU */
extern int LEON3_Cpu_Index;
extern uint32_t LEON3_Cpu_Index;
/* The external IRQ number, -1 if not external interrupts */
extern int LEON3_IrqCtrl_EIrq;

View File

@@ -17,9 +17,6 @@
uint32_t _CPU_SMP_Get_current_processor( void )
{
uint32_t id;
__asm__ __volatile__( "rd %%asr17,%0\n\t" : "=r" (id) : );
return ((id >> 28) & 0xff);
return _LEON3_Get_current_processor();
}

View File

@@ -27,7 +27,7 @@
int CPU_SPARC_HAS_SNOOPING;
/* Index of CPU, in an AMP system CPU-index may be non-zero */
int LEON3_Cpu_Index = 0;
uint32_t LEON3_Cpu_Index = 0;
extern void amba_initialize(void);
@@ -50,14 +50,6 @@ static inline int set_snooping(void)
return (tmp >> 23) & 1;
}
/* ASM-function used to get the CPU-Index on calling LEON3 CPUs */
static inline unsigned int get_asr17(void)
{
unsigned int reg;
__asm__ (" mov %%asr17, %0 " : "=r"(reg) :);
return reg;
}
/*
* bsp_start
*
@@ -72,7 +64,7 @@ void bsp_start( void )
* and RTEMS on this CPU, and AMP system with mixed operating
* systems
*/
LEON3_Cpu_Index = (get_asr17() >> 28) & 3;
LEON3_Cpu_Index = _LEON3_Get_current_processor();
/* Scan AMBA Plug&Play and parse it into a RAM description (ambapp_plb),
* find GPTIMER for bus frequency, find IRQ Controller and initialize