[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/22] linux-user: Fix definition of target_sigevent
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 13/22] linux-user: Fix definition of target_sigevent for 32-bit guests |
Date: |
Mon, 17 Oct 2016 16:24:31 +0300 |
From: Peter Maydell <address@hidden>
The sigevent structure includes a union with some fields which
are pointers. For the QEMU target_sigevent structure we must
represent these as abi_ulongs, not host function pointers.
This error was causing the compiler to believe it should 8-align
the _sigev_un union on a 64-bit host, which meant that the
code in target_to_host_sigevent() was looking at the wrong
offset to find the _tid field, and timer_create() would
spuriously fail with EINVAL.
This fixes the final loose end noted in LP:1042388.
While we're editing the structure, switch the 'int32_t' fields
to 'abi_int'; this will only matter for guests with non-standard
integer alignment like m68k.
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/syscall_defs.h | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 61270ef..714ae28 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2664,15 +2664,19 @@ typedef int32_t target_timer_t;
struct target_sigevent {
target_sigval_t sigev_value;
- int32_t sigev_signo;
- int32_t sigev_notify;
+ abi_int sigev_signo;
+ abi_int sigev_notify;
union {
- int32_t _pad[TARGET_SIGEV_PAD_SIZE];
- int32_t _tid;
+ abi_int _pad[TARGET_SIGEV_PAD_SIZE];
+ abi_int _tid;
+ /* The kernel (and thus QEMU) never looks at these;
+ * they're only used as part of the ABI between a
+ * userspace program and libc.
+ */
struct {
- void (*_function)(sigval_t);
- void *_attribute;
+ abi_ulong _function;
+ abi_ulong _attribute;
} _sigev_thread;
} _sigev_un;
};
--
2.1.4
- [Qemu-devel] [PULL 01/22] linux-user: Add support for adjtimex() syscall, (continued)
- [Qemu-devel] [PULL 01/22] linux-user: Add support for adjtimex() syscall, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 03/22] linux-user: Fix mq_open() syscall support, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 04/22] linux-user: Fix msgrcv() and msgsnd() syscalls support, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 08/22] linux-user: sparc64: Use correct target SHMLBA in shmat(), riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 06/22] linux-user: Fix syslog() syscall support, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 11/22] linux-user: Don't use alloca() for epoll_wait's epoll event array, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 09/22] linux-user: add kcmp() syscall, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 05/22] linux-user: Fix socketcall() syscall support, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 07/22] linux-user: Remove a duplicate item from strace.list, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 10/22] linux-user: add RTA_PRIORITY in netlink, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 13/22] linux-user: Fix definition of target_sigevent for 32-bit guests,
riku . voipio <=
- [Qemu-devel] [PULL 14/22] linux-user: Add support for clock_adjtime() syscall, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 15/22] linux-user: Add support for syncfs() syscall, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 12/22] linux-user: use libc wrapper instead of direct mremap syscall, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 19/22] linux-user: Fix fadvise64() syscall support for Mips32, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 18/22] linux-user: Redirect termbits.h for Mips64 to termbits.h for Mips32, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 17/22] linux-user: Update ioctls definitions for Mips32, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 16/22] linux-user: Update mips_syscall_args[] array in main.c, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 20/22] linux-user: added support for preadv() system call., riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 22/22] linux-user: disable unicore32 linux-user build, riku . voipio, 2016/10/17
- [Qemu-devel] [PULL 21/22] linux-user: added support for pwritev() system call., riku . voipio, 2016/10/17