From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Max Filippov <jcmvbkbc@gmail.com>,
Laurent Vivier <laurent@vivier.eu>,
Riku Voipio <riku.voipio@iki.fi>, Eric Blake <eblake@redhat.com>
Subject: [Qemu-devel] [PATCH v2 2/6] linux-user: fix flock/flock64 padding
Date: Thu, 10 May 2018 01:11:19 +0200 [thread overview]
Message-ID: <20180509231123.20864-3-laurent@vivier.eu> (raw)
In-Reply-To: <20180509231123.20864-1-laurent@vivier.eu>
include/uapi/asm-generic/fcntl.h insert a padding macro at
the end of the structures flock and flock64.
This macro is defined to "short __unused;" on sparc,
and "long pad[4]" on mips.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
---
linux-user/syscall_defs.h | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index ec3f561685..e4cd87cc00 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2643,6 +2643,17 @@ struct target_statfs64 {
#define TARGET_O_SYNC (TARGET___O_SYNC | TARGET_O_DSYNC)
#endif
+#if defined(TARGET_SPARC)
+#define TARGET_ARCH_FLOCK_PAD abi_short __unused;
+#define TARGET_ARCH_FLOCK64_PAD abi_short __unused;
+#elif defined(TARGET_MIPS)
+#define TARGET_ARCH_FLOCK_PAD abi_long pad[4];
+#define TARGET_ARCH_FLOCK64_PAD
+#else
+#define TARGET_ARCH_FLOCK_PAD
+#define TARGET_ARCH_FLOCK64_PAD
+#endif
+
struct target_flock {
short l_type;
short l_whence;
@@ -2652,9 +2663,7 @@ struct target_flock {
abi_long l_sysid;
#endif
int l_pid;
-#if defined(TARGET_MIPS)
- abi_long pad[4];
-#endif
+ TARGET_ARCH_FLOCK_PAD
};
struct target_flock64 {
@@ -2663,6 +2672,7 @@ struct target_flock64 {
abi_llong l_start;
abi_llong l_len;
abi_int l_pid;
+ TARGET_ARCH_FLOCK64_PAD
};
struct target_f_owner_ex {
--
2.14.3
next prev parent reply other threads:[~2018-05-09 23:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-09 23:11 [Qemu-devel] [PATCH v2 0/6] linux-user: fix sparc32plus Laurent Vivier
2018-05-09 23:11 ` [Qemu-devel] [PATCH v2 1/6] linux-user: define correct fcntl() values for sparc Laurent Vivier
2018-05-09 23:11 ` Laurent Vivier [this message]
2018-05-09 23:11 ` [Qemu-devel] [PATCH v2 3/6] linux-user: update sparc/syscall_nr.h to linux header 4.16 Laurent Vivier
2018-05-10 3:58 ` Max Filippov
2018-05-09 23:11 ` [Qemu-devel] [PATCH v2 4/6] linux-user: fix conversion of flock/flock64 l_type field Laurent Vivier
2018-05-10 3:28 ` Max Filippov
2018-05-09 23:11 ` [Qemu-devel] [PATCH v2 5/6] linux-user: add sparc/sparc64 specific errno Laurent Vivier
2018-05-10 3:29 ` Max Filippov
2018-05-09 23:11 ` [Qemu-devel] [PATCH v2 6/6] linux-user: fix UNAME_MACHINE for sparc/sparc64 Laurent Vivier
2018-05-10 0:42 ` Philippe Mathieu-Daudé
2018-05-10 3:37 ` Max Filippov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180509231123.20864-3-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=eblake@redhat.com \
--cc=jcmvbkbc@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).