diff --git a/lib/libc/arch/alpha/sys/__sigtramp2.S b/lib/libc/arch/alpha/sys/__sigtramp2.S index 77a6ecad570f..4c94fb2fda8e 100644 --- a/lib/libc/arch/alpha/sys/__sigtramp2.S +++ b/lib/libc/arch/alpha/sys/__sigtramp2.S @@ -1,4 +1,4 @@ -/* $NetBSD: __sigtramp2.S,v 1.1 2003/10/07 17:08:07 skd Exp $ */ +/* $NetBSD: __sigtramp2.S,v 1.2 2006/11/08 21:16:40 drochner Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -39,8 +39,9 @@ * sp-> siginfo structure [0] */ NESTED_NOPROFILE(__sigtramp_siginfo_2,0,0,ra,0,0) + ldgp gp,0(ra) lda a0,(128)(sp) /* get pointer to ucontext */ CALLSYS_NOERROR(setcontext) /* and call setcontext() with it */ - mov v0, a0 /* if that failed, get error code */ - CALLSYS_NOERROR(exit) /* and call exit() with it */ + ldiq a0,-1 /* if that failed, set an exit code */ + CALLSYS_NOERROR(exit) /* and call exit() */ END(__sigtramp_siginfo_2) diff --git a/lib/libc/arch/i386/sys/__sigtramp2.S b/lib/libc/arch/i386/sys/__sigtramp2.S index 48b57233ae7e..09ba7ac1e930 100644 --- a/lib/libc/arch/i386/sys/__sigtramp2.S +++ b/lib/libc/arch/i386/sys/__sigtramp2.S @@ -1,4 +1,4 @@ -/* $NetBSD: __sigtramp2.S,v 1.2 2006/08/02 04:18:48 jld Exp $ */ +/* $NetBSD: __sigtramp2.S,v 1.3 2006/11/08 21:16:40 drochner Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -51,9 +51,9 @@ * sp-> signal number [0] */ NENTRY(__sigtramp_siginfo_2) - leal 12+128(%esp),%eax /* get pointer to ucontext */ + leal 12+128(%esp),%eax /* get address of ucontext */ movl %eax,4(%esp) /* put it in the argument slot */ /* fake return address already there */ SYSTRAP(setcontext) /* do setcontext */ - movl %eax,4(%esp) /* error code */ + movl $-1,4(%esp) /* if we return here, something is wrong */ SYSTRAP(exit) /* exit */ diff --git a/lib/libc/arch/x86_64/sys/__sigtramp2.S b/lib/libc/arch/x86_64/sys/__sigtramp2.S index 16453a2188a9..e0489cc7153c 100644 --- a/lib/libc/arch/x86_64/sys/__sigtramp2.S +++ b/lib/libc/arch/x86_64/sys/__sigtramp2.S @@ -1,4 +1,4 @@ -/* $NetBSD: __sigtramp2.S,v 1.4 2004/03/23 16:33:47 drochner Exp $ */ +/* $NetBSD: __sigtramp2.S,v 1.5 2006/11/08 21:16:40 drochner Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -43,8 +43,8 @@ */ NENTRY(__sigtramp_siginfo_2) movq %r15,%rdi - pushq $0 /* fake return address */ movq $SYS_setcontext, %rax syscall + movq $-1,%rdi /* if we return here, something is wrong */ movq $SYS_exit, %rax syscall