Source-Changes-HG archive

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

[src/trunk]: src/sys Pullup from matt-nb5-mips64.



details:   https://anonhg.NetBSD.org/src/rev/02ddfa744b85
branches:  trunk
changeset: 749923:02ddfa744b85
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Dec 13 04:47:45 2009 +0000

description:
Pullup from matt-nb5-mips64.

For each syscall, add a flag for the return value or an argument indicating
that it is a 64-bit argument.  Also include the number of 64-bit arguments.
In theory this could get most of the code in compat/netbsd32/netbsd32_netbsd.c
but not at the moment due to multiply defined structures.

diffstat:

 sys/kern/makesyscalls.sh |  18 +++++++++++++++++-
 sys/sys/systm.h          |  19 +++++++++++++++++--
 2 files changed, 34 insertions(+), 3 deletions(-)

diffs (83 lines):

diff -r f7129d603801 -r 02ddfa744b85 sys/kern/makesyscalls.sh
--- a/sys/kern/makesyscalls.sh  Sun Dec 13 04:36:02 2009 +0000
+++ b/sys/kern/makesyscalls.sh  Sun Dec 13 04:47:45 2009 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh -
-#      $NetBSD: makesyscalls.sh,v 1.91 2009/11/26 17:23:48 pooka Exp $
+#      $NetBSD: makesyscalls.sh,v 1.92 2009/12/13 04:47:45 matt Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -440,6 +440,12 @@
                funcname=funcstdname
                wantrename=0
        }
+       if (returntype == "quad_t" || returntype == "off_t") {
+               if (sycall_flags == "0")
+                       sycall_flags = "SYCALL_RET_64";
+               else
+                       sycall_flags = "SYCALL_RET_64 | " sycall_flags;
+       }
 
        if (funcalias == "") {
                funcalias=funcname
@@ -473,6 +479,7 @@
        # and do not need argument structures built.
 
        isvarargs = 0;
+       args64 = 0;
        while (f <= end) {
                if ($f == "...") {
                        f++;
@@ -501,9 +508,18 @@
                } else {
                        argalign++;
                }
+               if (argtype[argc] == "quad_t" || argtype[argc] == "off_t") {
+                       if (sycall_flags == "0")
+                               sycall_flags = "SYCALL_ARG"argc-1"_64";
+                       else
+                               sycall_flags = "SYCALL_ARG"argc-1"_64 | " sycall_flags;
+                       args64++;
+               }
                argname[argc]=$f;
                f += 2;                 # skip name, and any comma
        }
+       if (args64 > 0)
+               sycall_flags = "SYCALL_NARGS64_VAL("args64") | " sycall_flags;
        # must see another argument after varargs notice.
        if (isvarargs) {
                if (argc == varargc)
diff -r f7129d603801 -r 02ddfa744b85 sys/sys/systm.h
--- a/sys/sys/systm.h   Sun Dec 13 04:36:02 2009 +0000
+++ b/sys/sys/systm.h   Sun Dec 13 04:47:45 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: systm.h,v 1.237 2009/11/03 05:23:28 dyoung Exp $       */
+/*     $NetBSD: systm.h,v 1.238 2009/12/13 04:47:45 matt Exp $ */
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -128,7 +128,22 @@
 #error "what byte order is this machine?"
 #endif
 
-#define        SYCALL_INDIRECT 0x0002  /* indirect (ie syscall() or __syscall()) */
+#define        SYCALL_INDIRECT 0x0000002 /* indirect (ie syscall() or __syscall()) */
+#define        SYCALL_NARGS64_MASK     0x000f000 /* count of 64bit args */
+#define SYCALL_RET_64  0x0010000 /* retval is a 64bit integer value */
+#define SYCALL_ARG0_64  0x0020000
+#define SYCALL_ARG1_64  0x0040000
+#define SYCALL_ARG2_64  0x0080000
+#define SYCALL_ARG3_64  0x0100000
+#define SYCALL_ARG4_64  0x0200000
+#define SYCALL_ARG5_64  0x0400000
+#define SYCALL_ARG6_64  0x0800000
+#define SYCALL_ARG7_64  0x1000000
+#define SYCALL_RET_64_P(sy)    ((sy)->sy_flags & SYCALL_RET_64)
+#define SYCALL_ARG_64_P(sy, n) ((sy)->sy_flags & (SYCALL_ARG0_64 << (n)))
+#define        SYCALL_ARG_64_MASK(sy)  (((sy)->sy_flags >> 17) & 0xff)
+#define        SYCALL_NARGS64(sy)      (((sy)->sy_flags >> 12) & 0x0f)
+#define        SYCALL_NARGS64_VAL(n)   ((n) << 12)
 
 extern int boothowto;          /* reboot flags, from console subsystem */
 #define        bootverbose     (boothowto & AB_VERBOSE)



Home | Main Index | Thread Index | Old Index