Really, there is no need to use the old int0x80 syscall entry just for

getcontext(). There are some registers not properly saved with the
new syscall entry, but these are calee-saved, scratch or meaningless.
It's the setcontext() return path what matters.
This commit is contained in:
drochner 2004-03-09 20:21:22 +00:00
parent 0f7c881113
commit ca430e5111
2 changed files with 4 additions and 32 deletions

View File

@ -30,7 +30,7 @@
* SUCH DAMAGE.
*
* from: @(#)SYS.h 5.5 (Berkeley) 5/7/91
* $NetBSD: SYS.h,v 1.7 2003/10/18 22:47:37 fvdl Exp $
* $NetBSD: SYS.h,v 1.8 2004/03/09 20:21:22 drochner Exp $
*/
/*
@ -42,10 +42,8 @@
#ifdef __STDC__
#define SYSTRAP(x) movl $(SYS_ ## x),%eax; movq %rcx, %r10; syscall
#define OSYSTRAP(x) movl $(SYS_ ## x),%eax; int $0x80
#else
#define SYSTRAP(x) movl $(SYS_/**/x),%eax; movq %rcx, %r10; syscall
#define OSYSTRAP(x) movl $(SYS_/**/x),%eax; int $0x80
#endif
#define CERROR _C_LABEL(__cerror)
@ -55,10 +53,6 @@
ENTRY(x); \
SYSTRAP(y)
#define _OSYSCALL_NOERROR(x,y) \
ENTRY(x); \
OSYSTRAP(y)
#ifdef PIC
#define _SYSCALL(x,y) \
.text; _ALIGN_TEXT; \
@ -74,34 +68,12 @@
jc 2b
#endif
#ifdef PIC
#define _OSYSCALL(x,y) \
.text; _ALIGN_TEXT; \
2: mov PIC_GOT(CERROR), %rcx; \
jmp *%rcx; \
_OSYSCALL_NOERROR(x,y); \
jc 2b
#else
#define _OSYSCALL(x,y) \
.text; _ALIGN_TEXT; \
2: jmp CERROR; \
_OSYSCALL_NOERROR(x,y); \
jc 2b
#endif
#define SYSCALL_NOERROR(x) \
_SYSCALL_NOERROR(x,x)
#define OSYSCALL_NOERROR(x) \
_OSYSCALL_NOERROR(x,x)
#define SYSCALL(x) \
_SYSCALL(x,x)
#define OSYSCALL(x) \
_OSYSCALL(x,x)
#define PSEUDO_NOERROR(x,y) \
_SYSCALL_NOERROR(x,y); \
ret

View File

@ -1,4 +1,4 @@
/* $NetBSD: getcontext.S,v 1.2 2003/10/18 22:47:37 fvdl Exp $ */
/* $NetBSD: getcontext.S,v 1.3 2004/03/09 20:21:22 drochner Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -39,7 +39,7 @@
#include "SYS.h"
#if defined(SYSLIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: getcontext.S,v 1.2 2003/10/18 22:47:37 fvdl Exp $")
RCSID("$NetBSD: getcontext.S,v 1.3 2004/03/09 20:21:22 drochner Exp $")
#endif
#ifdef WEAK_ALIAS
@ -53,7 +53,7 @@ WEAK_ALIAS(getcontext, _getcontext)
* 24 == _REG_URSP
*/
_OSYSCALL(_getcontext,getcontext)
_SYSCALL(_getcontext,getcontext)
movq (%rsp),%r11
movq %r11,(56 + 21 * 8)(%rdi)
leaq 8(%rsp),%r11