Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72960a02 authored by Michael Holzheu's avatar Michael Holzheu Committed by Martin Schwidefsky
Browse files

[S390] New get_cpu_id() inline assembly



Replace two stidp inline assemblies with one global implementation.

Signed-off-by: default avatarMichael Holzheu <holzheu@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 6c732de2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -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;

        /*
+5 −0
Original line number Diff line number Diff line
@@ -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;