Source-Changes-HG archive

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

[src/pgoyette-compat]: src/sys Move the netbsd32_machine32_hook into the main...



details:   https://anonhg.NetBSD.org/src/rev/365d77529cd2
branches:  pgoyette-compat
changeset: 447828:365d77529cd2
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Fri Jan 25 09:36:08 2019 +0000

description:
Move the netbsd32_machine32_hook into the main kernel with most of
the other hooks.

Although this hook might better belong in compat/netbsd32/ code,
there are some machines without a netbsd32 module (for example, i386
and sgimips) which still have consumers/users of this hook.  :(

diffstat:

 sys/arch/amd64/amd64/netbsd32_machdep.c     |   7 +++----
 sys/arch/mips/mips/netbsd32_machdep.c       |   6 +++---
 sys/arch/sparc64/sparc64/netbsd32_machdep.c |   7 +++----
 sys/compat/linux/common/linux_exec_elf32.c  |   8 ++------
 sys/compat/netbsd32/netbsd32.h              |   4 +---
 sys/compat/netbsd32/netbsd32_mod.c          |   6 ++----
 sys/kern/compat_stub.c                      |  12 +++++++++++-
 sys/sys/compat_stub.h                       |  11 ++++++++++-
 8 files changed, 35 insertions(+), 26 deletions(-)

diffs (224 lines):

diff -r f1ecc7ebf555 -r 365d77529cd2 sys/arch/amd64/amd64/netbsd32_machdep.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep.c   Fri Jan 25 09:04:51 2019 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep.c   Fri Jan 25 09:36:08 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.115.2.18 2019/01/24 04:08:09 pgoyette Exp $     */
+/*     $NetBSD: netbsd32_machdep.c,v 1.115.2.19 2019/01/25 09:36:08 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.18 2019/01/24 04:08:09 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115.2.19 2019/01/25 09:36:08 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -62,6 +62,7 @@
 #include <sys/ras.h>
 #include <sys/ptrace.h>
 #include <sys/kauth.h>
+#include <sys/compat_stub.h>
 
 #include <x86/fpu.h>
 #include <x86/dbregs.h>
@@ -969,8 +970,6 @@
                return VM_DEFAULT_ADDRESS32_BOTTOMUP(base, sz);
 }
 
-extern struct netbsd32_machine32_hook_t netbsd32_machine32_hook;
-
 static const char *
 netbsd32_machine32(void)
 {
diff -r f1ecc7ebf555 -r 365d77529cd2 sys/arch/mips/mips/netbsd32_machdep.c
--- a/sys/arch/mips/mips/netbsd32_machdep.c     Fri Jan 25 09:04:51 2019 +0000
+++ b/sys/arch/mips/mips/netbsd32_machdep.c     Fri Jan 25 09:36:08 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.15.2.14 2019/01/24 04:08:09 pgoyette Exp $      */
+/*     $NetBSD: netbsd32_machdep.c,v 1.15.2.15 2019/01/25 09:36:08 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.14 2019/01/24 04:08:09 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.15 2019/01/25 09:36:08 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -51,6 +51,7 @@
 #include <sys/signalvar.h>
 #include <sys/mount.h>
 #include <sys/syscallargs.h>
+#include <sys/compat_stub.h>
 
 #include <compat/netbsd32/netbsd32.h>
 #include <compat/netbsd32/netbsd32_exec.h>
@@ -308,7 +309,6 @@
 #endif
 
 struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
-extern struct netbsd32_machine32_hook_t netbsd32_machine32_hook;
  
 void
 netbsd32_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
diff -r f1ecc7ebf555 -r 365d77529cd2 sys/arch/sparc64/sparc64/netbsd32_machdep.c
--- a/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Fri Jan 25 09:04:51 2019 +0000
+++ b/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Fri Jan 25 09:36:08 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.110.14.7 2019/01/24 04:08:09 pgoyette Exp $     */
+/*     $NetBSD: netbsd32_machdep.c,v 1.110.14.8 2019/01/25 09:36:08 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.7 2019/01/24 04:08:09 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.110.14.8 2019/01/25 09:36:08 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -55,6 +55,7 @@
 #include <sys/ucontext.h>
 #include <sys/ioctl.h>
 #include <sys/kmem.h>
+#include <sys/compat_stub.h>
 
 #include <dev/sun/event_var.h>
 
@@ -1023,8 +1024,6 @@
        return machine32;
 }
 
-extern struct netbsd32_machine32_hook_t netbsd32_machine32_hook;
-
 void 
 netbsd32_machdep_md_init(void) 
 {
diff -r f1ecc7ebf555 -r 365d77529cd2 sys/compat/linux/common/linux_exec_elf32.c
--- a/sys/compat/linux/common/linux_exec_elf32.c        Fri Jan 25 09:04:51 2019 +0000
+++ b/sys/compat/linux/common/linux_exec_elf32.c        Fri Jan 25 09:36:08 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_exec_elf32.c,v 1.94.12.7 2019/01/24 05:06:43 pgoyette Exp $      */
+/*     $NetBSD: linux_exec_elf32.c,v 1.94.12.8 2019/01/25 09:36:09 pgoyette Exp $      */
 
 /*-
  * Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.94.12.7 2019/01/24 05:06:43 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.94.12.8 2019/01/25 09:36:09 pgoyette Exp $");
 
 #ifndef ELFSIZE
 /* XXX should die */
@@ -74,10 +74,6 @@
 #include <compat/linux/linux_syscallargs.h>
 #include <compat/linux/linux_syscall.h>
 
-#if (ELFSIZE == 32)
-       MODULE_HOOK(netbsd32_machine32_hook, const char *, (void));
-#endif
-
 #define LINUX_GO_RT0_SIGNATURE
 
 #ifdef DEBUG_LINUX
diff -r f1ecc7ebf555 -r 365d77529cd2 sys/compat/netbsd32/netbsd32.h
--- a/sys/compat/netbsd32/netbsd32.h    Fri Jan 25 09:04:51 2019 +0000
+++ b/sys/compat/netbsd32/netbsd32.h    Fri Jan 25 09:36:08 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32.h,v 1.116.2.18 2019/01/24 04:08:09 pgoyette Exp $     */
+/*     $NetBSD: netbsd32.h,v 1.116.2.19 2019/01/25 09:36:09 pgoyette Exp $     */
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -1177,8 +1177,6 @@
 MODULE_HOOK(netbsd32_sendsig_hook, void,
     (const ksiginfo_t *, const sigset_t *));
 
-MODULE_HOOK(netbsd32_machine32_hook, const char *, (void));
-
 extern struct sysent netbsd32_sysent[];
 extern const uint32_t netbsd32_sysent_nomodbits[]; 
 #ifdef SYSCALL_DEBUG 
diff -r f1ecc7ebf555 -r 365d77529cd2 sys/compat/netbsd32/netbsd32_mod.c
--- a/sys/compat/netbsd32/netbsd32_mod.c        Fri Jan 25 09:04:51 2019 +0000
+++ b/sys/compat/netbsd32/netbsd32_mod.c        Fri Jan 25 09:36:08 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_mod.c,v 1.13.16.18 2019/01/24 04:08:09 pgoyette Exp $ */
+/*     $NetBSD: netbsd32_mod.c,v 1.13.16.19 2019/01/25 09:36:09 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.13.16.18 2019/01/24 04:08:09 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.13.16.19 2019/01/25 09:36:09 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -54,8 +54,6 @@
     sizeof(Elf32_Addr)) + MAXPATHLEN + ALIGN(1))
 
 struct compat32_80_modctl_hook_t compat32_80_modctl_hook;
-struct netbsd32_machine32_hook_t netbsd32_machine32_hook;
-
 
 # define       DEPS1   "ksem,coredump,compat_util"
 
diff -r f1ecc7ebf555 -r 365d77529cd2 sys/kern/compat_stub.c
--- a/sys/kern/compat_stub.c    Fri Jan 25 09:04:51 2019 +0000
+++ b/sys/kern/compat_stub.c    Fri Jan 25 09:36:08 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.c,v 1.1.2.41 2019/01/24 04:08:09 pgoyette Exp $        */
+/* $NetBSD: compat_stub.c,v 1.1.2.42 2019/01/25 09:36:09 pgoyette Exp $        */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -247,3 +247,13 @@
  * Hook for sysvipc50_sysctl
  */
 struct sysvipc50_sysctl_hook_t sysvipc50_sysctl_hook;
+
+/*
+ * Hook for 32-bit machine name
+ *
+ * This probably would be better placed in compat/netbsd32/netbsd32_mod.c
+ * but the consumer code in linux32_exec_elf32.c is sometimes included in
+ * the main kernel, and not in a compat_netbsd32 module.  (In particular,
+ * this is true for i386 and sgimips.)
+ */
+struct netbsd32_machine32_hook_t netbsd32_machine32_hook;
diff -r f1ecc7ebf555 -r 365d77529cd2 sys/sys/compat_stub.h
--- a/sys/sys/compat_stub.h     Fri Jan 25 09:04:51 2019 +0000
+++ b/sys/sys/compat_stub.h     Fri Jan 25 09:36:08 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.h,v 1.1.2.54 2019/01/24 04:08:09 pgoyette Exp $        */
+/* $NetBSD: compat_stub.h,v 1.1.2.55 2019/01/25 09:36:09 pgoyette Exp $        */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -308,4 +308,13 @@
 #include <sys/sysctl.h>
 MODULE_HOOK(sysvipc50_sysctl_hook, int, (SYSCTLFN_PROTO));
 
+/* 
+ * Hook for 32-bit machine name
+ * 
+ * This probably would be better placed in compat/netbsd32/netbsd32_mod.c
+ * but the consumer code in linux32_exec_elf32.c is sometimes included in
+ * the main kernel, and not in a compat_netbsd32 module.  (In particular,
+ * this is true for i386 and sgimips.)
+ */
+MODULE_HOOK(netbsd32_machine32_hook, const char *, (void));
 #endif /* _SYS_COMPAT_STUB_H */



Home | Main Index | Thread Index | Old Index