Module Name: src Committed By: pgoyette Date: Thu Sep 27 03:53:30 UTC 2018
Modified Files: src/sys/arch/arm/arm32 [pgoyette-compat]: netbsd32_machdep_13.c netbsd32_machdep_16.c src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32.h netbsd32_compat_13.c Log Message: Hook up the arm compat_netbsd32_13 & _16 code To generate a diff of this commit: cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/arm/arm32/netbsd32_machdep_13.c \ src/sys/arch/arm/arm32/netbsd32_machdep_16.c cvs rdiff -u -r1.116.2.14 -r1.116.2.15 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.26.28.6 -r1.26.28.7 \ src/sys/compat/netbsd32/netbsd32_compat_13.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/arm32/netbsd32_machdep_13.c diff -u src/sys/arch/arm/arm32/netbsd32_machdep_13.c:1.1.2.2 src/sys/arch/arm/arm32/netbsd32_machdep_13.c:1.1.2.3 --- src/sys/arch/arm/arm32/netbsd32_machdep_13.c:1.1.2.2 Thu Sep 27 02:41:20 2018 +++ src/sys/arch/arm/arm32/netbsd32_machdep_13.c Thu Sep 27 03:53:30 2018 @@ -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 @@ __KERNEL_RCSID(1, "$NetBSD: netbsd32_mac #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 @@ compat_13_netbsd32_sigreturn(struct lwp 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) +{ + + (void)syscall_establish(&emul_netbsd32, + compat_arm32_netbsd32_13_syscalls); +} + +void +netbsd32_machdep_md_13_fini(void) { - struct compat_16_sys___sigreturn14_args ua; - - NETBSD32TOP_UAP(sigcntxp, struct sigcontext *); - return compat_16_sys___sigreturn14(l, &ua, retval); + (void)syscall_disestablish(&emul_netbsd32, + compat_arm32_netbsd32_13_syscalls); } #endif Index: src/sys/arch/arm/arm32/netbsd32_machdep_16.c diff -u src/sys/arch/arm/arm32/netbsd32_machdep_16.c:1.1.2.2 src/sys/arch/arm/arm32/netbsd32_machdep_16.c:1.1.2.3 --- src/sys/arch/arm/arm32/netbsd32_machdep_16.c:1.1.2.2 Thu Sep 27 02:41:20 2018 +++ src/sys/arch/arm/arm32/netbsd32_machdep_16.c Thu Sep 27 03:53:30 2018 @@ -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,95 +42,49 @@ __KERNEL_RCSID(1, "$NetBSD: netbsd32_mac #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); -} +#ifdef COMPAT_16 int -netbsd32_sysarch(struct lwp *l, const struct netbsd32_sysarch_args *uap, +compat_16_netbsd32___sigreturn14(struct lwp *l, + const struct compat_16_netbsd32___sigreturn14_args *uap, register_t *retval) { - return sys_sysarch(l, (const struct sys_sysarch_args *)uap, retval); -} + struct compat_16_sys___sigreturn14_args ua; -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); + NETBSD32TOP_UAP(sigcntxp, struct sigcontext *); + + 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 } +}; -#ifdef COMPAT_13 -int -compat_13_netbsd32_sigreturn(struct lwp *l, - const struct compat_13_netbsd32_sigreturn_args *uap, - register_t *retval) +void +netbsd32_machdep_md_16_init(void) { - struct compat_13_sys_sigreturn_args ua; - - NETBSD32TOP_UAP(sigcntxp, struct sigcontext13 *); - - return compat_13_sys_sigreturn(l, &ua, retval); + + (void)syscall_establish(&emul_netbsd32, + compat_arm32_netbsd32_16_syscalls); } -#endif - -#ifdef COMPAT_16 -int -compat_16_netbsd32___sigreturn14(struct lwp *l, - const struct compat_16_netbsd32___sigreturn14_args *uap, - register_t *retval) + +void +netbsd32_machdep_md_16_fini(void) { - struct compat_16_sys___sigreturn14_args ua; - NETBSD32TOP_UAP(sigcntxp, struct sigcontext *); - - return compat_16_sys___sigreturn14(l, &ua, retval); + (void)syscall_disestablish(&emul_netbsd32, + compat_arm32_netbsd32_16_syscalls); } #endif Index: src/sys/compat/netbsd32/netbsd32.h diff -u src/sys/compat/netbsd32/netbsd32.h:1.116.2.14 src/sys/compat/netbsd32/netbsd32.h:1.116.2.15 --- src/sys/compat/netbsd32/netbsd32.h:1.116.2.14 Mon Sep 24 23:06:02 2018 +++ src/sys/compat/netbsd32/netbsd32.h Thu Sep 27 03:53:30 2018 @@ -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 @@ extern char netbsd32_sigcode[], netbsd32 */ 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); Index: src/sys/compat/netbsd32/netbsd32_compat_13.c diff -u src/sys/compat/netbsd32/netbsd32_compat_13.c:1.26.28.6 src/sys/compat/netbsd32/netbsd32_compat_13.c:1.26.28.7 --- src/sys/compat/netbsd32/netbsd32_compat_13.c:1.26.28.6 Tue Sep 11 21:18:32 2018 +++ src/sys/compat/netbsd32/netbsd32_compat_13.c Thu Sep 27 03:53:30 2018 @@ -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 @@ compat_netbsd32_13_modcmd(modcmd_t cmd, 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, compat_netbsd32_13_syscalls);