Source-Changes-HG archive

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

[src/trunk]: src/sys clean up



details:   https://anonhg.NetBSD.org/src/rev/8e1500c926e7
branches:  trunk
changeset: 520125:8e1500c926e7
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Jan 03 06:43:23 2002 +0000

description:
clean up

diffstat:

 sys/arch/sparc64/include/netbsd32_machdep.h |   6 +++-
 sys/arch/sparc64/sparc64/netbsd32_machdep.c |  39 ++++++++++++++++++----------
 sys/compat/netbsd32/netbsd32_ioctl.h        |  13 +++++----
 3 files changed, 37 insertions(+), 21 deletions(-)

diffs (145 lines):

diff -r 24291f9b41c1 -r 8e1500c926e7 sys/arch/sparc64/include/netbsd32_machdep.h
--- a/sys/arch/sparc64/include/netbsd32_machdep.h       Thu Jan 03 06:21:47 2002 +0000
+++ b/sys/arch/sparc64/include/netbsd32_machdep.h       Thu Jan 03 06:43:23 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.h,v 1.7 2002/01/03 02:29:40 mrg Exp $ */
+/*     $NetBSD: netbsd32_machdep.h,v 1.8 2002/01/03 06:43:24 mrg Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,6 +31,10 @@
 #ifndef _MACHINE_NETBSD32_H_
 #define _MACHINE_NETBSD32_H_
 
+#include <sys/types.h>
+#include <sys/proc.h>
+#include <compat/netbsd32/netbsd32.h>
+
 /* from <arch/sparc/include/signal.h> */
 typedef u_int32_t netbsd32_sigcontextp_t;
 
diff -r 24291f9b41c1 -r 8e1500c926e7 sys/arch/sparc64/sparc64/netbsd32_machdep.c
--- a/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Thu Jan 03 06:21:47 2002 +0000
+++ b/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Thu Jan 03 06:43:23 2002 +0000
@@ -1,4 +1,3 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.20 2002/01/03 02:29:40 mrg Exp $        */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -35,6 +34,8 @@
 #include <sys/param.h>
 #include <sys/exec.h>
 #include <sys/malloc.h>
+#include <sys/filedesc.h>
+#include <sys/file.h>
 #include <sys/proc.h>
 #include <sys/signalvar.h>
 #include <sys/systm.h>
@@ -45,6 +46,22 @@
 #include <sys/vnode.h>
 #include <sys/map.h>
 #include <sys/select.h>
+#include <sys/ioctl.h>
+
+#include <dev/sun/event_var.h>
+
+#include <net/if.h>
+#include <net/route.h>
+
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/igmp.h>
+#include <netinet/igmp_var.h>
+#include <netinet/ip_mroute.h>
+
+#include <compat/netbsd32/netbsd32.h>
+#include <compat/netbsd32/netbsd32_ioctl.h>
+#include <compat/netbsd32/netbsd32_syscallargs.h>
 
 #include <machine/frame.h>
 #include <machine/reg.h>
@@ -52,16 +69,8 @@
 #include <machine/vuid_event.h>
 #include <machine/netbsd32_machdep.h>
 
-#include <compat/netbsd32/netbsd32.h>
-#include <compat/netbsd32/netbsd32_ioctl.h>
-#include <compat/netbsd32/netbsd32_syscallargs.h>
-
-#include <dev/sun/event_var.h>
-
 static int ev_out32 __P((struct firm_event *, int, struct uio *));
 
-#include <sys/ioctl.h>
-
 /*
  * Set up registers on exec.
  *
@@ -637,7 +646,7 @@
  * ioctl code
  */
 
-#include <machine/fbio.h>
+#include <dev/sun/fbio.h>
 #include <machine/openpromio.h>
 
 /* from arch/sparc/include/fbio.h */
@@ -804,12 +813,12 @@
        struct proc *p;
 {
        u_int size;
-       caddr_t data;
+       caddr_t data, memp = NULL;
 #define STK_PARAMS     128
-       stkbuf[STK_PARAMS/sizeof(u_long)];
-       stkbuf32[STK_PARAMS/sizeof(u_long)];
+       u_long stkbuf[STK_PARAMS/sizeof(u_long)];
+       int error;
 
-       switch (SCARG(uap, com)) {
+       switch (com) {
        case FBIOPUTCMAP32:
                IOCTL_STRUCT_CONV_TO(FBIOPUTCMAP, fbcmap);
        case FBIOGETCMAP32:
@@ -829,5 +838,7 @@
        default:
                error = (*fp->f_ops->fo_ioctl)(fp, com, data32, p);
        }
+       if (memp)
+               free(memp, M_IOCTLOPS);
        return (error);
 }
diff -r 24291f9b41c1 -r 8e1500c926e7 sys/compat/netbsd32/netbsd32_ioctl.h
--- a/sys/compat/netbsd32/netbsd32_ioctl.h      Thu Jan 03 06:21:47 2002 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.h      Thu Jan 03 06:43:23 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.h,v 1.7 2002/01/03 02:29:39 mrg Exp $   */
+/*     $NetBSD: netbsd32_ioctl.h,v 1.8 2002/01/03 06:43:23 mrg Exp $   */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -30,18 +30,19 @@
 
 /* we define some handy macros here... */
 #define IOCTL_STRUCT_CONV_TO(cmd, type)        \
-               com = cmd; \
-               size = IOCPARM_LEN(com); \
+       do { \
+               size = IOCPARM_LEN(cmd); \
                if (size > sizeof(stkbuf)) \
                        data = memp = malloc(size, M_IOCTLOPS, M_WAITOK); \
                else \
                        data = (caddr_t)stkbuf; \
                __CONCAT(netbsd32_to_, type)((struct __CONCAT(netbsd32_, type) *) \
-                       data32, (struct type *)data, com); \
-               error = (*fp->f_ops->fo_ioctl)(fp, com, data, p); \
+                       data32, (struct type *)data, cmd); \
+               error = (*fp->f_ops->fo_ioctl)(fp, cmd, data, p); \
                __CONCAT(netbsd32_from_, type)((struct type *)data, \
                        (struct __CONCAT(netbsd32_, type) *)data32); \
-               break
+               break; \
+       } while (0)
  
 /* from <sys/audioio.h> */
 #if 0



Home | Main Index | Thread Index | Old Index