powerpc: Add _CPU_Get_current_per_CPU_control()

Add _CPU_Get_current_per_CPU_control() on SMP configurations.  Use SPRG0
for the current per-CPU control.  This reduces the code size by three
instructions and is slightly faster.

Update #2805.
This commit is contained in:
Sebastian Huber
2016-11-09 14:59:33 +01:00
parent 58bced64b9
commit 38a1449fd4
5 changed files with 2641 additions and 2603 deletions

View File

@@ -936,13 +936,20 @@ void ShowBATS(void);
mtmsr \level
.endm
.macro GET_SELF_CPU_CONTROL reg
#if defined(RTEMS_SMP)
.macro SET_SELF_CPU_CONTROL reg
/* Use Book E Processor ID Register (PIR) */
mfspr \reg, 286
slwi \reg, \reg, PER_CPU_CONTROL_SIZE_LOG2
addis \reg, \reg, _Per_CPU_Information@ha
addi \reg, \reg, _Per_CPU_Information@l
mtspr PPC_PER_CPU_CONTROL_REGISTER, \reg
.endm
#endif
.macro GET_SELF_CPU_CONTROL reg
#if defined(RTEMS_SMP)
mfspr \reg, PPC_PER_CPU_CONTROL_REGISTER
#else
lis \reg, _Per_CPU_Information@h
ori \reg, \reg, _Per_CPU_Information@l