From 4f9704608aeed0799cbe4a2e29b50808896fa0fd Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 19 Sep 2011 08:10:14 +0000 Subject: Clear the upper 32-bits of the system call address we load using ldil, since that instruction does sign extension. Look at %r1 to determine whether a system call was sucessful, since that is where the kernel puts the information. --- lib/libc/arch/hppa64/SYS.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/arch/hppa64/SYS.h b/lib/libc/arch/hppa64/SYS.h index 33c55b3dfc3..87d86f1d721 100644 --- a/lib/libc/arch/hppa64/SYS.h +++ b/lib/libc/arch/hppa64/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.4 2011/04/21 13:29:58 jsing Exp $ */ +/* $OpenBSD: SYS.h,v 1.5 2011/09/19 08:10:13 kettenis Exp $ */ /* * Copyright (c) 1998-2002 Michael Shalayeff @@ -42,10 +42,11 @@ EXIT(__CONCAT(_thread_sys_,x)) #define SYSCALL(x) !\ std %rp, HPPA_FRAME_RP(%sr0,%sp) !\ ldil L%SYSCALLGATE, %r1 !\ + depd %r0, 31, 32, %r1 !\ ble 4(%sr7, %r1) !\ ldi __CONCAT(SYS_,x), %r1 !\ .import __cerror, code !\ - comb,<> %r0, %t1, __cerror !\ + comb,<> %r0, %r1, __cerror !\ ldd HPPA_FRAME_RP(%sr0,%sp), %rp #define PSEUDO(x,y) !\ @@ -59,6 +60,7 @@ SYSEXIT(x) SYSENTRY(x) !\ std %rp, HPPA_FRAME_RP(%sr0,%sp) !\ ldil L%SYSCALLGATE, %r1 !\ + depd %r0, 31, 32, %r1 !\ ble 4(%sr7, %r1) !\ ldi __CONCAT(SYS_,y), %r1 !\ ldd HPPA_FRAME_RP(%sr0,%sp), %rp !\ -- cgit v1.2.3