Commit 8fbd6b526725aeef0b34e0e1f1be766054b0845e

Authored by balrog
1 parent 8d5c28ec

Add MTIOCTOP, MTIOCGET and MTIOCPOS ioctls (Kirill Shutemov).

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5271 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user/ioctls.h
... ... @@ -310,3 +310,7 @@
310 310 IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
311 311 #endif
312 312 IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT)
  313 +
  314 + IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop)))
  315 + IOCTL(MTIOCGET, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtget)))
  316 + IOCTL(MTIOCPOS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtpos)))
... ...
linux-user/syscall.c
... ... @@ -70,6 +70,7 @@
70 70 #include <linux/hdreg.h>
71 71 #include <linux/soundcard.h>
72 72 #include <linux/kd.h>
  73 +#include <linux/mtio.h>
73 74 #include "linux_loop.h"
74 75  
75 76 #include "qemu.h"
... ...
linux-user/syscall_defs.h
... ... @@ -1923,6 +1923,10 @@ struct target_eabi_flock64 {
1923 1923 #define TARGET_VFAT_IOCTL_READDIR_BOTH TARGET_IORU('r', 1)
1924 1924 #define TARGET_VFAT_IOCTL_READDIR_SHORT TARGET_IORU('r', 2)
1925 1925  
  1926 +#define TARGET_MTIOCTOP TARGET_IOW('m', 1, struct mtop)
  1927 +#define TARGET_MTIOCGET TARGET_IOR('m', 2, struct mtget)
  1928 +#define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct mtpos)
  1929 +
1926 1930 struct target_sysinfo {
1927 1931 abi_long uptime; /* Seconds since boot */
1928 1932 abi_ulong loads[3]; /* 1, 5, and 15 minute load averages */
... ...
linux-user/syscall_types.h
... ... @@ -108,3 +108,9 @@ STRUCT(loop_info64,
108 108 MK_ARRAY(TYPE_CHAR, 64), /* lo_crypt_name */
109 109 MK_ARRAY(TYPE_CHAR, 32), /* lo_encrypt_key */
110 110 MK_ARRAY(TYPE_ULONGLONG, 2)) /* lo_init */
  111 +
  112 +/* mag tape ioctls */
  113 +STRUCT(mtop, TYPE_SHORT, TYPE_INT)
  114 +STRUCT(mtget, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG,
  115 + TYPE_INT, TYPE_INT)
  116 +STRUCT(mtpos, TYPE_LONG)
... ...