Source-Changes-HG archive

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

[src/pgoyette-compat]: src/sys Create a variant of the HOOK macros that handl...



details:   https://anonhg.NetBSD.org/src/rev/21a383c52dc1
branches:  pgoyette-compat
changeset: 447505:21a383c52dc1
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Mon Jan 14 13:34:26 2019 +0000

description:
Create a variant of the HOOK macros that handles hook routines of
type void, and use them where appropriate.

diffstat:

 sys/arch/amd64/amd64/netbsd32_machdep.c        |    8 +-
 sys/arch/amd64/amd64/netbsd32_machdep_16.c     |   10 +-
 sys/arch/mips/mips/netbsd32_machdep.c          |    8 +-
 sys/arch/mips/mips/netbsd32_machdep_16.c       |   10 +-
 sys/arch/sparc/fpu/fpu.c                       |    8 +-
 sys/arch/sparc64/sparc64/netbsd32_machdep.c    |    8 +-
 sys/arch/sparc64/sparc64/netbsd32_machdep_16.c |   10 +-
 sys/compat/common/if_43.c                      |    8 +-
 sys/compat/common/rtsock_14.c                  |   11 +-
 sys/compat/common/rtsock_50.c                  |   12 +-
 sys/compat/common/rtsock_70.c                  |   10 +-
 sys/compat/common/sysmon_power_40.c            |   21 ++--
 sys/compat/common/uipc_usrreq_70.c             |   12 +-
 sys/compat/net/if.h                            |    6 +-
 sys/compat/net/route.h                         |   14 +-
 sys/compat/netbsd32/netbsd32.h                 |    7 +-
 sys/compat/netbsd32/netbsd32_kern_proc.c       |    8 +-
 sys/compat/netbsd32/netbsd32_module.c          |    8 +-
 sys/compat/sys/socket.h                        |    4 +-
 sys/dev/bio.c                                  |    8 +-
 sys/dev/ccd.c                                  |    8 +-
 sys/dev/clockctl.c                             |    8 +-
 sys/dev/raidframe/rf_netbsdkintf.c             |   12 +-
 sys/dev/sysmon/sysmon_power.c                  |   12 +-
 sys/dev/usb/ugen.c                             |   12 +-
 sys/dev/usb/uhid.c                             |   12 +-
 sys/dev/usb/usb.c                              |   21 ++--
 sys/dev/vnd.c                                  |   12 +-
 sys/dev/wscons/wsevent.c                       |    8 +-
 sys/fs/puffs/puffs_compat.c                    |    7 +-
 sys/fs/puffs/puffs_msgif.c                     |   17 +--
 sys/fs/puffs/puffs_sys.h                       |    4 +-
 sys/kern/kern_proc.c                           |   16 +-
 sys/kern/kern_rndq.c                           |   13 +-
 sys/kern/sys_module.c                          |    8 +-
 sys/kern/sysv_ipc.c                            |    8 +-
 sys/kern/tty.c                                 |    8 +-
 sys/kern/tty_ptm.c                             |    8 +-
 sys/kern/uipc_usrreq.c                         |   15 +-
 sys/kern/vfs_syscalls.c                        |    8 +-
 sys/net/if.c                                   |   20 ++--
 sys/net/if_spppsubr.c                          |    8 +-
 sys/net/route.h                                |   12 +-
 sys/net/rtsock.c                               |  102 +++++++++++-------------
 sys/net80211/ieee80211_ioctl.c                 |    6 +-
 sys/opencrypto/cryptodev.c                     |    8 +-
 sys/sys/compat_stub.h                          |  103 +++++++++++++-----------
 sys/sys/module_hook.h                          |   38 ++++++++-
 48 files changed, 359 insertions(+), 346 deletions(-)

diffs (truncated from 2240 to 300 lines):

diff -r f51cf7bb3ec1 -r 21a383c52dc1 sys/arch/amd64/amd64/netbsd32_machdep.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep.c   Mon Jan 14 00:16:32 2019 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep.c   Mon Jan 14 13:34:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.115.2.13 2019/01/13 10:49:49 pgoyette Exp $     */
+/*     $NetBSD: netbsd32_machdep.c,v 1.115.2.14 2019/01/14 13:34:26 pgoyette Exp $     */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115.2.13 2019/01/13 10:49:49 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115.2.14 2019/01/14 13:34:26 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -275,9 +275,9 @@
 
 struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
 
