diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2010-01-13 14:44:37 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-01-13 14:44:45 -0500 |
commit | fb380aadfe34e8d3ce628cb3e386882351940874 (patch) | |
tree | 2607a2f3ee9732516d01a2e5083fbea0476491bb /arch/s390 | |
parent | 957a37ad587f3ef1022f1fe434d818cbed38eb95 (diff) |
[S390] Move __cpu_logical_map to smp.c
Finally move it to the place where it belongs to and make get rid of
it for !CONFIG_SMP.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/include/asm/sigp.h | 18 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 1 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 3 | ||||
-rw-r--r-- | arch/s390/kernel/topology.c | 2 | ||||
-rw-r--r-- | arch/s390/lib/spinlock.c | 2 |
5 files changed, 18 insertions, 8 deletions
diff --git a/arch/s390/include/asm/sigp.h b/arch/s390/include/asm/sigp.h index 0cc620a6a2cc..f72d611f7e13 100644 --- a/arch/s390/include/asm/sigp.h +++ b/arch/s390/include/asm/sigp.h | |||
@@ -15,12 +15,20 @@ | |||
15 | #ifndef __SIGP__ | 15 | #ifndef __SIGP__ |
16 | #define __SIGP__ | 16 | #define __SIGP__ |
17 | 17 | ||
18 | #include <asm/ptrace.h> | 18 | #include <asm/system.h> |
19 | #include <asm/atomic.h> | ||
20 | 19 | ||
21 | /* get real cpu address from logical cpu number */ | 20 | /* get real cpu address from logical cpu number */ |
22 | extern int __cpu_logical_map[]; | 21 | extern int __cpu_logical_map[]; |
23 | 22 | ||
23 | static inline int cpu_logical_map(int cpu) | ||
24 | { | ||
25 | #ifdef CONFIG_SMP | ||
26 | return __cpu_logical_map[cpu]; | ||
27 | #else | ||
28 | return stap(); | ||
29 | #endif | ||
30 | } | ||
31 | |||
24 | typedef enum | 32 | typedef enum |
25 | { | 33 | { |
26 | sigp_unassigned=0x0, | 34 | sigp_unassigned=0x0, |
@@ -79,7 +87,7 @@ signal_processor(__u16 cpu_addr, sigp_order_code order_code) | |||
79 | " ipm %0\n" | 87 | " ipm %0\n" |
80 | " srl %0,28\n" | 88 | " srl %0,28\n" |
81 | : "=d" (ccode) | 89 | : "=d" (ccode) |
82 | : "d" (reg1), "d" (__cpu_logical_map[cpu_addr]), | 90 | : "d" (reg1), "d" (cpu_logical_map(cpu_addr)), |
83 | "a" (order_code) : "cc" , "memory"); | 91 | "a" (order_code) : "cc" , "memory"); |
84 | return ccode; | 92 | return ccode; |
85 | } | 93 | } |
@@ -98,7 +106,7 @@ signal_processor_p(__u32 parameter, __u16 cpu_addr, sigp_order_code order_code) | |||
98 | " ipm %0\n" | 106 | " ipm %0\n" |
99 | " srl %0,28\n" | 107 | " srl %0,28\n" |
100 | : "=d" (ccode) | 108 | : "=d" (ccode) |
101 | : "d" (reg1), "d" (__cpu_logical_map[cpu_addr]), | 109 | : "d" (reg1), "d" (cpu_logical_map(cpu_addr)), |
102 | "a" (order_code) : "cc" , "memory"); | 110 | "a" (order_code) : "cc" , "memory"); |
103 | return ccode; | 111 | return ccode; |
104 | } | 112 | } |
@@ -118,7 +126,7 @@ signal_processor_ps(__u32 *statusptr, __u32 parameter, __u16 cpu_addr, | |||
118 | " ipm %0\n" | 126 | " ipm %0\n" |
119 | " srl %0,28\n" | 127 | " srl %0,28\n" |
120 | : "=d" (ccode), "+d" (reg1) | 128 | : "=d" (ccode), "+d" (reg1) |
121 | : "d" (__cpu_logical_map[cpu_addr]), "a" (order_code) | 129 | : "d" (cpu_logical_map(cpu_addr)), "a" (order_code) |
122 | : "cc" , "memory"); | 130 | : "cc" , "memory"); |
123 | *statusptr = reg1; | 131 | *statusptr = reg1; |
124 | return ccode; | 132 | return ccode; |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 3fe1680c3899..8d8957b38ab3 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -87,7 +87,6 @@ unsigned long elf_hwcap = 0; | |||
87 | char elf_platform[ELF_PLATFORM_SIZE]; | 87 | char elf_platform[ELF_PLATFORM_SIZE]; |
88 | 88 | ||
89 | struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS]; | 89 | struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS]; |
90 | int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */ | ||
91 | 90 | ||
92 | int __initdata memory_end_set; | 91 | int __initdata memory_end_set; |
93 | unsigned long __initdata memory_end; | 92 | unsigned long __initdata memory_end; |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index eebce7fdc97c..76a6fdd46c45 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -52,6 +52,9 @@ | |||
52 | #include <asm/cpu.h> | 52 | #include <asm/cpu.h> |
53 | #include "entry.h" | 53 | #include "entry.h" |
54 | 54 | ||
55 | /* logical cpu to cpu address */ | ||
56 | int __cpu_logical_map[NR_CPUS]; | ||
57 | |||
55 | static struct task_struct *current_set[NR_CPUS]; | 58 | static struct task_struct *current_set[NR_CPUS]; |
56 | 59 | ||
57 | static u8 smp_cpu_type; | 60 | static u8 smp_cpu_type; |
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 3c72c9cf22b6..14ef6f05e432 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c | |||
@@ -114,7 +114,7 @@ static void add_cpus_to_core(struct tl_cpu *tl_cpu, struct core_info *core) | |||
114 | 114 | ||
115 | rcpu = CPU_BITS - 1 - cpu + tl_cpu->origin; | 115 | rcpu = CPU_BITS - 1 - cpu + tl_cpu->origin; |
116 | for_each_present_cpu(lcpu) { | 116 | for_each_present_cpu(lcpu) { |
117 | if (__cpu_logical_map[lcpu] == rcpu) { | 117 | if (cpu_logical_map(lcpu) == rcpu) { |
118 | cpu_set(lcpu, core->mask); | 118 | cpu_set(lcpu, core->mask); |
119 | smp_cpu_polarization[lcpu] = tl_cpu->pp; | 119 | smp_cpu_polarization[lcpu] = tl_cpu->pp; |
120 | } | 120 | } |
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c index 10754a375668..cff327f109a8 100644 --- a/arch/s390/lib/spinlock.c +++ b/arch/s390/lib/spinlock.c | |||
@@ -34,7 +34,7 @@ static inline void _raw_yield_cpu(int cpu) | |||
34 | { | 34 | { |
35 | if (MACHINE_HAS_DIAG9C) | 35 | if (MACHINE_HAS_DIAG9C) |
36 | asm volatile("diag %0,0,0x9c" | 36 | asm volatile("diag %0,0,0x9c" |
37 | : : "d" (__cpu_logical_map[cpu])); | 37 | : : "d" (cpu_logical_map(cpu))); |
38 | else | 38 | else |
39 | _raw_yield(); | 39 | _raw_yield(); |
40 | } | 40 | } |