]> git.proxmox.com Git - mirror_qemu.git/blobdiff - linux-user/syscall_defs.h
target/i386: fix feature check in hyperv-stub.c
[mirror_qemu.git] / linux-user / syscall_defs.h
index 8436875005715784a860aa1b3806a8e6a93fee39..7f141f699c1aea3bef61071d37be823a0a56f148 100644 (file)
@@ -203,6 +203,11 @@ struct target_ip_mreq_source {
     uint32_t imr_sourceaddr;
 };
 
+struct target_linger {
+    abi_int l_onoff;        /* Linger active                */
+    abi_int l_linger;       /* How long to linger for       */
+};
+
 struct target_timeval {
     abi_long tv_sec;
     abi_long tv_usec;
@@ -418,72 +423,12 @@ struct target_sigaction;
 int do_sigaction(int sig, const struct target_sigaction *act,
                  struct target_sigaction *oact);
 
-#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) \
-    || defined(TARGET_PPC) || defined(TARGET_MIPS) || defined(TARGET_SH4) \
-    || defined(TARGET_M68K) || defined(TARGET_ALPHA) || defined(TARGET_CRIS) \
-    || defined(TARGET_MICROBLAZE) \
-    || defined(TARGET_S390X) || defined(TARGET_OPENRISC) \
-    || defined(TARGET_TILEGX) || defined(TARGET_HPPA) || defined(TARGET_NIOS2) \
-    || defined(TARGET_RISCV) || defined(TARGET_XTENSA)
-
-#if defined(TARGET_HPPA)
-#define TARGET_SA_ONSTACK       0x00000001
-#define TARGET_SA_RESETHAND     0x00000004
-#define TARGET_SA_NOCLDSTOP     0x00000008
-#define TARGET_SA_SIGINFO       0x00000010
-#define TARGET_SA_NODEFER       0x00000020
-#define TARGET_SA_RESTART       0x00000040
-#define TARGET_SA_NOCLDWAIT     0x00000080
-#endif
-
 #include "target_signal.h"
 
 #ifdef TARGET_SA_RESTORER
 #define TARGET_ARCH_HAS_SA_RESTORER 1
 #endif
 
-#if defined(TARGET_HPPA)
-
-#define TARGET_SIGHUP           1
-#define TARGET_SIGINT           2
-#define TARGET_SIGQUIT          3
-#define TARGET_SIGILL           4
-#define TARGET_SIGTRAP          5
-#define TARGET_SIGABRT          6
-#define TARGET_SIGIOT           6
-#define TARGET_SIGSTKFLT        7
-#define TARGET_SIGFPE           8
-#define TARGET_SIGKILL          9
-#define TARGET_SIGBUS          10
-#define TARGET_SIGSEGV         11
-#define TARGET_SIGXCPU         12
-#define TARGET_SIGPIPE         13
-#define TARGET_SIGALRM         14
-#define TARGET_SIGTERM         15
-#define TARGET_SIGUSR1         16
-#define TARGET_SIGUSR2         17
-#define TARGET_SIGCHLD         18
-#define TARGET_SIGPWR          19
-#define TARGET_SIGVTALRM       20
-#define TARGET_SIGPROF         21
-#define TARGET_SIGIO           22
-#define TARGET_SIGPOLL         TARGET_SIGIO
-#define TARGET_SIGWINCH        23
-#define TARGET_SIGSTOP         24
-#define TARGET_SIGTSTP         25
-#define TARGET_SIGCONT         26
-#define TARGET_SIGTTIN         27
-#define TARGET_SIGTTOU         28
-#define TARGET_SIGURG          29
-#define TARGET_SIGXFSZ         30
-#define TARGET_SIGSYS          31
-
-#define TARGET_SIG_BLOCK       0
-#define TARGET_SIG_UNBLOCK     1
-#define TARGET_SIG_SETMASK     2
-
-#endif
-
 #if defined(TARGET_ALPHA)
 struct target_old_sigaction {
     abi_ulong _sa_handler;
@@ -690,7 +635,8 @@ typedef struct target_siginfo {
 #define TARGET_FPE_FLTRES      (6)  /* floating point inexact result */
 #define TARGET_FPE_FLTINV      (7)  /* floating point invalid operation */
 #define TARGET_FPE_FLTSUB      (8)  /* subscript out of range */
-#define TARGET_NSIGFPE         8
+#define TARGET_FPE_FLTUNK      (14) /* undiagnosed fp exception */
+#define TARGET_NSIGFPE         15
 
 /*
  * SIGSEGV si_codes
@@ -718,8 +664,6 @@ typedef struct target_siginfo {
 #define TARGET_TRAP_BRANCH      (3)     /* process taken branch trap */
 #define TARGET_TRAP_HWBKPT      (4)     /* hardware breakpoint/watchpoint */
 
-#endif /* defined(TARGET_I386) || defined(TARGET_ARM) */
-
 struct target_rlimit {
         abi_ulong   rlim_cur;
         abi_ulong   rlim_max;
@@ -793,13 +737,17 @@ struct target_pollfd {
 #define TARGET_KDSETLED        0x4B32  /* set led state [lights, not flags] */
 #define TARGET_KDSIGACCEPT     0x4B4E
 
-#if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_SH4)
+#if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_SH4) ||    \
+       defined(TARGET_XTENSA)
 #define TARGET_SIOCATMARK      TARGET_IOR('s', 7, int)
+#define TARGET_SIOCSPGRP       TARGET_IOW('s', 8, pid_t)
 #define TARGET_SIOCGPGRP       TARGET_IOR('s', 9, pid_t)
 #else
 #define TARGET_SIOCATMARK      0x8905
+#define TARGET_SIOCSPGRP       0x8902
 #define TARGET_SIOCGPGRP       0x8904
 #endif
+
 #define TARGET_SIOCGSTAMP      0x8906          /* Get stamp (timeval) */
 #define TARGET_SIOCGSTAMPNS    0x8907          /* Get stamp (timespec) */
 
@@ -834,6 +782,8 @@ struct target_pollfd {
 #define TARGET_SIOCADDMULTI    0x8931          /* Multicast address lists      */
 #define TARGET_SIOCDELMULTI    0x8932
 #define TARGET_SIOCGIFINDEX    0x8933
+#define TARGET_SIOCSIFPFLAGS   0x8934          /* set extended flags          */
+#define TARGET_SIOCGIFPFLAGS   0x8935          /* get extended flags          */
 
 /* Bridging control calls */
 #define TARGET_SIOCGIFBR       0x8940          /* Bridging support             */
@@ -920,6 +870,34 @@ struct target_pollfd {
 
 #define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap)
 
+/* usb ioctls */
+#define TARGET_USBDEVFS_CONTROL TARGET_IOWRU('U', 0)
+#define TARGET_USBDEVFS_BULK TARGET_IOWRU('U', 2)
+#define TARGET_USBDEVFS_RESETEP TARGET_IORU('U', 3)
+#define TARGET_USBDEVFS_SETINTERFACE TARGET_IORU('U', 4)
+#define TARGET_USBDEVFS_SETCONFIGURATION TARGET_IORU('U',  5)
+#define TARGET_USBDEVFS_GETDRIVER TARGET_IOWU('U', 8)
+#define TARGET_USBDEVFS_SUBMITURB TARGET_IORU('U', 10)
+#define TARGET_USBDEVFS_DISCARDURB TARGET_IO('U', 11)
+#define TARGET_USBDEVFS_REAPURB TARGET_IOWU('U', 12)
+#define TARGET_USBDEVFS_REAPURBNDELAY TARGET_IOWU('U', 13)
+#define TARGET_USBDEVFS_DISCSIGNAL TARGET_IORU('U', 14)
+#define TARGET_USBDEVFS_CLAIMINTERFACE TARGET_IORU('U', 15)
+#define TARGET_USBDEVFS_RELEASEINTERFACE TARGET_IORU('U', 16)
+#define TARGET_USBDEVFS_CONNECTINFO TARGET_IOWU('U', 17)
+#define TARGET_USBDEVFS_IOCTL TARGET_IOWRU('U', 18)
+#define TARGET_USBDEVFS_HUB_PORTINFO TARGET_IORU('U', 19)
+#define TARGET_USBDEVFS_RESET TARGET_IO('U', 20)
+#define TARGET_USBDEVFS_CLEAR_HALT TARGET_IORU('U', 21)
+#define TARGET_USBDEVFS_DISCONNECT TARGET_IO('U', 22)
+#define TARGET_USBDEVFS_CONNECT TARGET_IO('U', 23)
+#define TARGET_USBDEVFS_CLAIM_PORT TARGET_IORU('U', 24)
+#define TARGET_USBDEVFS_RELEASE_PORT TARGET_IORU('U', 25)
+#define TARGET_USBDEVFS_GET_CAPABILITIES TARGET_IORU('U', 26)
+#define TARGET_USBDEVFS_DISCONNECT_CLAIM TARGET_IORU('U', 27)
+#define TARGET_USBDEVFS_DROP_PRIVILEGES TARGET_IOWU('U', 30)
+#define TARGET_USBDEVFS_GET_SPEED TARGET_IO('U', 31)
+
 /* cdrom commands */
 #define TARGET_CDROMPAUSE              0x5301 /* Pause Audio Operation */
 #define TARGET_CDROMRESUME             0x5302 /* Resume paused Audio Operation */
@@ -1207,6 +1185,7 @@ struct target_winsize {
 #if (defined(TARGET_I386) && defined(TARGET_ABI32)) \
     || (defined(TARGET_ARM) && defined(TARGET_ABI32)) \
     || defined(TARGET_CRIS)
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
        unsigned short st_dev;
        unsigned short __pad1;
@@ -1221,11 +1200,11 @@ struct target_stat {
        abi_ulong  st_blksize;
        abi_ulong  st_blocks;
        abi_ulong  target_st_atime;
-       abi_ulong  __unused1;
+       abi_ulong  target_st_atime_nsec;
        abi_ulong  target_st_mtime;
-       abi_ulong  __unused2;
+       abi_ulong  target_st_mtime_nsec;
        abi_ulong  target_st_ctime;
-       abi_ulong  __unused3;
+       abi_ulong  target_st_ctime_nsec;
        abi_ulong  __unused4;
        abi_ulong  __unused5;
 };
@@ -1257,13 +1236,13 @@ struct target_stat64 {
        abi_ulong       __pad4;         /* future possible st_blocks high bits */
 
        abi_ulong       target_st_atime;
-       abi_ulong       __pad5;
+       abi_ulong       target_st_atime_nsec;
 
        abi_ulong       target_st_mtime;
-       abi_ulong       __pad6;
+       abi_ulong       target_st_mtime_nsec;
 
        abi_ulong       target_st_ctime;
-       abi_ulong       __pad7;         /* will be high 32 bits of ctime someday */
+       abi_ulong       target_st_ctime_nsec;
 
        unsigned long long      st_ino;
 } QEMU_PACKED;
@@ -1342,19 +1321,20 @@ struct target_stat64 {
        unsigned int    st_blocks;
 
        abi_ulong       target_st_atime;
-       abi_ulong       __unused1;
+       abi_ulong       target_st_atime_nsec;
 
        abi_ulong       target_st_mtime;
-       abi_ulong       __unused2;
+       abi_ulong       target_st_mtime_nsec;
 
        abi_ulong       target_st_ctime;
-       abi_ulong       __unused3;
+       abi_ulong       target_st_ctime_nsec;
 
        abi_ulong       __unused4[3];
 };
 
 #elif defined(TARGET_SPARC)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
        unsigned short  st_dev;
        abi_ulong       st_ino;
@@ -1365,14 +1345,14 @@ struct target_stat {
        unsigned short  st_rdev;
        abi_long        st_size;
        abi_long        target_st_atime;
-       abi_ulong       __unused1;
+       abi_ulong       target_st_atime_nsec;
        abi_long        target_st_mtime;
-       abi_ulong       __unused2;
+       abi_ulong       target_st_mtime_nsec;
        abi_long        target_st_ctime;
-       abi_ulong       __unused3;
+       abi_ulong       target_st_ctime_nsec;
        abi_long        st_blksize;
        abi_long        st_blocks;
-       abi_ulong       __unused4[2];
+       abi_ulong       __unused1[2];
 };
 
 #define TARGET_HAS_STRUCT_STAT64
@@ -1400,20 +1380,21 @@ struct target_stat64 {
        unsigned int    st_blocks;
 
        unsigned int    target_st_atime;
-       unsigned int    __unused1;
+       unsigned int    target_st_atime_nsec;
 
        unsigned int    target_st_mtime;
-       unsigned int    __unused2;
+       unsigned int    target_st_mtime_nsec;
 
        unsigned int    target_st_ctime;
-       unsigned int    __unused3;
+       unsigned int    target_st_ctime_nsec;
 
-       unsigned int    __unused4;
-       unsigned int    __unused5;
+       unsigned int    __unused1;
+       unsigned int    __unused2;
 };
 
 #elif defined(TARGET_PPC)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
        abi_ulong st_dev;
        abi_ulong st_ino;
@@ -1471,6 +1452,7 @@ struct QEMU_PACKED target_stat64 {
 
 #elif defined(TARGET_MICROBLAZE)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
        abi_ulong st_dev;
        abi_ulong st_ino;
@@ -1586,6 +1568,7 @@ struct target_stat64 {
 
 #elif defined(TARGET_ABI_MIPSN64)
 
+#define TARGET_STAT_HAVE_NSEC
 /* The memory layout is the same as of struct stat64 of the 32-bit kernel.  */
 struct target_stat {
        unsigned int            st_dev;
@@ -1625,6 +1608,7 @@ struct target_stat {
 
 #elif defined(TARGET_ABI_MIPSN32)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
         abi_ulong    st_dev;
         abi_ulong    st_pad0[3]; /* Reserved for st_dev expansion */
@@ -1649,6 +1633,7 @@ struct target_stat {
 
 #elif defined(TARGET_ABI_MIPSO32)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
        unsigned        st_dev;
        abi_long        st_pad1[3];             /* Reserved for network id */
@@ -1765,6 +1750,7 @@ struct target_stat64 {
 
 #elif defined(TARGET_SH4)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
        abi_ulong  st_dev;
        abi_ulong  st_ino;
@@ -1824,6 +1810,7 @@ struct QEMU_PACKED target_stat64 {
 };
 
 #elif defined(TARGET_I386) && !defined(TARGET_ABI32)
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
        abi_ulong       st_dev;
        abi_ulong       st_ino;
@@ -1836,7 +1823,7 @@ struct target_stat {
        abi_ulong       st_rdev;
        abi_long        st_size;
        abi_long        st_blksize;
-       abi_long        st_blocks;      /* Number 512-byte blocks allocated. */
+       abi_long        st_blocks;      /* Number 512-byte blocks allocated. */
 
        abi_ulong       target_st_atime;
        abi_ulong       target_st_atime_nsec; 
@@ -1845,7 +1832,7 @@ struct target_stat {
        abi_ulong       target_st_ctime;
        abi_ulong       target_st_ctime_nsec;
 
-       abi_long        __unused[3];
+       abi_long        __unused[3];
 };
 #elif defined(TARGET_S390X)
 struct target_stat {
@@ -1869,6 +1856,7 @@ struct target_stat {
     abi_ulong  __unused[3];
 };
 #elif defined(TARGET_AARCH64)
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
     abi_ulong  st_dev;
     abi_ulong  st_ino;
@@ -1891,6 +1879,7 @@ struct target_stat {
     unsigned int __unused[2];
 };
 #elif defined(TARGET_XTENSA)
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
     abi_ulong       st_dev;
     abi_ulong       st_ino;
@@ -1940,6 +1929,7 @@ struct target_stat64  {
 
 /* These are the asm-generic versions of the stat and stat64 structures */
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
     abi_ulong st_dev;
     abi_ulong st_ino;
@@ -1991,6 +1981,7 @@ struct target_stat64 {
 
 #elif defined(TARGET_HPPA)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
     abi_uint   st_dev;
     abi_uint   st_ino;