aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-05-29 16:49:41 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-05-29 16:49:41 +1000
commit9daee5c3edab395b6a2e729b3fe3728dbc7e4bf6 (patch)
tree4b152274bbfb735b8eb54d3e5fd8c1a02238686c /include
parent067852584a7c8f0cecfdf1d3295b9de5dff07215 (diff)
downloadskiboot-9daee5c3edab395b6a2e729b3fe3728dbc7e4bf6.zip
skiboot-9daee5c3edab395b6a2e729b3fe3728dbc7e4bf6.tar.gz
skiboot-9daee5c3edab395b6a2e729b3fe3728dbc7e4bf6.tar.bz2
Make cpu_relax() inline
This modifies code output when built with GCOV so that the store of counter data is out of some of the loops, thus improving things when built with gcov. Also, likely makes us do even less work when relaxing, so probably a good thing. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r--include/cpu.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/cpu.h b/include/cpu.h
index 2bf15ea..d2c1825 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -102,7 +102,17 @@ extern unsigned int cpu_thread_count;
/* Boot CPU. */
extern struct cpu_thread *boot_cpu;
-extern void cpu_relax(void);
+static inline void __nomcount cpu_relax(void)
+{
+ /* Relax a bit to give sibling threads some breathing space */
+ smt_low();
+ smt_very_low();
+ asm volatile("nop; nop; nop; nop;\n"
+ "nop; nop; nop; nop;\n"
+ "nop; nop; nop; nop;\n"
+ "nop; nop; nop; nop;\n");
+ smt_medium();
+}
/* Initialize CPUs */
void pre_init_boot_cpu(void);