-MODULE_CALL_HOOK_DECL(netbsd32_sendsig_hook,
+MODULE_CALL_VOID_HOOK_DECL(netbsd32_sendsig_hook,
     (const ksiginfo_t *ksi, const sigset_t *mask));
-MODULE_CALL_HOOK(netbsd32_sendsig_hook,
+MODULE_CALL_VOID_HOOK(netbsd32_sendsig_hook,
     (const ksiginfo_t *ksi, const sigset_t *mask), (ksi, mask),
     netbsd32_sendsig_siginfo(ksi, mask));
 
diff -r f51cf7bb3ec1 -r 21a383c52dc1 sys/arch/amd64/amd64/netbsd32_machdep_16.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep_16.c        Mon Jan 14 00:16:32 2019 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep_16.c        Mon Jan 14 13:34:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep_16.c,v 1.1.2.10 2018/12/26 14:01:31 pgoyette Exp $    */
+/*     $NetBSD: netbsd32_machdep_16.c,v 1.1.2.11 2019/01/14 13:34:26 pgoyette Exp $    */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.10 2018/12/26 14:01:31 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.11 2019/01/14 13:34:26 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -84,7 +84,7 @@
 
 int check_sigcontext32(struct lwp *, const struct netbsd32_sigcontext *);
 
-int netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
+void netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
 
 extern struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
 
@@ -177,15 +177,13 @@
        netbsd32_buildcontext(l, tf, fp, catcher, onstack);
 }
 
-int
+void
 netbsd32_sendsig_16(const ksiginfo_t *ksi, const sigset_t *mask)
 {
        if (curproc->p_sigacts->sa_sigdesc[ksi->ksi_signo].sd_vers < 2)
                netbsd32_sendsig_sigcontext(ksi, mask);
        else
                netbsd32_sendsig_siginfo(ksi, mask);
-
-       return 0;
 }
 
 int
diff -r f51cf7bb3ec1 -r 21a383c52dc1 sys/arch/mips/mips/netbsd32_machdep.c
--- a/sys/arch/mips/mips/netbsd32_machdep.c     Mon Jan 14 00:16:32 2019 +0000
+++ b/sys/arch/mips/mips/netbsd32_machdep.c     Mon Jan 14 13:34:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.15.2.9 2019/01/13 10:49:49 pgoyette Exp $       */
+/*     $NetBSD: netbsd32_machdep.c,v 1.15.2.10 2019/01/14 13:34:26 pgoyette Exp $      */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.9 2019/01/13 10:49:49 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.10 2019/01/14 13:34:26 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -309,9 +309,9 @@
 
 struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
  
-MODULE_CALL_HOOK_DECL(netbsd32_sendsig_hook,
+MODULE_CALL_VOID_HOOK_DECL(netbsd32_sendsig_hook,
     (const ksiginfo_t *ksi, const sigset_t *mask));
-MODULE_CALL_HOOK(netbsd32_sendsig_hook,
+MODULE_CALL_VOID_HOOK(netbsd32_sendsig_hook,
     (const ksiginfo_t *ksi, const sigset_t *mask), (ksi, mask),  
     netbsd32_sendsig_siginfo(ksi, mask));
 
diff -r f51cf7bb3ec1 -r 21a383c52dc1 sys/arch/mips/mips/netbsd32_machdep_16.c
--- a/sys/arch/mips/mips/netbsd32_machdep_16.c  Mon Jan 14 00:16:32 2019 +0000
+++ b/sys/arch/mips/mips/netbsd32_machdep_16.c  Mon Jan 14 13:34:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep_16.c,v 1.1.2.8 2018/09/29 10:18:29 pgoyette Exp $     */
+/*     $NetBSD: netbsd32_machdep_16.c,v 1.1.2.9 2019/01/14 13:34:26 pgoyette Exp $     */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.8 2018/09/29 10:18:29 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.9 2019/01/14 13:34:26 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -67,7 +67,7 @@
 
 #include <uvm/uvm_extern.h>
 
-int netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
+void netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
 
 void sendsig_context(const ksiginfo_t *, const sigset_t *);
 int netbsd32_sendsig_siginfo(const ksiginfo_t *, const sigset_t *);
@@ -86,15 +86,13 @@
        return compat_16_sys___sigreturn14(l, &ua, retval);
 }
 
-int
+void
 netbsd32_sendsig_16(const ksiginfo_t *ksi, const sigset_t *mask)
 {               
        if (curproc->p_sigacts->sa_sigdesc[ksi->ksi_signo].sd_vers < 2)
                sendsig_sigcontext(ksi, mask);
        else    
                netbsd32_sendsig_siginfo(ksi, mask);
-
-       return 0;
 }       
 
 MODULE_SET_HOOK(netbsd32_sendsig_hook, "nb32_16", netbsd32_sendsig_16); 
diff -r f51cf7bb3ec1 -r 21a383c52dc1 sys/arch/sparc/fpu/fpu.c
--- a/sys/arch/sparc/fpu/fpu.c  Mon Jan 14 00:16:32 2019 +0000
+++ b/sys/arch/sparc/fpu/fpu.c  Mon Jan 14 13:34:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu.c,v 1.27.46.2 2019/01/13 10:49:49 pgoyette Exp $ */
+/*     $NetBSD: fpu.c,v 1.27.46.3 2019/01/14 13:34:26 pgoyette Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.27.46.2 2019/01/13 10:49:49 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.27.46.3 2019/01/14 13:34:26 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -122,8 +122,8 @@
 /*
  * HOOK for checking if the lwp's emul matches sunos
  */
-MODULE_CALL_HOOK_DECL(get_emul_sunos_hook, (const struct emul **emul));
-MODULE_CALL_HOOK(get_emul_sunos_hook, (const struct emul ** emul), (emul),
+MODULE_CALL_INT_HOOK_DECL(get_emul_sunos_hook, (const struct emul **emul));
+MODULE_CALL_INT_HOOK(get_emul_sunos_hook, (const struct emul ** emul), (emul),
     enosys());
 
 /*
diff -r f51cf7bb3ec1 -r 21a383c52dc1 sys/arch/sparc64/sparc64/netbsd32_machdep.c
--- a/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Mon Jan 14 00:16:32 2019 +0000
+++ b/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Mon Jan 14 13:34:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.110.14.2 2019/01/13 10:49:49 pgoyette Exp $     */
+/*     $NetBSD: netbsd32_machdep.c,v 1.110.14.3 2019/01/14 13:34:26 pgoyette Exp $     */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.110.14.2 2019/01/13 10:49:49 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.110.14.3 2019/01/14 13:34:26 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -262,9 +262,9 @@
 
 struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
         
-MODULE_CALL_HOOK_DECL(netbsd32_sendsig_hook,
+MODULE_CALL_VOID_HOOK_DECL(netbsd32_sendsig_hook,
     (const ksiginfo_t *ksi, const sigset_t *mask));  
-MODULE_CALL_HOOK(netbsd32_sendsig_hook,
+MODULE_CALL_VOID_HOOK(netbsd32_sendsig_hook,
     (const ksiginfo_t *ksi, const sigset_t *mask), (ksi, mask),
     netbsd32_sendsig_siginfo(ksi, mask));
 
diff -r f51cf7bb3ec1 -r 21a383c52dc1 sys/arch/sparc64/sparc64/netbsd32_machdep_16.c
--- a/sys/arch/sparc64/sparc64/netbsd32_machdep_16.c    Mon Jan 14 00:16:32 2019 +0000
+++ b/sys/arch/sparc64/sparc64/netbsd32_machdep_16.c    Mon Jan 14 13:34:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep_16.c,v 1.1.2.4 2019/01/01 05:38:34 pgoyette Exp $     */
+/*     $NetBSD: netbsd32_machdep_16.c,v 1.1.2.5 2019/01/14 13:34:26 pgoyette Exp $     */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.4 2019/01/01 05:38:34 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.5 2019/01/14 13:34:26 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -85,7 +85,7 @@
 
 void netbsd32_sendsig_siginfo(const ksiginfo_t *, const sigset_t *);
 
-int netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
+void netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
 
 /*
  * NB: since this is a 32-bit address world, sf_scp and sf_sc
@@ -245,15 +245,13 @@
        ucontext32_t sf_uc;
 };
 
-int
+void
 netbsd32_sendsig_16(const ksiginfo_t *ksi, const sigset_t *mask)
 {
        if (curproc->p_sigacts->sa_sigdesc[ksi->ksi_signo].sd_vers < 2)
                netbsd32_sendsig_sigcontext(ksi, mask);
        else
                netbsd32_sendsig_siginfo(ksi, mask);
-
-       return 0;
 }
 
 #undef DEBUG
diff -r f51cf7bb3ec1 -r 21a383c52dc1 sys/compat/common/if_43.c
--- a/sys/compat/common/if_43.c Mon Jan 14 00:16:32 2019 +0000
+++ b/sys/compat/common/if_43.c Mon Jan 14 13:34:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_43.c,v 1.14.2.11 2019/01/13 10:49:49 pgoyette Exp $ */
+/*     $NetBSD: if_43.c,v 1.14.2.12 2019/01/14 13:34:27 pgoyette Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.14.2.11 2019/01/13 10:49:49 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.14.2.12 2019/01/14 13:34:27 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -84,8 +84,8 @@
  * XXX The if43_20 routine doesn't really have any effect, since its
  * XXX return value is ignored (see compat/common/if_43.c)!
  */
-MODULE_CALL_HOOK_DECL(if43_20_hook, (u_long ncmd));
-MODULE_CALL_HOOK(if43_20_hook, (u_long ncmd), (ncmd), enosys());
+MODULE_CALL_INT_HOOK_DECL(if43_20_hook, (u_long ncmd));
+MODULE_CALL_INT_HOOK(if43_20_hook, (u_long ncmd), (ncmd), enosys());
 
 /* 
  * Use a wrapper so that the compat_cvtcmd() can return a u_long
diff -r f51cf7bb3ec1 -r 21a383c52dc1 sys/compat/common/rtsock_14.c
--- a/sys/compat/common/rtsock_14.c     Mon Jan 14 00:16:32 2019 +0000
+++ b/sys/compat/common/rtsock_14.c     Mon Jan 14 13:34:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtsock_14.c,v 1.5.14.5 2019/01/13 10:49:49 pgoyette Exp $      */
+/*     $NetBSD: rtsock_14.c,v 1.5.14.6 2019/01/14 13:34:27 pgoyette Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock_14.c,v 1.5.14.5 2019/01/13 10:49:49 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_14.c,v 1.5.14.6 2019/01/14 13:34:27 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -95,7 +95,7 @@
 



Home | Main Index | Thread Index | Old Index