Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch/x86_64 Use the syscall insn for system calls. ...



details:   https://anonhg.NetBSD.org/src/rev/91302a0117e0
branches:  trunk
changeset: 532251:91302a0117e0
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Mon Jun 03 18:30:32 2002 +0000

description:
Use the syscall insn for system calls. Fix up some assembly to
remove either previously made errors, or to account for the
fact that syscall clobbers %ecx.

diffstat:

 lib/libc/arch/x86_64/SYS.h           |   6 +++---
 lib/libc/arch/x86_64/sys/Ovfork.S    |  10 +++++-----
 lib/libc/arch/x86_64/sys/__vfork14.S |  10 +++++-----
 lib/libc/arch/x86_64/sys/brk.S       |   6 +++---
 lib/libc/arch/x86_64/sys/cerror.S    |   6 ++++--
 lib/libc/arch/x86_64/sys/syscall.S   |   6 +++---
 6 files changed, 23 insertions(+), 21 deletions(-)

diffs (181 lines):

diff -r 833b6091ca58 -r 91302a0117e0 lib/libc/arch/x86_64/SYS.h
--- a/lib/libc/arch/x86_64/SYS.h        Mon Jun 03 18:23:16 2002 +0000
+++ b/lib/libc/arch/x86_64/SYS.h        Mon Jun 03 18:30:32 2002 +0000
@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *     from: @(#)SYS.h 5.5 (Berkeley) 5/7/91
- *     $NetBSD: SYS.h,v 1.4 2002/05/26 12:24:59 wiz Exp $
+ *     $NetBSD: SYS.h,v 1.5 2002/06/03 18:30:32 fvdl Exp $
  */
 
 /*
@@ -45,9 +45,9 @@
 #include <sys/syscall.h>
 
 #ifdef __STDC__
-#define SYSTRAP(x)     movl $(SYS_ ## x),%eax; int $0x80
+#define SYSTRAP(x)     movl $(SYS_ ## x),%eax; movq %rcx, %r10; syscall
 #else
-#define SYSTRAP(x)     movl $(SYS_/**/x),%eax; int $0x80
+#define SYSTRAP(x)     movl $(SYS_/**/x),%eax; movq %rcx, %r10; syscall
 #endif
 
 #define CERROR         _C_LABEL(__cerror)
diff -r 833b6091ca58 -r 91302a0117e0 lib/libc/arch/x86_64/sys/Ovfork.S
--- a/lib/libc/arch/x86_64/sys/Ovfork.S Mon Jun 03 18:23:16 2002 +0000
+++ b/lib/libc/arch/x86_64/sys/Ovfork.S Mon Jun 03 18:30:32 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: Ovfork.S,v 1.1 2001/06/19 00:25:05 fvdl Exp $  */
+/*     $NetBSD: Ovfork.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $  */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -40,7 +40,7 @@
 
 #include <machine/asm.h>
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: Ovfork.S,v 1.1 2001/06/19 00:25:05 fvdl Exp $")
+       RCSID("$NetBSD: Ovfork.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $")
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include "SYS.h"
@@ -56,14 +56,14 @@
  *
  */
 ENTRY(vfork)
-       popq    %rcx            /* my rta into ecx */
+       popq    %r9             /* my rta into r9 */
        SYSTRAP(vfork)
        jc      err
        decl    %edx
        andl    %edx,%eax
-       jmp     *%rcx
+       jmp     *%r9
 err:
-       pushq   %rcx
+       pushq   %r9
 #ifdef PIC
        movq    PIC_GOT(CERROR), %rcx
        jmp     *%rcx
