qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH for 4.2 v2 4/6] linux-user: Add support for FDFMTBEG


From: Aleksandar Markovic
Subject: [Qemu-devel] [PATCH for 4.2 v2 4/6] linux-user: Add support for FDFMTBEG, FDFMTTRK, and FDFMTEND ioctls
Date: Fri, 26 Jul 2019 12:23:12 +0200

From: Aleksandar Markovic <address@hidden>

FDFMTBEG, FDFMTTRK, and FDFMTEND ioctls provide means for controlling
formatting of a floppy drive.

Signed-off-by: Aleksandar Markovic <address@hidden>
---
 linux-user/ioctls.h        | 3 +++
 linux-user/syscall_defs.h  | 9 +++++++++
 linux-user/syscall_types.h | 5 +++++
 3 files changed, 17 insertions(+)

diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 7c14b93..0e15fe1 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -114,6 +114,9 @@
 
      IOCTL(FDMSGON, 0, TYPE_NULL)
      IOCTL(FDMSGOFF, 0, TYPE_NULL)
+     IOCTL(FDFMTBEG, 0, TYPE_NULL)
+     IOCTL(FDFMTTRK, IOC_W, MK_PTR(MK_STRUCT(STRUCT_format_descr)))
+     IOCTL(FDFMTEND, 0, TYPE_NULL)
      IOCTL(FDFLUSH, 0, TYPE_NULL)
      IOCTL(FDRESET, 0, TYPE_NULL)
      IOCTL(FDRAWCMD, 0, TYPE_NULL)
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 4b9f159..a8fc943 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -859,8 +859,17 @@ struct target_pollfd {
 
 /* From <linux/fd.h> */
 
+struct target_format_descr {
+    abi_uint        device;
+    abi_uint        head;
+    abi_uint        track;
+};
+
 #define TARGET_FDMSGON       TARGET_IO(2, 0x45)
 #define TARGET_FDMSGOFF      TARGET_IO(2, 0x46)
+#define TARGET_FDFMTBEG      TARGET_IO(2, 0x47)
+#define TARGET_FDFMTTRK     TARGET_IOW(2, 0x48, struct target_format_descr)
+#define TARGET_FDFMTEND      TARGET_IO(2, 0x49)
 #define TARGET_FDFLUSH       TARGET_IO(2, 0x4b)
 #define TARGET_FDRESET       TARGET_IO(2, 0x54)
 #define TARGET_FDRAWCMD      TARGET_IO(2, 0x58)
diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h
index b98a23b..57cd9e5 100644
--- a/linux-user/syscall_types.h
+++ b/linux-user/syscall_types.h
@@ -267,6 +267,11 @@ STRUCT(blkpg_ioctl_arg,
        TYPE_INT, /* datalen */
        TYPE_PTRVOID) /* data */
 
+STRUCT(format_descr,
+       TYPE_INT,     /* device */
+       TYPE_INT,     /* head */
+       TYPE_INT)     /* track */
+
 #if defined(CONFIG_USBFS)
 /* usb device ioctls */
 STRUCT(usbdevfs_ctrltransfer,
-- 
2.7.4




reply via email to

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