aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/lib
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2006-08-23 23:29:33 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2006-09-20 00:01:16 -0400
commit4f896e53eea70013fa48d0d8662680cf8aae8a43 (patch)
tree4a22e8033ac46f4a801e79e8002b60d792efd6cf /arch/powerpc/lib
parent7dcd86e14319f4ceab883787ab2e00a5f860d14d (diff)
[POWERPC] make spinlocks work in a combined kernel
If we build a pSeries/iSeries combined kernel, we will need this. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r--arch/powerpc/lib/locks.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c
index 077bed7dc52b..80b482ca30df 100644
--- a/arch/powerpc/lib/locks.c
+++ b/arch/powerpc/lib/locks.c
@@ -23,6 +23,7 @@
23#include <asm/hvcall.h> 23#include <asm/hvcall.h>
24#include <asm/iseries/hv_call.h> 24#include <asm/iseries/hv_call.h>
25#include <asm/smp.h> 25#include <asm/smp.h>
26#include <asm/firmware.h>
26 27
27void __spin_yield(raw_spinlock_t *lock) 28void __spin_yield(raw_spinlock_t *lock)
28{ 29{
@@ -39,13 +40,12 @@ void __spin_yield(raw_spinlock_t *lock)
39 rmb(); 40 rmb();
40 if (lock->slock != lock_value) 41 if (lock->slock != lock_value)
41 return; /* something has changed */ 42 return; /* something has changed */
42#ifdef CONFIG_PPC_ISERIES 43 if (firmware_has_feature(FW_FEATURE_ISERIES))
43 HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc, 44 HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc,
44 ((u64)holder_cpu << 32) | yield_count); 45 ((u64)holder_cpu << 32) | yield_count);
45#else 46 else
46 plpar_hcall_norets(H_CONFER, get_hard_smp_processor_id(holder_cpu), 47 plpar_hcall_norets(H_CONFER,
47 yield_count); 48 get_hard_smp_processor_id(holder_cpu), yield_count);
48#endif
49} 49}
50 50
51/* 51/*
@@ -69,13 +69,12 @@ void __rw_yield(raw_rwlock_t *rw)
69 rmb(); 69 rmb();
70 if (rw->lock != lock_value) 70 if (rw->lock != lock_value)
71 return; /* something has changed */ 71 return; /* something has changed */
72#ifdef CONFIG_PPC_ISERIES 72 if (firmware_has_feature(FW_FEATURE_ISERIES))
73 HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc, 73 HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc,
74 ((u64)holder_cpu << 32) | yield_count); 74 ((u64)holder_cpu << 32) | yield_count);
75#else 75 else
76 plpar_hcall_norets(H_CONFER, get_hard_smp_processor_id(holder_cpu), 76 plpar_hcall_norets(H_CONFER,
77 yield_count); 77 get_hard_smp_processor_id(holder_cpu), yield_count);
78#endif
79} 78}
80#endif 79#endif
81 80