aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2019-01-08 00:04:16 +1000
committerStewart Smith <stewart@linux.ibm.com>2019-02-12 15:08:17 +1100
commit9e075d75274c50da4135c55afccc9f6d24dd2cfe (patch)
treef62863b16cbd15738eda58774f8f71605933d573 /core
parent0d44d7f7d29d0ed49f526962fc8a0e6bb69791be (diff)
downloadskiboot-9e075d75274c50da4135c55afccc9f6d24dd2cfe.zip
skiboot-9e075d75274c50da4135c55afccc9f6d24dd2cfe.tar.gz
skiboot-9e075d75274c50da4135c55afccc9f6d24dd2cfe.tar.bz2
core/cpu: do not inline cpu_relax
The added nops now push it up in size, and -Os uninlines it for every compilation unit that calls it more than once, so it's much better to just uninline. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/cpu.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/cpu.c b/core/cpu.c
index 1542776..ad64b6e 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -91,6 +91,18 @@ unsigned long __attrconst cpu_emergency_stack_top(unsigned int pir)
NORMAL_STACK_SIZE + EMERGENCY_STACK_SIZE - STACK_TOP_GAP;
}
+void __nomcount cpu_relax(void)
+{
+ /* Relax a bit to give sibling threads some breathing space */
+ smt_lowest();
+ asm volatile("nop; nop; nop; nop;\n"
+ "nop; nop; nop; nop;\n"
+ "nop; nop; nop; nop;\n"
+ "nop; nop; nop; nop;\n");
+ smt_medium();
+ barrier();
+}
+
static void cpu_wake(struct cpu_thread *cpu)
{
/* Is it idle ? If not, no need to wake */