This source file includes following definitions.
- splpar_spin_yield
- splpar_rw_yield
1
2
3
4
5
6
7
8
9
10
11 #include <linux/kernel.h>
12 #include <linux/spinlock.h>
13 #include <linux/export.h>
14 #include <linux/smp.h>
15
16
17 #if defined(CONFIG_PPC_SPLPAR)
18 #include <asm/hvcall.h>
19 #include <asm/smp.h>
20
21 void splpar_spin_yield(arch_spinlock_t *lock)
22 {
23 unsigned int lock_value, holder_cpu, yield_count;
24
25 lock_value = lock->slock;
26 if (lock_value == 0)
27 return;
28 holder_cpu = lock_value & 0xffff;
29 BUG_ON(holder_cpu >= NR_CPUS);
30 yield_count = be32_to_cpu(lppaca_of(holder_cpu).yield_count);
31 if ((yield_count & 1) == 0)
32 return;
33 rmb();
34 if (lock->slock != lock_value)
35 return;
36 plpar_hcall_norets(H_CONFER,
37 get_hard_smp_processor_id(holder_cpu), yield_count);
38 }
39 EXPORT_SYMBOL_GPL(splpar_spin_yield);
40
41
42
43
44
45
46 void splpar_rw_yield(arch_rwlock_t *rw)
47 {
48 int lock_value;
49 unsigned int holder_cpu, yield_count;
50
51 lock_value = rw->lock;
52 if (lock_value >= 0)
53 return;
54 holder_cpu = lock_value & 0xffff;
55 BUG_ON(holder_cpu >= NR_CPUS);
56 yield_count = be32_to_cpu(lppaca_of(holder_cpu).yield_count);
57 if ((yield_count & 1) == 0)
58 return;
59 rmb();
60 if (rw->lock != lock_value)
61 return;
62 plpar_hcall_norets(H_CONFER,
63 get_hard_smp_processor_id(holder_cpu), yield_count);
64 }
65 #endif