[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 71/74] linux-user: Split out swapon, swapoff
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v7 71/74] linux-user: Split out swapon, swapoff |
Date: |
Sun, 19 May 2019 13:37:23 -0700 |
Signed-off-by: Richard Henderson <address@hidden>
---
linux-user/syscall-defs.h | 2 ++
linux-user/syscall-file.inc.c | 26 ++++++++++++++++++++++++++
linux-user/syscall.c | 16 ----------------
linux-user/strace.list | 6 ------
4 files changed, 28 insertions(+), 22 deletions(-)
diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h
index 5625c268c3..34e799d206 100644
--- a/linux-user/syscall-defs.h
+++ b/linux-user/syscall-defs.h
@@ -279,6 +279,8 @@ SYSCALL_DEF(ssetmask, ARG_HEX);
#ifdef TARGET_NR_stime
SYSCALL_DEF(stime, ARG_PTR);
#endif
+SYSCALL_DEF(swapoff, ARG_STR);
+SYSCALL_DEF(swapon, ARG_STR, ARG_HEX);
#ifdef TARGET_NR_symlink
SYSCALL_DEF(symlink, ARG_STR, ARG_STR);
#endif
diff --git a/linux-user/syscall-file.inc.c b/linux-user/syscall-file.inc.c
index e3749f0fb4..bdf42ad437 100644
--- a/linux-user/syscall-file.inc.c
+++ b/linux-user/syscall-file.inc.c
@@ -1254,6 +1254,32 @@ SYSCALL_IMPL(select)
}
#endif
+SYSCALL_IMPL(swapoff)
+{
+ char *p = lock_user_string(arg1);
+ abi_long ret;
+
+ if (!p) {
+ return -TARGET_EFAULT;
+ }
+ ret = get_errno(swapoff(p));
+ unlock_user(p, arg1, 0);
+ return ret;
+}
+
+SYSCALL_IMPL(swapon)
+{
+ char *p = lock_user_string(arg1);
+ abi_long ret;
+
+ if (!p) {
+ return -TARGET_EFAULT;
+ }
+ ret = get_errno(swapon(p, arg2));
+ unlock_user(p, arg1, 0);
+ return ret;
+}
+
static abi_long do_symlinkat(abi_ulong guest_target, int dirfd,
abi_ulong guest_path)
{
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index fccf9ee184..ead2e5c2b8 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4158,14 +4158,6 @@ static abi_long do_syscall1(void *cpu_env, int num,
abi_long arg1,
void *p;
switch(num) {
-#ifdef TARGET_NR_swapon
- case TARGET_NR_swapon:
- if (!(p = lock_user_string(arg1)))
- return -TARGET_EFAULT;
- ret = get_errno(swapon(p, arg2));
- unlock_user(p, arg1, 0);
- return ret;
-#endif
case TARGET_NR_reboot:
if (arg3 == LINUX_REBOOT_CMD_RESTART2) {
/* arg4 must be ignored in all other cases */
@@ -4503,14 +4495,6 @@ static abi_long do_syscall1(void *cpu_env, int num,
abi_long arg1,
case TARGET_NR_syscall:
return do_syscall(cpu_env, arg1 & 0xffff, arg2, arg3, arg4, arg5,
arg6, arg7, arg8, 0);
-#endif
-#ifdef TARGET_NR_swapoff
- case TARGET_NR_swapoff:
- if (!(p = lock_user_string(arg1)))
- return -TARGET_EFAULT;
- ret = get_errno(swapoff(p));
- unlock_user(p, arg1, 0);
- return ret;
#endif
case TARGET_NR_sysinfo:
{
diff --git a/linux-user/strace.list b/linux-user/strace.list
index d9db80335d..3d2e398439 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -1116,12 +1116,6 @@
#ifdef TARGET_NR_swapcontext
{ TARGET_NR_swapcontext, "swapcontext" , NULL, NULL, NULL },
#endif
-#ifdef TARGET_NR_swapoff
-{ TARGET_NR_swapoff, "swapoff" , NULL, NULL, NULL },
-#endif
-#ifdef TARGET_NR_swapon
-{ TARGET_NR_swapon, "swapon" , NULL, NULL, NULL },
-#endif
#ifdef TARGET_NR_syscall
{ TARGET_NR_syscall, "syscall" , NULL, NULL, NULL },
#endif
--
2.17.1
- [Qemu-devel] [PATCH v7 65/74] linux-user: Split out getrlimit, setrlimit, (continued)
- [Qemu-devel] [PATCH v7 65/74] linux-user: Split out getrlimit, setrlimit, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 61/74] linux-user: Split out rt_sigtimedwait, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 62/74] linux-user: Split out rt_sigqueueinfo, rt_tgsigqueueinfo, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 63/74] linux-user: Split out sigreturn, rt_sigreturn, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 66/74] linux-user: Split out getrusage, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 67/74] linux-user: Split out gettimeofday, settimeofday, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 69/74] linux-user: Split out pselect6, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 68/74] linux-user: Split out select, _newselect, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 70/74] linux-user: Split out symlink, symlinkat, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 71/74] linux-user: Split out swapon, swapoff,
Richard Henderson <=
- [Qemu-devel] [PATCH v7 72/74] linux-user: Split out reboot, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 73/74] linux-user: Split out truncate, truncate64, ftruncate, ftruncate64, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 74/74] linux-user: Split out getpriority, setpriority, Richard Henderson, 2019/05/19
- Re: [Qemu-devel] [PATCH v7 00/74] linux-user: Split do_syscall, Laurent Vivier, 2019/05/20
- Re: [Qemu-devel] [PATCH v7 00/74] linux-user: Split do_syscall, Peter Maydell, 2019/05/20
- Re: [Qemu-devel] [PATCH v7 00/74] linux-user: Split do_syscall, Aleksandar Markovic, 2019/05/22