diff options
author | Thomas Richter <tmricht@linux.vnet.ibm.com> | 2017-09-11 13:49:01 +0300 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2017-09-18 19:52:01 +0300 |
commit | 96e5335859e30fa2bb2da8befc86292c3c1a73dd (patch) | |
tree | 024f9a3556510e1c8efdccc25e3747880aa693a2 /tools/testing | |
parent | 64cfcaed7b25f69d8b7a091a23961f50c6788a66 (diff) | |
download | linux-96e5335859e30fa2bb2da8befc86292c3c1a73dd.tar.xz |
tools: fix testing/selftests/sigaltstack for s390x
On s390x the compilation of the file sas.c in directory
tools/testing/selftests/sigaltstack fails with this error message:
root@s35lp76 testing]# make selftests/sigaltstack/sas
cc selftests/sigaltstack/sas.c -o selftests/sigaltstack/sas
selftests/sigaltstack/sas.c: In function ‘my_usr1’:
selftests/sigaltstack/sas.c:42:25: error: invalid register name for ‘sp’
register unsigned long sp asm("sp");
^~
<builtin>: recipe for target 'selftests/sigaltstack/sas' failed
make: *** [selftests/sigaltstack/sas] Error 1
[root@s35lp76 testing]#
On s390x the stack pointer is register r15, the register name "sp"
is unknown.
Make this line platform dependend and use register r15.
With this patch the compilation and test succeeds:
[root@s35lp76 testing]# ./selftests/sigaltstack/sas
TAP version 13
ok 1 Initial sigaltstack state was SS_DISABLE
# [RUN] signal USR1
ok 2 sigaltstack is disabled in sighandler
# [RUN] switched to user ctx
# [RUN] signal USR2
# [OK] Stack preserved
ok 3 sigaltstack is still SS_AUTODISARM after signal
Pass 3 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0
1..3
[root@s35lp76 testing]#
Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing')
-rw-r--r-- | tools/testing/selftests/sigaltstack/sas.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/sigaltstack/sas.c b/tools/testing/selftests/sigaltstack/sas.c index 7d406c3973ba..97bb150837df 100644 --- a/tools/testing/selftests/sigaltstack/sas.c +++ b/tools/testing/selftests/sigaltstack/sas.c @@ -39,7 +39,11 @@ void my_usr1(int sig, siginfo_t *si, void *u) stack_t stk; struct stk_data *p; +#if __s390x__ + register unsigned long sp asm("%15"); +#else register unsigned long sp asm("sp"); +#endif if (sp < (unsigned long)sstack || sp >= (unsigned long)sstack + SIGSTKSZ) { |