qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 2.2 1/2] linux-user: Fix timer creation tswap


From: Alexander Graf
Subject: [Qemu-devel] [PATCH 2.2 1/2] linux-user: Fix timer creation tswap
Date: Mon, 10 Nov 2014 17:46:08 +0100

The timer pointer field we're writing a new timer ID into is of field
abi_ulong which means we need to swab 64bits on 64bit ABI targets.

Change the tswap from 32 to l to give us correct foreign-endian results.

Signed-off-by: Alexander Graf <address@hidden>
---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a175cc1..f3e22c8 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9604,7 +9604,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
                 if (!lock_user_struct(VERIFY_WRITE, ptarget_timer, arg3, 1)) {
                     goto efault;
                 }
-                ptarget_timer->ptr = tswap32(0xcafe0000 | timer_index);
+                ptarget_timer->ptr = tswapl(0xcafe0000 | timer_index);
                 unlock_user_struct(ptarget_timer, arg3, 1);
             }
         }
-- 
1.7.12.4




reply via email to

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