]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[S390] Fix parameter passing for smp_switch_to_cpu()
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>
Mon, 4 Apr 2011 07:43:30 +0000 (09:43 +0200)
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>
Mon, 4 Apr 2011 07:43:32 +0000 (09:43 +0200)
After the execution has been switched to the destination CPU, the target
function is called with the wrong parameter. According to the C calling
convention on s390, the first parameter should be loaded into register 2.
Currently in smp_restart_cpu() it is stored in register 3. To fix this, we
load the parameter into the correct register 2.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/switch_cpu.S
arch/s390/kernel/switch_cpu64.S

index 469f11b574facd8a819de59fe2e6796e0f60cd35..20530dd2eab13ef9f780076edf5a6a23e2b6d9b6 100644 (file)
@@ -46,7 +46,9 @@ smp_restart_cpu:
        ltr     %r4,%r4                 /* New stack ? */
        jz      1f
        lr      %r15,%r4
-1:     basr    %r14,%r2
+1:     lr      %r14,%r2                /* r14: Function to call */
+       lr      %r2,%r3                 /* r2 : Parameter for function*/
+       basr    %r14,%r14               /* Call function */
 
 .gprregs_addr:
        .long   .gprregs
index d94aacc898cb99830bf85e458df2fd9a9e522481..5be3f43898f99584e6626f95c43210271e55c3b8 100644 (file)
@@ -42,7 +42,9 @@ smp_restart_cpu:
        ltgr    %r4,%r4                 /* New stack ? */
        jz      1f
        lgr     %r15,%r4
-1:     basr    %r14,%r2
+1:     lgr     %r14,%r2                /* r14: Function to call */
+       lgr     %r2,%r3                 /* r2 : Parameter for function*/
+       basr    %r14,%r14               /* Call function */
 
        .section .data,"aw",@progbits
 .gprregs: