提交 fb380aad 编写于 作者: H Heiko Carstens 提交者: Martin Schwidefsky

[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: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 957a37ad
...@@ -15,12 +15,20 @@ ...@@ -15,12 +15,20 @@
#ifndef __SIGP__ #ifndef __SIGP__
#define __SIGP__ #define __SIGP__
#include <asm/ptrace.h> #include <asm/system.h>
#include <asm/atomic.h>
/* get real cpu address from logical cpu number */ /* get real cpu address from logical cpu number */
extern int __cpu_logical_map[]; extern int __cpu_logical_map[];
static inline int cpu_logical_map(int cpu)
{
#ifdef CONFIG_SMP
return __cpu_logical_map[cpu];
#else
return stap();
#endif
}
typedef enum typedef enum
{ {
sigp_unassigned=0x0, sigp_unassigned=0x0,
...@@ -79,7 +87,7 @@ signal_processor(__u16 cpu_addr, sigp_order_code order_code) ...@@ -79,7 +87,7 @@ signal_processor(__u16 cpu_addr, sigp_order_code order_code)
" ipm %0\n" " ipm %0\n"
" srl %0,28\n" " srl %0,28\n"
: "=d" (ccode) : "=d" (ccode)
: "d" (reg1), "d" (__cpu_logical_map[cpu_addr]), : "d" (reg1), "d" (cpu_logical_map(cpu_addr)),
"a" (order_code) : "cc" , "memory"); "a" (order_code) : "cc" , "memory");
return ccode; return ccode;
} }
...@@ -98,7 +106,7 @@ signal_processor_p(__u32 parameter, __u16 cpu_addr, sigp_order_code order_code) ...@@ -98,7 +106,7 @@ signal_processor_p(__u32 parameter, __u16 cpu_addr, sigp_order_code order_code)
" ipm %0\n" " ipm %0\n"
" srl %0,28\n" " srl %0,28\n"
: "=d" (ccode) : "=d" (ccode)
: "d" (reg1), "d" (__cpu_logical_map[cpu_addr]), : "d" (reg1), "d" (cpu_logical_map(cpu_addr)),
"a" (order_code) : "cc" , "memory"); "a" (order_code) : "cc" , "memory");
return ccode; return ccode;
} }
...@@ -118,7 +126,7 @@ signal_processor_ps(__u32 *statusptr, __u32 parameter, __u16 cpu_addr, ...@@ -118,7 +126,7 @@ signal_processor_ps(__u32 *statusptr, __u32 parameter, __u16 cpu_addr,
" ipm %0\n" " ipm %0\n"
" srl %0,28\n" " srl %0,28\n"
: "=d" (ccode), "+d" (reg1) : "=d" (ccode), "+d" (reg1)
: "d" (__cpu_logical_map[cpu_addr]), "a" (order_code) : "d" (cpu_logical_map(cpu_addr)), "a" (order_code)
: "cc" , "memory"); : "cc" , "memory");
*statusptr = reg1; *statusptr = reg1;
return ccode; return ccode;
......
...@@ -87,7 +87,6 @@ unsigned long elf_hwcap = 0; ...@@ -87,7 +87,6 @@ unsigned long elf_hwcap = 0;
char elf_platform[ELF_PLATFORM_SIZE]; char elf_platform[ELF_PLATFORM_SIZE];
struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS]; struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS];
int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */
int __initdata memory_end_set; int __initdata memory_end_set;
unsigned long __initdata memory_end; unsigned long __initdata memory_end;
......
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
#include <asm/cpu.h> #include <asm/cpu.h>
#include "entry.h" #include "entry.h"
/* logical cpu to cpu address */
int __cpu_logical_map[NR_CPUS];
static struct task_struct *current_set[NR_CPUS]; static struct task_struct *current_set[NR_CPUS];
static u8 smp_cpu_type; static u8 smp_cpu_type;
......
...@@ -114,7 +114,7 @@ static void add_cpus_to_core(struct tl_cpu *tl_cpu, struct core_info *core) ...@@ -114,7 +114,7 @@ static void add_cpus_to_core(struct tl_cpu *tl_cpu, struct core_info *core)
rcpu = CPU_BITS - 1 - cpu + tl_cpu->origin; rcpu = CPU_BITS - 1 - cpu + tl_cpu->origin;
for_each_present_cpu(lcpu) { for_each_present_cpu(lcpu) {
if (__cpu_logical_map[lcpu] == rcpu) { if (cpu_logical_map(lcpu) == rcpu) {
cpu_set(lcpu, core->mask); cpu_set(lcpu, core->mask);
smp_cpu_polarization[lcpu] = tl_cpu->pp; smp_cpu_polarization[lcpu] = tl_cpu->pp;
} }
......
...@@ -34,7 +34,7 @@ static inline void _raw_yield_cpu(int cpu) ...@@ -34,7 +34,7 @@ static inline void _raw_yield_cpu(int cpu)
{ {
if (MACHINE_HAS_DIAG9C) if (MACHINE_HAS_DIAG9C)
asm volatile("diag %0,0,0x9c" asm volatile("diag %0,0,0x9c"
: : "d" (__cpu_logical_map[cpu])); : : "d" (cpu_logical_map(cpu)));
else else
_raw_yield(); _raw_yield();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册