Commit 4f896e53 authored by Stephen Rothwell's avatar Stephen Rothwell

[POWERPC] make spinlocks work in a combined kernel

If we build a pSeries/iSeries combined kernel, we will need this.
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
parent 7dcd86e1
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <asm/hvcall.h> #include <asm/hvcall.h>
#include <asm/iseries/hv_call.h> #include <asm/iseries/hv_call.h>
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/firmware.h>
void __spin_yield(raw_spinlock_t *lock) void __spin_yield(raw_spinlock_t *lock)
{ {
...@@ -39,13 +40,12 @@ void __spin_yield(raw_spinlock_t *lock) ...@@ -39,13 +40,12 @@ void __spin_yield(raw_spinlock_t *lock)
rmb(); rmb();
if (lock->slock != lock_value) if (lock->slock != lock_value)
return; /* something has changed */ return; /* something has changed */
#ifdef CONFIG_PPC_ISERIES if (firmware_has_feature(FW_FEATURE_ISERIES))
HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc, HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc,
((u64)holder_cpu << 32) | yield_count); ((u64)holder_cpu << 32) | yield_count);
#else else
plpar_hcall_norets(H_CONFER, get_hard_smp_processor_id(holder_cpu), plpar_hcall_norets(H_CONFER,
yield_count); get_hard_smp_processor_id(holder_cpu), yield_count);
#endif
} }
/* /*
...@@ -69,13 +69,12 @@ void __rw_yield(raw_rwlock_t *rw) ...@@ -69,13 +69,12 @@ void __rw_yield(raw_rwlock_t *rw)
rmb(); rmb();
if (rw->lock != lock_value) if (rw->lock != lock_value)
return; /* something has changed */ return; /* something has changed */
#ifdef CONFIG_PPC_ISERIES if (firmware_has_feature(FW_FEATURE_ISERIES))
HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc, HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc,
((u64)holder_cpu << 32) | yield_count); ((u64)holder_cpu << 32) | yield_count);
#else else
plpar_hcall_norets(H_CONFER, get_hard_smp_processor_id(holder_cpu), plpar_hcall_norets(H_CONFER,
yield_count); get_hard_smp_processor_id(holder_cpu), yield_count);
#endif
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment