netbsd32_machdep_16.c revision 1.2.4.2 1 1.2.4.2 christos /*-
2 1.2.4.2 christos * Copyright (c) 2012 The NetBSD Foundation, Inc.
3 1.2.4.2 christos * All rights reserved.
4 1.2.4.2 christos *
5 1.2.4.2 christos * This code is derived from software contributed to The NetBSD Foundation
6 1.2.4.2 christos * by Matt Thomas of 3am Software Foundry.
7 1.2.4.2 christos *
8 1.2.4.2 christos * Redistribution and use in source and binary forms, with or without
9 1.2.4.2 christos * modification, are permitted provided that the following conditions
10 1.2.4.2 christos * are met:
11 1.2.4.2 christos * 1. Redistributions of source code must retain the above copyright
12 1.2.4.2 christos * notice, this list of conditions and the following disclaimer.
13 1.2.4.2 christos * 2. Redistributions in binary form must reproduce the above copyright
14 1.2.4.2 christos * notice, this list of conditions and the following disclaimer in the
15 1.2.4.2 christos * documentation and/or other materials provided with the distribution.
16 1.2.4.2 christos *
17 1.2.4.2 christos * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 1.2.4.2 christos * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 1.2.4.2 christos * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 1.2.4.2 christos * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 1.2.4.2 christos * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 1.2.4.2 christos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 1.2.4.2 christos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 1.2.4.2 christos * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 1.2.4.2 christos * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 1.2.4.2 christos * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 1.2.4.2 christos * POSSIBILITY OF SUCH DAMAGE.
28 1.2.4.2 christos */
29 1.2.4.2 christos
30 1.2.4.2 christos #include <sys/cdefs.h>
31 1.2.4.2 christos
32 1.2.4.2 christos __KERNEL_RCSID(1, "$NetBSD: netbsd32_machdep_16.c,v 1.2.4.2 2019/06/10 22:05:51 christos Exp $");
33 1.2.4.2 christos
34 1.2.4.2 christos #ifdef _KERNEL_OPT
35 1.2.4.2 christos #include "opt_compat_netbsd.h"
36 1.2.4.2 christos #include "opt_compat_netbsd32.h"
37 1.2.4.2 christos #include "opt_coredump.h"
38 1.2.4.2 christos #endif
39 1.2.4.2 christos
40 1.2.4.2 christos #include <sys/param.h>
41 1.2.4.2 christos #include <sys/core.h>
42 1.2.4.2 christos #include <sys/exec.h>
43 1.2.4.2 christos #include <sys/lwp.h>
44 1.2.4.2 christos #include <sys/signalvar.h>
45 1.2.4.2 christos #include <sys/syscallvar.h>
46 1.2.4.2 christos #include <sys/syscallargs.h>
47 1.2.4.2 christos
48 1.2.4.2 christos #include <uvm/uvm_extern.h>
49 1.2.4.2 christos
50 1.2.4.2 christos #include <compat/netbsd32/netbsd32.h>
51 1.2.4.2 christos #include <compat/netbsd32/netbsd32_exec.h>
52 1.2.4.2 christos #include <compat/netbsd32/netbsd32_syscall.h>
53 1.2.4.2 christos #include <compat/netbsd32/netbsd32_syscallargs.h>
54 1.2.4.2 christos
55 1.2.4.2 christos #ifdef COMPAT_16
56 1.2.4.2 christos
57 1.2.4.2 christos int
58 1.2.4.2 christos compat_16_netbsd32___sigreturn14(struct lwp *l,
59 1.2.4.2 christos const struct compat_16_netbsd32___sigreturn14_args *uap,
60 1.2.4.2 christos register_t *retval)
61 1.2.4.2 christos {
62 1.2.4.2 christos struct compat_16_sys___sigreturn14_args ua;
63 1.2.4.2 christos
64 1.2.4.2 christos NETBSD32TOP_UAP(sigcntxp, struct sigcontext *);
65 1.2.4.2 christos
66 1.2.4.2 christos return compat_16_sys___sigreturn14(l, &ua, retval);
67 1.2.4.2 christos }
68 1.2.4.2 christos
69 1.2.4.2 christos static struct syscall_package compat_arm32_netbsd32_16_syscalls[] = {
70 1.2.4.2 christos { NETBSD32_SYS_compat_16_netbsd32___sigreturn14, 0,
71 1.2.4.2 christos (sy_call_t *)compat_16_netbsd32___sigreturn14 },
72 1.2.4.2 christos { 0, 0, NULL }
73 1.2.4.2 christos };
74 1.2.4.2 christos
75 1.2.4.2 christos void
76 1.2.4.2 christos netbsd32_machdep_md_16_init(void)
77 1.2.4.2 christos {
78 1.2.4.2 christos
79 1.2.4.2 christos (void)syscall_establish(&emul_netbsd32,
80 1.2.4.2 christos compat_arm32_netbsd32_16_syscalls);
81 1.2.4.2 christos }
82 1.2.4.2 christos
83 1.2.4.2 christos void
84 1.2.4.2 christos netbsd32_machdep_md_16_fini(void)
85 1.2.4.2 christos {
86 1.2.4.2 christos
87 1.2.4.2 christos (void)syscall_disestablish(&emul_netbsd32,
88 1.2.4.2 christos compat_arm32_netbsd32_16_syscalls);
89 1.2.4.2 christos }
90 1.2.4.2 christos #endif
91