diff options
| author | Michael Holzheu <holzheu@de.ibm.com> | 2007-02-21 04:55:18 -0500 |
|---|---|---|
| committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-02-21 04:55:18 -0500 |
| commit | 72960a02c270950253126ee8b339afd400f55273 (patch) | |
| tree | 3dec1f231bac88c2457af8a33b146b7df25df603 | |
| parent | 6c732de2d3673e28c6a976c98ee6ba4d197a919a (diff) | |
[S390] New get_cpu_id() inline assembly
Replace two stidp inline assemblies with one global implementation.
Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
| -rw-r--r-- | arch/s390/kernel/early.c | 2 | ||||
| -rw-r--r-- | arch/s390/kernel/setup.c | 2 | ||||
| -rw-r--r-- | include/asm-s390/processor.h | 5 |
3 files changed, 7 insertions, 2 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index e518dd53eff5..011e8c7acc7e 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
| @@ -129,7 +129,7 @@ static noinline __init void detect_machine_type(void) | |||
| 129 | { | 129 | { |
| 130 | struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data; | 130 | struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data; |
| 131 | 131 | ||
| 132 | asm volatile("stidp %0" : "=m" (S390_lowcore.cpu_data.cpu_id)); | 132 | get_cpu_id(&S390_lowcore.cpu_data.cpu_id); |
| 133 | 133 | ||
| 134 | /* Running under z/VM ? */ | 134 | /* Running under z/VM ? */ |
| 135 | if (cpuinfo->cpu_id.version == 0xff) | 135 | if (cpuinfo->cpu_id.version == 0xff) |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 50c5210fbc64..49567d8cd9a1 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
| @@ -106,7 +106,7 @@ void __devinit cpu_init (void) | |||
| 106 | /* | 106 | /* |
| 107 | * Store processor id in lowcore (used e.g. in timer_interrupt) | 107 | * Store processor id in lowcore (used e.g. in timer_interrupt) |
| 108 | */ | 108 | */ |
| 109 | asm volatile("stidp %0": "=m" (S390_lowcore.cpu_data.cpu_id)); | 109 | get_cpu_id(&S390_lowcore.cpu_data.cpu_id); |
| 110 | S390_lowcore.cpu_data.cpu_addr = addr; | 110 | S390_lowcore.cpu_data.cpu_addr = addr; |
| 111 | 111 | ||
| 112 | /* | 112 | /* |
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 4c1b73940351..33b80ced4bc1 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h | |||
| @@ -36,6 +36,11 @@ typedef struct | |||
| 36 | unsigned int unused : 16; | 36 | unsigned int unused : 16; |
| 37 | } __attribute__ ((packed)) cpuid_t; | 37 | } __attribute__ ((packed)) cpuid_t; |
| 38 | 38 | ||
| 39 | static inline void get_cpu_id(cpuid_t *ptr) | ||
| 40 | { | ||
| 41 | asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr)); | ||
| 42 | } | ||
| 43 | |||
| 39 | struct cpuinfo_S390 | 44 | struct cpuinfo_S390 |
| 40 | { | 45 | { |
| 41 | cpuid_t cpu_id; | 46 | cpuid_t cpu_id; |
