From a1ae1f399a6dd83dad41e06f9b15b697bc0ed186 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 23 Apr 2015 09:46:05 +0200 Subject: [PATCH] Fix slp_switch assembly for the s390 arch Use inline assembly to generate the correct return value. --- platform/switch_s390_unix.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/switch_s390_unix.h b/platform/switch_s390_unix.h index 88a42a6a..6641854e 100644 --- a/platform/switch_s390_unix.h +++ b/platform/switch_s390_unix.h @@ -36,6 +36,7 @@ static int slp_switch(void) { + register int ret; register long *stackref, stsizediff; __asm__ volatile ("" : : : REGS_TO_SAVE); #ifdef __s390x__ @@ -68,7 +69,8 @@ slp_switch(void) SLP_RESTORE_STATE(); } __asm__ volatile ("" : : : REGS_TO_SAVE); - return 0; + __asm__ volatile ("lhi %0, 0" : "=r" (ret) : ); + return ret; } #endif