| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $ */ | | 1 | /* $NetBSD: netbsd32_netbsd.c,v 1.235 2023/07/30 05:30:45 rin Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green | | 4 | * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -17,27 +17,27 @@ | | | @@ -17,27 +17,27 @@ |
17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | | 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | | 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
26 | * SUCH DAMAGE. | | 26 | * SUCH DAMAGE. |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | #include <sys/cdefs.h> | | 29 | #include <sys/cdefs.h> |
30 | __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $"); | | 30 | __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.235 2023/07/30 05:30:45 rin Exp $"); |
31 | | | 31 | |
32 | /* | | 32 | /* |
33 | * below are all the standard NetBSD system calls, in the 32bit | | 33 | * below are all the standard NetBSD system calls, in the 32bit |
34 | * environment, with the necessary conversions to 64bit before calling | | 34 | * environment, with the necessary conversions to 64bit before calling |
35 | * the real syscall. anything that needs special attention is handled | | 35 | * the real syscall. anything that needs special attention is handled |
36 | * elsewhere - this file should only contain structure assignment and | | 36 | * elsewhere - this file should only contain structure assignment and |
37 | * calls to the original function. | | 37 | * calls to the original function. |
38 | */ | | 38 | */ |
39 | | | 39 | |
40 | /* | | 40 | /* |
41 | * below are all the standard NetBSD system calls, in the 32bit | | 41 | * below are all the standard NetBSD system calls, in the 32bit |
42 | * environment, with the necessary conversions to 64bit before calling | | 42 | * environment, with the necessary conversions to 64bit before calling |
43 | * the real syscall. anything that needs special attention is handled | | 43 | * the real syscall. anything that needs special attention is handled |
| @@ -2638,26 +2638,41 @@ netbsd32_eventfd(struct lwp *l, | | | @@ -2638,26 +2638,41 @@ netbsd32_eventfd(struct lwp *l, |
2638 | const struct netbsd32_eventfd_args *uap, register_t *retval) | | 2638 | const struct netbsd32_eventfd_args *uap, register_t *retval) |
2639 | { | | 2639 | { |
2640 | /* { | | 2640 | /* { |
2641 | syscallarg(unsigned int) val; | | 2641 | syscallarg(unsigned int) val; |
2642 | syscallarg(int) flags; | | 2642 | syscallarg(int) flags; |
2643 | } */ | | 2643 | } */ |
2644 | struct sys_eventfd_args ua; | | 2644 | struct sys_eventfd_args ua; |
2645 | | | 2645 | |
2646 | NETBSD32TO64_UAP(val); | | 2646 | NETBSD32TO64_UAP(val); |
2647 | NETBSD32TO64_UAP(flags); | | 2647 | NETBSD32TO64_UAP(flags); |
2648 | return sys_eventfd(l, &ua, retval); | | 2648 | return sys_eventfd(l, &ua, retval); |
2649 | } | | 2649 | } |
2650 | | | 2650 | |
| | | 2651 | int |
| | | 2652 | netbsd32_memfd_create(struct lwp *l, |
| | | 2653 | const struct netbsd32_memfd_create_args *uap, register_t *retval) |
| | | 2654 | { |
| | | 2655 | /* { |
| | | 2656 | syscallarg(const netbsd32_charp) name; |
| | | 2657 | syscallarg(unsigned int) flags; |
| | | 2658 | } */ |
| | | 2659 | struct sys_memfd_create_args ua; |
| | | 2660 | |
| | | 2661 | NETBSD32TOP_UAP(name, const char); |
| | | 2662 | NETBSD32TO64_UAP(flags); |
| | | 2663 | return sys_memfd_create(l, &ua, retval); |
| | | 2664 | } |
| | | 2665 | |
2651 | /* | | 2666 | /* |
2652 | * MI indirect system call support. | | 2667 | * MI indirect system call support. |
2653 | * Only used if the MD netbsd32_syscall.c doesn't intercept the calls. | | 2668 | * Only used if the MD netbsd32_syscall.c doesn't intercept the calls. |
2654 | */ | | 2669 | */ |
2655 | | | 2670 | |
2656 | #define NETBSD32_SYSCALL | | 2671 | #define NETBSD32_SYSCALL |
2657 | #undef SYS_NSYSENT | | 2672 | #undef SYS_NSYSENT |
2658 | #define SYS_NSYSENT NETBSD32_SYS_NSYSENT | | 2673 | #define SYS_NSYSENT NETBSD32_SYS_NSYSENT |
2659 | | | 2674 | |
2660 | #define SYS_SYSCALL netbsd32_syscall | | 2675 | #define SYS_SYSCALL netbsd32_syscall |
2661 | #include "../../kern/sys_syscall.c" | | 2676 | #include "../../kern/sys_syscall.c" |
2662 | #undef SYS_SYSCALL | | 2677 | #undef SYS_SYSCALL |
2663 | | | 2678 | |