summaryrefslogtreecommitdiffstats
path: root/arch/sparc/vdso
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-10-17 21:28:01 -0700
committerDavid S. Miller <davem@davemloft.net>2018-10-17 21:29:23 -0700
commit776ca1543b5fe673aaf1beb244fcc2429d378083 (patch)
treec40d5e40a9a3746b21520c2d57a45d0de01ed6fe /arch/sparc/vdso
parentc343db455eb3105f11bb5ac290d77ab2006b0209 (diff)
downloadlinux-776ca1543b5fe673aaf1beb244fcc2429d378083.tar.bz2
sparc: Fix syscall fallback bugs in VDSO.
First, the trap number for 32-bit syscalls is 0x10. Also, only negate the return value when syscall error is indicated by the carry bit being set. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/vdso')
-rw-r--r--arch/sparc/vdso/vclock_gettime.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/sparc/vdso/vclock_gettime.c b/arch/sparc/vdso/vclock_gettime.c
index 3feb3d960ca5..75dca9aab737 100644
--- a/arch/sparc/vdso/vclock_gettime.c
+++ b/arch/sparc/vdso/vclock_gettime.c
@@ -33,9 +33,19 @@
#define TICK_PRIV_BIT (1ULL << 63)
#endif
+#ifdef CONFIG_SPARC64
#define SYSCALL_STRING \
"ta 0x6d;" \
- "sub %%g0, %%o0, %%o0;" \
+ "bcs,a 1f;" \
+ " sub %%g0, %%o0, %%o0;" \
+ "1:"
+#else
+#define SYSCALL_STRING \
+ "ta 0x10;" \
+ "bcs,a 1f;" \
+ " sub %%g0, %%o0, %%o0;" \
+ "1:"
+#endif
#define SYSCALL_CLOBBERS \
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \