qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 102/108] linux-user: Split out atomic_barrier, ge


From: Richard Henderson
Subject: [Qemu-devel] [PATCH v2 102/108] linux-user: Split out atomic_barrier, gethostname
Date: Sat, 9 Jun 2018 17:02:14 -1000

Signed-off-by: Richard Henderson <address@hidden>
---
 linux-user/syscall.c | 49 ++++++++++++++++++++++++++------------------
 1 file changed, 29 insertions(+), 20 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 91d90c7417..f898e70e98 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7552,6 +7552,14 @@ IMPL(arch_prctl)
 }
 #endif
 
+#ifdef TARGET_NR_atomic_barrier
+IMPL(atomic_barrier)
+{
+    /* Like the kernel implementation and the qemu arm barrier, no-op this.  */
+    return 0;
+}
+#endif
+
 #ifdef TARGET_NR_bind
 IMPL(bind)
 {
@@ -8987,6 +8995,21 @@ IMPL(getgroups32)
 }
 #endif
 
+#ifdef TARGET_NR_gethostname
+IMPL(gethostname)
+{
+    char *name = lock_user(VERIFY_WRITE, arg1, arg2, 0);
+    abi_long ret;
+
+    if (!name) {
+        ret = -TARGET_EFAULT;
+    }
+    ret = get_errno(gethostname(name, arg2));
+    unlock_user(name, arg1, arg2);
+    return ret;
+}
+#endif
+
 IMPL(getitimer)
 {
     struct itimerval value;
@@ -13002,19 +13025,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned 
num, abi_long arg1,
     abi_long ret;
 
     switch(num) {
-#ifdef TARGET_NR_gethostname
-    case TARGET_NR_gethostname:
-    {
-        char *name = lock_user(VERIFY_WRITE, arg1, arg2, 0);
-        if (name) {
-            ret = get_errno(gethostname(name, arg2));
-            unlock_user(name, arg1, arg2);
-        } else {
-            ret = -TARGET_EFAULT;
-        }
-        return ret;
-    }
-#endif
 #ifdef TARGET_NR_atomic_cmpxchg_32
     case TARGET_NR_atomic_cmpxchg_32:
     {
@@ -13036,13 +13046,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned 
num, abi_long arg1,
         return mem_value;
     }
 #endif
-#ifdef TARGET_NR_atomic_barrier
-    case TARGET_NR_atomic_barrier:
-        /* Like the kernel implementation and the
-           qemu arm barrier, no-op this? */
-        return 0;
-#endif
-
 #ifdef TARGET_NR_timer_create
     case TARGET_NR_timer_create:
     {
@@ -13293,6 +13296,9 @@ static impl_fn *syscall_table(unsigned num)
 #endif
 #ifdef TARGET_NR_bind
         SYSCALL(bind);
+#endif
+#ifdef TARGET_NR_atomic_barrier
+        SYSCALL(atomic_barrier);
 #endif
         SYSCALL(brk);
 #ifdef TARGET_NR_cacheflush
@@ -13448,6 +13454,9 @@ static impl_fn *syscall_table(unsigned num)
         SYSCALL(getgroups);
 #ifdef TARGET_NR_getgroups32
         SYSCALL(getgroups32);
+#endif
+#ifdef TARGET_NR_gethostname
+        SYSCALL(gethostname);
 #endif
         SYSCALL(getitimer);
 #ifdef TARGET_NR_getpagesize
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]