]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[S390] New get_cpu_id() inline assembly
authorMichael Holzheu <holzheu@de.ibm.com>
Wed, 21 Feb 2007 09:55:18 +0000 (10:55 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 21 Feb 2007 09:55:18 +0000 (10:55 +0100)
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>
arch/s390/kernel/early.c
arch/s390/kernel/setup.c
include/asm-s390/processor.h

index e518dd53eff52408f0b7427d181efd4715145e75..011e8c7acc7ebc327b417586c5b5532172c919b5 100644 (file)
@@ -129,7 +129,7 @@ static noinline __init void detect_machine_type(void)
 {
        struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data;
 
-       asm volatile("stidp %0" : "=m" (S390_lowcore.cpu_data.cpu_id));
+       get_cpu_id(&S390_lowcore.cpu_data.cpu_id);
 
        /* Running under z/VM ? */
        if (cpuinfo->cpu_id.version == 0xff)
index 50c5210fbc64e078683e6d58a67787df7d1c4403..49567d8cd9a18c2aad2a82e45ba0054d3ea7fa79 100644 (file)
@@ -106,7 +106,7 @@ void __devinit cpu_init (void)
         /*
          * Store processor id in lowcore (used e.g. in timer_interrupt)
          */
-       asm volatile("stidp %0": "=m" (S390_lowcore.cpu_data.cpu_id));
+       get_cpu_id(&S390_lowcore.cpu_data.cpu_id);
         S390_lowcore.cpu_data.cpu_addr = addr;
 
         /*
index 4c1b739403519839aa8a0b50d37191e66e07816f..33b80ced4bc1767546af9afe44f75abfe2d61dec 100644 (file)
@@ -36,6 +36,11 @@ typedef struct
         unsigned int unused  : 16;
 } __attribute__ ((packed)) cpuid_t;
 
+static inline void get_cpu_id(cpuid_t *ptr)
+{
+       asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr));
+}
+
 struct cpuinfo_S390
 {
         cpuid_t  cpu_id;