From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: patches@linaro.org, Riku Voipio <riku.voipio@iki.fi>,
Laurent Vivier <laurent@vivier.eu>, pgndev <pgnet.dev@gmail.com>
Subject: [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values
Date: Thu, 12 Oct 2017 16:30:45 +0100 [thread overview]
Message-ID: <1507822245-15748-3-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1507822245-15748-1-git-send-email-peter.maydell@linaro.org>
The TARGET_MTIOCTOP/TARGET_MTIOCGET/TARGET_MTIOCPOS values
were being defined in terms of host struct types, but
these structures are such that their size might differ
on different hosts. Switch to using a target struct
definition instead.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
linux-user/syscall_defs.h | 31 ++++++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index f7cc9f9..16d56fa 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2706,9 +2706,34 @@ struct target_f_owner_ex {
#define TARGET_VFAT_IOCTL_READDIR_BOTH TARGET_IORU('r', 1)
#define TARGET_VFAT_IOCTL_READDIR_SHORT TARGET_IORU('r', 2)
-#define TARGET_MTIOCTOP TARGET_IOW('m', 1, struct mtop)
-#define TARGET_MTIOCGET TARGET_IOR('m', 2, struct mtget)
-#define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct mtpos)
+struct target_mtop {
+ abi_short mt_op;
+ abi_int mt_count;
+};
+
+#if defined(TARGET_SPARC) || defined(TARGET_MIPS)
+typedef abi_long target_kernel_daddr_t;
+#else
+typedef abi_int target_kernel_daddr_t;
+#endif
+
+struct target_mtget {
+ abi_long mt_type;
+ abi_long mt_resid;
+ abi_long mt_dsreg;
+ abi_long mt_gstat;
+ abi_long mt_erreg;
+ target_kernel_daddr_t mt_fileno;
+ target_kernel_daddr_t mt_blkno;
+};
+
+struct target_mtpos {
+ abi_long mt_blkno;
+};
+
+#define TARGET_MTIOCTOP TARGET_IOW('m', 1, struct target_mtop)
+#define TARGET_MTIOCGET TARGET_IOR('m', 2, struct target_mtget)
+#define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct target_mtpos)
struct target_sysinfo {
abi_long uptime; /* Seconds since boot */
--
2.7.4
next prev parent reply other threads:[~2017-10-12 15:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 15:30 [Qemu-devel] [PATCH 0/2] fix incorrect target ioctl numbers Peter Maydell
2017-10-12 15:30 ` [Qemu-devel] [PATCH 1/2] linux-user: Fix target FS_IOC_GETFLAGS and FS_IOC_SETFLAGS numbers Peter Maydell
2017-10-12 16:34 ` Laurent Vivier
2017-10-16 13:05 ` Riku Voipio
2017-10-12 15:30 ` Peter Maydell [this message]
2017-10-12 16:49 ` [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values Laurent Vivier
2017-10-12 16:53 ` Peter Maydell
2017-10-12 17:08 ` Laurent Vivier
2017-10-16 13:06 ` Riku Voipio
2017-10-16 13:09 ` Laurent Vivier
2017-10-16 13:26 ` Peter Maydell
2017-10-16 13:29 ` Laurent Vivier
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=1507822245-15748-3-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=laurent@vivier.eu \
--cc=patches@linaro.org \
--cc=pgnet.dev@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).