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