Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-compat]: src/sys Hook up the arm compat_netbsd32_13 & _16 code
details: https://anonhg.NetBSD.org/src/rev/28f5a14bdee1
branches: pgoyette-compat
changeset: 830801:28f5a14bdee1
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Thu Sep 27 03:53:30 2018 +0000
description:
Hook up the arm compat_netbsd32_13 & _16 code
diffstat:
sys/arch/arm/arm32/netbsd32_machdep_13.c | 89 ++++++----------------------
sys/arch/arm/arm32/netbsd32_machdep_16.c | 98 ++++++++-----------------------
sys/compat/netbsd32/netbsd32.h | 4 +-
sys/compat/netbsd32/netbsd32_compat_13.c | 6 +-
4 files changed, 54 insertions(+), 143 deletions(-)
diffs (truncated from 302 to 300 lines):
diff -r ef567b79bbf2 -r 28f5a14bdee1 sys/arch/arm/arm32/netbsd32_machdep_13.c
--- a/sys/arch/arm/arm32/netbsd32_machdep_13.c Thu Sep 27 03:07:21 2018 +0000
+++ b/sys/arch/arm/arm32/netbsd32_machdep_13.c Thu Sep 27 03:53:30 2018 +0000
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: netbsd32_machdep_13.c,v 1.1.2.2 2018/09/27 02:41:20 pgoyette Exp $");
+__KERNEL_RCSID(1, "$NetBSD: netbsd32_machdep_13.c,v 1.1.2.3 2018/09/27 03:53:30 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -42,71 +42,16 @@
#include <sys/exec.h>
#include <sys/lwp.h>
#include <sys/signalvar.h>
+#include <sys/syscallvar.h>
#include <sys/syscallargs.h>
#include <uvm/uvm_extern.h>
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_exec.h>
+#include <compat/netbsd32/netbsd32_syscall.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
-const char machine32[] = MACHINE;
-const char machine_arch32[] = MACHINE_ARCH;
-
-int
-cpu_coredump32(struct lwp *l, struct coredump_iostate *iocookie,
- struct core32 *chdr)
-{
- return cpu_coredump(l, iocookie, (struct core *)chdr);
-}
-
-void
-netbsd32_sendsig (const ksiginfo_t *ksi, const sigset_t *ss)
-{
- sendsig(ksi, ss);
-}
-
-void
-startlwp32(void *arg)
-{
- startlwp(arg);
-}
-
-int
-cpu_mcontext32_validate(struct lwp *l, const mcontext32_t *mcp)
-{
- return cpu_mcontext_validate(l, mcp);
-}
-void
-cpu_getmcontext32(struct lwp *l, mcontext32_t *mcp, unsigned int *flagsp)
-{
- cpu_getmcontext(l, mcp, flagsp);
-}
-
-int
-cpu_setmcontext32(struct lwp *l, const mcontext32_t *mcp, unsigned int flags)
-{
- return cpu_setmcontext(l, mcp, flags);
-}
-
-int
-netbsd32_sysarch(struct lwp *l, const struct netbsd32_sysarch_args *uap,
- register_t *retval)
-{
- return sys_sysarch(l, (const struct sys_sysarch_args *)uap, retval);
-}
-
-vaddr_t
-netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t sz,
- int topdown)
-{
- if (topdown)
- return VM_DEFAULT_ADDRESS_TOPDOWN(base, sz);
- else
- return VM_DEFAULT_ADDRESS_BOTTOMUP(base, sz);
-}
-
-
#ifdef COMPAT_13
int
compat_13_netbsd32_sigreturn(struct lwp *l,
@@ -119,18 +64,26 @@
return compat_13_sys_sigreturn(l, &ua, retval);
}
-#endif
-#ifdef COMPAT_16
-int
-compat_16_netbsd32___sigreturn14(struct lwp *l,
- const struct compat_16_netbsd32___sigreturn14_args *uap,
- register_t *retval)
+static struct syscall_package compat_arm32_netbsd32_13_syscalls[] = {
+ { NETBSD32_SYS_compat_13_sigreturn13, 0,
+ (sy_call_t *)compat_13_netbsd32_sigreturn },
+ { 0, 0, NULL }
+};
+
+void
+netbsd32_machdep_md_13_init(void)
{
- struct compat_16_sys___sigreturn14_args ua;
+
+ (void)syscall_establish(&emul_netbsd32,
+ compat_arm32_netbsd32_13_syscalls);
+}
+
+void
+netbsd32_machdep_md_13_fini(void)
+{
- NETBSD32TOP_UAP(sigcntxp, struct sigcontext *);
-
- return compat_16_sys___sigreturn14(l, &ua, retval);
+ (void)syscall_disestablish(&emul_netbsd32,
+ compat_arm32_netbsd32_13_syscalls);
}
#endif
diff -r ef567b79bbf2 -r 28f5a14bdee1 sys/arch/arm/arm32/netbsd32_machdep_16.c
--- a/sys/arch/arm/arm32/netbsd32_machdep_16.c Thu Sep 27 03:07:21 2018 +0000
+++ b/sys/arch/arm/arm32/netbsd32_machdep_16.c Thu Sep 27 03:53:30 2018 +0000
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.2 2018/09/27 02:41:20 pgoyette Exp $");
+__KERNEL_RCSID(1, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.3 2018/09/27 03:53:30 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -42,87 +42,19 @@
#include <sys/exec.h>
#include <sys/lwp.h>
#include <sys/signalvar.h>
+#include <sys/syscallvar.h>
#include <sys/syscallargs.h>
#include <uvm/uvm_extern.h>
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_exec.h>
+#include <compat/netbsd32/netbsd32_syscall.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
-const char machine32[] = MACHINE;
-const char machine_arch32[] = MACHINE_ARCH;
-
-int
-cpu_coredump32(struct lwp *l, struct coredump_iostate *iocookie,
- struct core32 *chdr)
-{
- return cpu_coredump(l, iocookie, (struct core *)chdr);
-}
-
-void
-netbsd32_sendsig (const ksiginfo_t *ksi, const sigset_t *ss)
-{
- sendsig(ksi, ss);
-}
-
-void
-startlwp32(void *arg)
-{
- startlwp(arg);
-}
-
-int
-cpu_mcontext32_validate(struct lwp *l, const mcontext32_t *mcp)
-{
- return cpu_mcontext_validate(l, mcp);
-}
-void
-cpu_getmcontext32(struct lwp *l, mcontext32_t *mcp, unsigned int *flagsp)
-{
- cpu_getmcontext(l, mcp, flagsp);
-}
+#ifdef COMPAT_16
int
-cpu_setmcontext32(struct lwp *l, const mcontext32_t *mcp, unsigned int flags)
-{
- return cpu_setmcontext(l, mcp, flags);
-}
-
-int
-netbsd32_sysarch(struct lwp *l, const struct netbsd32_sysarch_args *uap,
- register_t *retval)
-{
- return sys_sysarch(l, (const struct sys_sysarch_args *)uap, retval);
-}
-
-vaddr_t
-netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t sz,
- int topdown)
-{
- if (topdown)
- return VM_DEFAULT_ADDRESS_TOPDOWN(base, sz);
- else
- return VM_DEFAULT_ADDRESS_BOTTOMUP(base, sz);
-}
-
-
-#ifdef COMPAT_13
-int
-compat_13_netbsd32_sigreturn(struct lwp *l,
- const struct compat_13_netbsd32_sigreturn_args *uap,
- register_t *retval)
-{
- struct compat_13_sys_sigreturn_args ua;
-
- NETBSD32TOP_UAP(sigcntxp, struct sigcontext13 *);
-
- return compat_13_sys_sigreturn(l, &ua, retval);
-}
-#endif
-
-#ifdef COMPAT_16
-int
compat_16_netbsd32___sigreturn14(struct lwp *l,
const struct compat_16_netbsd32___sigreturn14_args *uap,
register_t *retval)
@@ -133,4 +65,26 @@
return compat_16_sys___sigreturn14(l, &ua, retval);
}
+
+static struct syscall_package compat_arm32_netbsd32_16_syscalls[] = {
+ { NETBSD32_SYS_compat_16_netbsd32___sigreturn14, 0,
+ (sy_call_t *)compat_16_netbsd32___sigreturn14 },
+ { 0, 0, NULL }
+};
+
+void
+netbsd32_machdep_md_16_init(void)
+{
+
+ (void)syscall_establish(&emul_netbsd32,
+ compat_arm32_netbsd32_16_syscalls);
+}
+
+void
+netbsd32_machdep_md_16_fini(void)
+{
+
+ (void)syscall_disestablish(&emul_netbsd32,
+ compat_arm32_netbsd32_16_syscalls);
+}
#endif
diff -r ef567b79bbf2 -r 28f5a14bdee1 sys/compat/netbsd32/netbsd32.h
--- a/sys/compat/netbsd32/netbsd32.h Thu Sep 27 03:07:21 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32.h Thu Sep 27 03:53:30 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32.h,v 1.116.2.14 2018/09/24 23:06:02 pgoyette Exp $ */
+/* $NetBSD: netbsd32.h,v 1.116.2.15 2018/09/27 03:53:30 pgoyette Exp $ */
/*
* Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -1194,6 +1194,8 @@
*/
void netbsd32_machdep_md_init(void);
void netbsd32_machdep_md_fini(void);
+void netbsd32_machdep_md_13_init(void);
+void netbsd32_machdep_md_13_fini(void);
void netbsd32_machdep_md_16_init(void);
void netbsd32_machdep_md_16_fini(void);
diff -r ef567b79bbf2 -r 28f5a14bdee1 sys/compat/netbsd32/netbsd32_compat_13.c
--- a/sys/compat/netbsd32/netbsd32_compat_13.c Thu Sep 27 03:07:21 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_13.c Thu Sep 27 03:53:30 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_13.c,v 1.26.28.6 2018/09/11 21:18:32 pgoyette Exp $ */
+/* $NetBSD: netbsd32_compat_13.c,v 1.26.28.7 2018/09/27 03:53:30 pgoyette Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_13.c,v 1.26.28.6 2018/09/11 21:18:32 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_13.c,v 1.26.28.7 2018/09/27 03:53:30 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -112,10 +112,12 @@
switch (cmd) {
case MODULE_CMD_INIT:
+ netbsd32_machdep_md_13_init();
return syscall_establish(&emul_netbsd32,
compat_netbsd32_13_syscalls);
case MODULE_CMD_FINI:
+ netbsd32_machdep_md_13_fini();
return syscall_disestablish(&emul_netbsd32,
Home |
Main Index |
Thread Index |
Old Index