diff -r 833b6091ca58 -r 91302a0117e0 lib/libc/arch/x86_64/sys/__vfork14.S
--- a/lib/libc/arch/x86_64/sys/__vfork14.S      Mon Jun 03 18:23:16 2002 +0000
+++ b/lib/libc/arch/x86_64/sys/__vfork14.S      Mon Jun 03 18:30:32 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __vfork14.S,v 1.1 2001/06/19 00:25:06 fvdl Exp $       */
+/*     $NetBSD: __vfork14.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $       */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -40,7 +40,7 @@
 
 #include <machine/asm.h>
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: __vfork14.S,v 1.1 2001/06/19 00:25:06 fvdl Exp $")
+       RCSID("$NetBSD: __vfork14.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $")
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include "SYS.h"
@@ -53,14 +53,14 @@
  *
  */
 ENTRY(__vfork14)
-       popq    %rcx            /* my rta into rcx */
+       popq    %r9             /* my rta into r9 */
        SYSTRAP(__vfork14)
        jc      err
        decl    %edx
        andl    %edx,%eax
-       jmp     *%rcx
+       jmp     *%r9
 err:
-       pushq   %rcx
+       pushq   %r9
 #ifdef PIC
        movq    PIC_GOT(CERROR), %rcx
        jmp     *%rcx
diff -r 833b6091ca58 -r 91302a0117e0 lib/libc/arch/x86_64/sys/brk.S
--- a/lib/libc/arch/x86_64/sys/brk.S    Mon Jun 03 18:23:16 2002 +0000
+++ b/lib/libc/arch/x86_64/sys/brk.S    Mon Jun 03 18:30:32 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: brk.S,v 1.1 2001/06/19 00:25:06 fvdl Exp $     */
+/*     $NetBSD: brk.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $     */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -40,7 +40,7 @@
 
 #include <machine/asm.h>
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: brk.S,v 1.1 2001/06/19 00:25:06 fvdl Exp $")
+       RCSID("$NetBSD: brk.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $")
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include "SYS.h"
@@ -68,7 +68,7 @@
        SYSTRAP(break)
        jc      err
        movq    PIC_GOT(CURBRK),%rdx    # set up GOT addressing
-       movl    %ecx,(%rdx)
+       movq    %rdi,(%rdx)
        xorl    %eax,%eax
        ret
 err:
diff -r 833b6091ca58 -r 91302a0117e0 lib/libc/arch/x86_64/sys/cerror.S
--- a/lib/libc/arch/x86_64/sys/cerror.S Mon Jun 03 18:23:16 2002 +0000
+++ b/lib/libc/arch/x86_64/sys/cerror.S Mon Jun 03 18:30:32 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cerror.S,v 1.1 2001/06/19 00:25:06 fvdl Exp $  */
+/*     $NetBSD: cerror.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $  */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -40,7 +40,7 @@
 
 #include <machine/asm.h>
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: cerror.S,v 1.1 2001/06/19 00:25:06 fvdl Exp $")
+       RCSID("$NetBSD: cerror.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $")
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include "SYS.h"
@@ -48,6 +48,7 @@
        .globl  _C_LABEL(__errno)
 
 _ENTRY(CERROR)
+       pushq   %r12
        movl    %eax,%edi
        movl    %eax,%r12d
 #ifdef PIC
@@ -57,4 +58,5 @@
 #endif /* PIC */
        movl    %r12d,(%rax)
        movq    $-1,%rax
+       popq    %r12
        ret
diff -r 833b6091ca58 -r 91302a0117e0 lib/libc/arch/x86_64/sys/syscall.S
--- a/lib/libc/arch/x86_64/sys/syscall.S        Mon Jun 03 18:23:16 2002 +0000
+++ b/lib/libc/arch/x86_64/sys/syscall.S        Mon Jun 03 18:30:32 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: syscall.S,v 1.1 2001/06/19 00:25:07 fvdl Exp $ */
+/*     $NetBSD: syscall.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $ */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -40,14 +40,14 @@
 
 #include <machine/asm.h>
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: syscall.S,v 1.1 2001/06/19 00:25:07 fvdl Exp $")
+       RCSID("$NetBSD: syscall.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $")
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include "SYS.h"
 
 ENTRY(syscall)
        movl    %edi,%eax
-       int     $0x80
+       syscall
        jc      err
        ret
 err:



Home | Main Index | Thread Index | Old Index