|| defined(TARGET_M68K) || defined(TARGET_CRIS) \
|| defined(TARGET_S390X) \
|| defined(TARGET_OPENRISC) || defined(TARGET_TILEGX) \
- || defined(TARGET_NIOS2) || defined(TARGET_RISCV)
+ || defined(TARGET_NIOS2) || defined(TARGET_RISCV) \
+ || defined(TARGET_XTENSA)
#define TARGET_IOC_SIZEBITS 14
#define TARGET_IOC_DIRBITS 2
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;
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)
-
-#if defined(TARGET_SPARC)
-#define TARGET_SA_NOCLDSTOP 8u
-#define TARGET_SA_NOCLDWAIT 0x100u
-#define TARGET_SA_SIGINFO 0x200u
-#define TARGET_SA_ONSTACK 1u
-#define TARGET_SA_RESTART 2u
-#define TARGET_SA_NODEFER 0x20u
-#define TARGET_SA_RESETHAND 4u
-#define TARGET_ARCH_HAS_SA_RESTORER 1
-#elif defined(TARGET_MIPS)
-#define TARGET_SA_NOCLDSTOP 0x00000001
-#define TARGET_SA_NOCLDWAIT 0x00010000
-#define TARGET_SA_SIGINFO 0x00000008
-#define TARGET_SA_ONSTACK 0x08000000
-#define TARGET_SA_NODEFER 0x40000000
-#define TARGET_SA_RESTART 0x10000000
-#define TARGET_SA_RESETHAND 0x80000000
-#if !defined(TARGET_ABI_MIPSN32) && !defined(TARGET_ABI_MIPSN64)
-#define TARGET_SA_RESTORER 0x04000000 /* Only for O32 */
-#endif
-#elif defined(TARGET_OPENRISC)
-#define TARGET_SA_NOCLDSTOP 0x00000001
-#define TARGET_SA_NOCLDWAIT 0x00000002
-#define TARGET_SA_SIGINFO 0x00000004
-#define TARGET_SA_ONSTACK 0x08000000
-#define TARGET_SA_RESTART 0x10000000
-#define TARGET_SA_NODEFER 0x40000000
-#define TARGET_SA_RESETHAND 0x80000000
-#elif defined(TARGET_ALPHA)
-#define TARGET_SA_ONSTACK 0x00000001
-#define TARGET_SA_RESTART 0x00000002
-#define TARGET_SA_NOCLDSTOP 0x00000004
-#define TARGET_SA_NODEFER 0x00000008
-#define TARGET_SA_RESETHAND 0x00000010
-#define TARGET_SA_NOCLDWAIT 0x00000020 /* not supported yet */
-#define TARGET_SA_SIGINFO 0x00000040
-#elif 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
-#else
-#define TARGET_SA_NOCLDSTOP 0x00000001
-#define TARGET_SA_NOCLDWAIT 0x00000002 /* not supported yet */
-#define TARGET_SA_SIGINFO 0x00000004
-#define TARGET_SA_ONSTACK 0x08000000
-#define TARGET_SA_RESTART 0x10000000
-#define TARGET_SA_NODEFER 0x40000000
-#define TARGET_SA_RESETHAND 0x80000000
-#define TARGET_SA_RESTORER 0x04000000
-#endif
+#include "target_signal.h"
#ifdef TARGET_SA_RESTORER
#define TARGET_ARCH_HAS_SA_RESTORER 1
#endif
-#if defined(TARGET_ALPHA)
-
-#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_SIGSTKFLT 7 /* actually SIGEMT */
-#define TARGET_SIGFPE 8
-#define TARGET_SIGKILL 9
-#define TARGET_SIGBUS 10
-#define TARGET_SIGSEGV 11
-#define TARGET_SIGSYS 12
-#define TARGET_SIGPIPE 13
-#define TARGET_SIGALRM 14
-#define TARGET_SIGTERM 15
-#define TARGET_SIGURG 16
-#define TARGET_SIGSTOP 17
-#define TARGET_SIGTSTP 18
-#define TARGET_SIGCONT 19
-#define TARGET_SIGCHLD 20
-#define TARGET_SIGTTIN 21
-#define TARGET_SIGTTOU 22
-#define TARGET_SIGIO 23
-#define TARGET_SIGXCPU 24
-#define TARGET_SIGXFSZ 25
-#define TARGET_SIGVTALRM 26
-#define TARGET_SIGPROF 27
-#define TARGET_SIGWINCH 28
-#define TARGET_SIGPWR 29 /* actually SIGINFO */
-#define TARGET_SIGUSR1 30
-#define TARGET_SIGUSR2 31
-#define TARGET_SIGRTMIN 32
-
-#define TARGET_SIG_BLOCK 1
-#define TARGET_SIG_UNBLOCK 2
-#define TARGET_SIG_SETMASK 3
-
-#elif defined(TARGET_SPARC)
-
-#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 /* actually EMT */
-#define TARGET_SIGFPE 8
-#define TARGET_SIGKILL 9
-#define TARGET_SIGBUS 10
-#define TARGET_SIGSEGV 11
-#define TARGET_SIGSYS 12
-#define TARGET_SIGPIPE 13
-#define TARGET_SIGALRM 14
-#define TARGET_SIGTERM 15
-#define TARGET_SIGURG 16
-#define TARGET_SIGSTOP 17
-#define TARGET_SIGTSTP 18
-#define TARGET_SIGCONT 19
-#define TARGET_SIGCHLD 20
-#define TARGET_SIGTTIN 21
-#define TARGET_SIGTTOU 22
-#define TARGET_SIGIO 23
-#define TARGET_SIGXCPU 24
-#define TARGET_SIGXFSZ 25
-#define TARGET_SIGVTALRM 26
-#define TARGET_SIGPROF 27
-#define TARGET_SIGWINCH 28
-#define TARGET_SIGPWR 29
-#define TARGET_SIGUSR1 30
-#define TARGET_SIGUSR2 31
-#define TARGET_SIGRTMIN 32
-
-#define TARGET_SIG_BLOCK 0x01 /* for blocking signals */
-#define TARGET_SIG_UNBLOCK 0x02 /* for unblocking signals */
-#define TARGET_SIG_SETMASK 0x04 /* for setting the signal mask */
-
-#elif defined(TARGET_MIPS)
-
-#define TARGET_SIGHUP 1 /* Hangup (POSIX). */
-#define TARGET_SIGINT 2 /* Interrupt (ANSI). */
-#define TARGET_SIGQUIT 3 /* Quit (POSIX). */
-#define TARGET_SIGILL 4 /* Illegal instruction (ANSI). */
-#define TARGET_SIGTRAP 5 /* Trace trap (POSIX). */
-#define TARGET_SIGIOT 6 /* IOT trap (4.2 BSD). */
-#define TARGET_SIGABRT TARGET_SIGIOT /* Abort (ANSI). */
-#define TARGET_SIGEMT 7
-#define TARGET_SIGSTKFLT 7 /* XXX: incorrect */
-#define TARGET_SIGFPE 8 /* Floating-point exception (ANSI). */
-#define TARGET_SIGKILL 9 /* Kill, unblockable (POSIX). */
-#define TARGET_SIGBUS 10 /* BUS error (4.2 BSD). */
-#define TARGET_SIGSEGV 11 /* Segmentation violation (ANSI). */
-#define TARGET_SIGSYS 12
-#define TARGET_SIGPIPE 13 /* Broken pipe (POSIX). */
-#define TARGET_SIGALRM 14 /* Alarm clock (POSIX). */
-#define TARGET_SIGTERM 15 /* Termination (ANSI). */
-#define TARGET_SIGUSR1 16 /* User-defined signal 1 (POSIX). */
-#define TARGET_SIGUSR2 17 /* User-defined signal 2 (POSIX). */
-#define TARGET_SIGCHLD 18 /* Child status has changed (POSIX). */
-#define TARGET_SIGCLD TARGET_SIGCHLD /* Same as TARGET_SIGCHLD (System V). */
-#define TARGET_SIGPWR 19 /* Power failure restart (System V). */
-#define TARGET_SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
-#define TARGET_SIGURG 21 /* Urgent condition on socket (4.2 BSD). */
-#define TARGET_SIGIO 22 /* I/O now possible (4.2 BSD). */
-#define TARGET_SIGPOLL TARGET_SIGIO /* Pollable event occurred (System V). */
-#define TARGET_SIGSTOP 23 /* Stop, unblockable (POSIX). */
-#define TARGET_SIGTSTP 24 /* Keyboard stop (POSIX). */
-#define TARGET_SIGCONT 25 /* Continue (POSIX). */
-#define TARGET_SIGTTIN 26 /* Background read from tty (POSIX). */
-#define TARGET_SIGTTOU 27 /* Background write to tty (POSIX). */
-#define TARGET_SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
-#define TARGET_SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
-#define TARGET_SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
-#define TARGET_SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
-#define TARGET_SIGRTMIN 32
-
-#define TARGET_SIG_BLOCK 1 /* for blocking signals */
-#define TARGET_SIG_UNBLOCK 2 /* for unblocking signals */
-#define TARGET_SIG_SETMASK 3 /* for setting the signal mask */
-
-#elif 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
-
-#else
-
-/* OpenRISC Using the general signals */
-#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_SIGBUS 7
-#define TARGET_SIGFPE 8
-#define TARGET_SIGKILL 9
-#define TARGET_SIGUSR1 10
-#define TARGET_SIGSEGV 11
-#define TARGET_SIGUSR2 12
-#define TARGET_SIGPIPE 13
-#define TARGET_SIGALRM 14
-#define TARGET_SIGTERM 15
-#define TARGET_SIGSTKFLT 16
-#define TARGET_SIGCHLD 17
-#define TARGET_SIGCONT 18
-#define TARGET_SIGSTOP 19
-#define TARGET_SIGTSTP 20
-#define TARGET_SIGTTIN 21
-#define TARGET_SIGTTOU 22
-#define TARGET_SIGURG 23
-#define TARGET_SIGXCPU 24
-#define TARGET_SIGXFSZ 25
-#define TARGET_SIGVTALRM 26
-#define TARGET_SIGPROF 27
-#define TARGET_SIGWINCH 28
-#define TARGET_SIGIO 29
-#define TARGET_SIGPWR 30
-#define TARGET_SIGSYS 31
-#define TARGET_SIGRTMIN 32
-
-#define TARGET_SIG_BLOCK 0 /* for blocking signals */
-#define TARGET_SIG_UNBLOCK 1 /* for unblocking signals */
-#define TARGET_SIG_SETMASK 2 /* for setting the signal mask */
-
-#endif
-
#if defined(TARGET_ALPHA)
struct target_old_sigaction {
abi_ulong _sa_handler;
abi_ulong sa_restorer;
#endif
target_sigset_t sa_mask;
+#ifdef TARGET_ARCH_HAS_KA_RESTORER
+ abi_ulong ka_restorer;
+#endif
};
#endif
#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
#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;
#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) */
#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 */
#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 */
#define TARGET_MAP_NONBLOCK 0x20000 /* do not block on IO */
#define TARGET_MAP_STACK 0x40000 /* ignored */
#define TARGET_MAP_HUGETLB 0x80000 /* create a huge page mapping */
+#elif defined(TARGET_XTENSA)
+#define TARGET_MAP_FIXED 0x10 /* Interpret addr exactly */
+#define TARGET_MAP_ANONYMOUS 0x0800 /* don't use a file */
+#define TARGET_MAP_GROWSDOWN 0x1000 /* stack-like segment */
+#define TARGET_MAP_DENYWRITE 0x2000 /* ETXTBSY */
+#define TARGET_MAP_EXECUTABLE 0x4000 /* mark it as an executable */
+#define TARGET_MAP_LOCKED 0x8000 /* pages are locked */
+#define TARGET_MAP_NORESERVE 0x0400 /* don't check for reservations */
+#define TARGET_MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
+#define TARGET_MAP_NONBLOCK 0x20000 /* do not block on IO */
+#define TARGET_MAP_STACK 0x40000
+#define TARGET_MAP_HUGETLB 0x80000 /* create a huge page mapping */
#else
#define TARGET_MAP_FIXED 0x10 /* Interpret addr exactly */
#define TARGET_MAP_ANONYMOUS 0x20 /* don't use a file */
#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;
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;
};
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;
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;
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
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;
#elif defined(TARGET_MICROBLAZE)
+#define TARGET_STAT_HAVE_NSEC
struct target_stat {
abi_ulong st_dev;
abi_ulong st_ino;
#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;
#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 */
#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 */
#elif defined(TARGET_SH4)
+#define TARGET_STAT_HAVE_NSEC
struct target_stat {
abi_ulong st_dev;
abi_ulong st_ino;
};
#elif defined(TARGET_I386) && !defined(TARGET_ABI32)
+#define TARGET_STAT_HAVE_NSEC
struct target_stat {
abi_ulong st_dev;
abi_ulong st_ino;
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;
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 {
abi_ulong __unused[3];
};
#elif defined(TARGET_AARCH64)
+#define TARGET_STAT_HAVE_NSEC
struct target_stat {
abi_ulong st_dev;
abi_ulong st_ino;
abi_ulong target_st_ctime_nsec;
unsigned int __unused[2];
};
+#elif defined(TARGET_XTENSA)
+#define TARGET_STAT_HAVE_NSEC
+struct target_stat {
+ abi_ulong st_dev;
+ abi_ulong st_ino;
+ unsigned int st_mode;
+ unsigned int st_nlink;
+ unsigned int st_uid;
+ unsigned int st_gid;
+ abi_ulong st_rdev;
+ abi_long st_size;
+ abi_ulong st_blksize;
+ abi_ulong st_blocks;
+ abi_ulong target_st_atime;
+ abi_ulong target_st_atime_nsec;
+ abi_ulong target_st_mtime;
+ abi_ulong target_st_mtime_nsec;
+ abi_ulong target_st_ctime;
+ abi_ulong target_st_ctime_nsec;
+ abi_ulong __unused4;
+ abi_ulong __unused5;
+};
+
+#define TARGET_HAS_STRUCT_STAT64
+struct target_stat64 {
+ uint64_t st_dev; /* Device */
+ uint64_t st_ino; /* File serial number */
+ unsigned int st_mode; /* File mode. */
+ unsigned int st_nlink; /* Link count. */
+ unsigned int st_uid; /* User ID of the file's owner. */
+ unsigned int st_gid; /* Group ID of the file's group. */
+ uint64_t st_rdev; /* Device number, if device. */
+ int64_t st_size; /* Size of file, in bytes. */
+ abi_ulong st_blksize; /* Optimal block size for I/O. */
+ abi_ulong __unused2;
+ uint64_t st_blocks; /* Number 512-byte blocks allocated. */
+ abi_ulong target_st_atime; /* Time of last access. */
+ abi_ulong target_st_atime_nsec;
+ abi_ulong target_st_mtime; /* Time of last modification. */
+ abi_ulong target_st_mtime_nsec;
+ abi_ulong target_st_ctime; /* Time of last status change. */
+ abi_ulong target_st_ctime_nsec;
+ abi_ulong __unused4;
+ abi_ulong __unused5;
+};
+
#elif defined(TARGET_OPENRISC) || defined(TARGET_TILEGX) || \
defined(TARGET_NIOS2) || defined(TARGET_RISCV)
/* 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;
#elif defined(TARGET_HPPA)
+#define TARGET_STAT_HAVE_NSEC
struct target_stat {
abi_uint st_dev;
abi_uint st_ino;
};
#endif
-
-#define TARGET_F_DUPFD 0 /* dup */
-#define TARGET_F_GETFD 1 /* get close_on_exec */
-#define TARGET_F_SETFD 2 /* set/clear close_on_exec */
-#define TARGET_F_GETFL 3 /* get file->f_flags */
-#define TARGET_F_SETFL 4 /* set file->f_flags */
-
-#if defined(TARGET_ALPHA)
-#define TARGET_F_GETLK 7
-#define TARGET_F_SETLK 8
-#define TARGET_F_SETLKW 9
-#define TARGET_F_SETOWN 5 /* for sockets. */
-#define TARGET_F_GETOWN 6 /* for sockets. */
-
-#define TARGET_F_RDLCK 1
-#define TARGET_F_WRLCK 2
-#define TARGET_F_UNLCK 8
-#define TARGET_F_EXLCK 16
-#define TARGET_F_SHLCK 32
-#elif defined(TARGET_MIPS)
-#define TARGET_F_GETLK 14
-#define TARGET_F_SETLK 6
-#define TARGET_F_SETLKW 7
-#define TARGET_F_SETOWN 24 /* for sockets. */
-#define TARGET_F_GETOWN 23 /* for sockets. */
-#elif defined(TARGET_HPPA)
-#define TARGET_F_RDLCK 1
-#define TARGET_F_WRLCK 2
-#define TARGET_F_UNLCK 3
-#define TARGET_F_GETLK 5
-#define TARGET_F_SETLK 6
-#define TARGET_F_SETLKW 7
-#define TARGET_F_GETOWN 11 /* for sockets. */
-#define TARGET_F_SETOWN 12 /* for sockets. */
-#else
-#define TARGET_F_GETLK 5
-#define TARGET_F_SETLK 6
-#define TARGET_F_SETLKW 7
-#define TARGET_F_SETOWN 8 /* for sockets. */
-#define TARGET_F_GETOWN 9 /* for sockets. */
-#endif
-#define TARGET_F_SETOWN_EX 15
-#define TARGET_F_GETOWN_EX 16
-
-#ifndef TARGET_F_RDLCK
-#define TARGET_F_RDLCK 0
-#define TARGET_F_WRLCK 1
-#define TARGET_F_UNLCK 2
-#endif
-
-#ifndef TARGET_F_EXLCK
-#define TARGET_F_EXLCK 4
-#define TARGET_F_SHLCK 8
-#endif
-
-
-#if defined(TARGET_HPPA)
-#define TARGET_F_SETSIG 13 /* for sockets. */
-#define TARGET_F_GETSIG 14 /* for sockets. */
-#else
-#define TARGET_F_SETSIG 10 /* for sockets. */
-#define TARGET_F_GETSIG 11 /* for sockets. */
-#endif
-
-#if defined(TARGET_MIPS)
-#define TARGET_F_GETLK64 33 /* using 'struct flock64' */
-#define TARGET_F_SETLK64 34
-#define TARGET_F_SETLKW64 35
-#elif defined(TARGET_HPPA)
-#define TARGET_F_GETLK64 8 /* using 'struct flock64' */
-#define TARGET_F_SETLK64 9
-#define TARGET_F_SETLKW64 10
-#else
-#define TARGET_F_GETLK64 12 /* using 'struct flock64' */
-#define TARGET_F_SETLK64 13
-#define TARGET_F_SETLKW64 14
-#endif
-
#define TARGET_F_LINUX_SPECIFIC_BASE 1024
#define TARGET_F_SETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 0)
#define TARGET_F_GETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 1)
#define TARGET_F_GETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 8)
#define TARGET_F_NOTIFY (TARGET_F_LINUX_SPECIFIC_BASE+2)
-#if defined(TARGET_ALPHA)
-#define TARGET_O_NONBLOCK 04
-#define TARGET_O_APPEND 010
-#define TARGET_O_CREAT 01000 /* not fcntl */
-#define TARGET_O_TRUNC 02000 /* not fcntl */
-#define TARGET_O_EXCL 04000 /* not fcntl */
-#define TARGET_O_NOCTTY 010000 /* not fcntl */
-#define TARGET_O_DSYNC 040000
-#define TARGET_O_LARGEFILE 0 /* not necessary, always 64-bit */
-#define TARGET_O_DIRECTORY 0100000 /* must be a directory */
-#define TARGET_O_NOFOLLOW 0200000 /* don't follow links */
-#define TARGET_O_DIRECT 02000000 /* direct disk access hint */
-#define TARGET_O_NOATIME 04000000
-#define TARGET_O_CLOEXEC 010000000
-#define TARGET___O_SYNC 020000000
-#define TARGET_O_PATH 040000000
-#elif defined(TARGET_HPPA)
-#define TARGET_O_NONBLOCK 000200004 /* HPUX has separate NDELAY & NONBLOCK */
-#define TARGET_O_APPEND 000000010
-#define TARGET_O_CREAT 000000400 /* not fcntl */
-#define TARGET_O_EXCL 000002000 /* not fcntl */
-#define TARGET_O_NOCTTY 000400000 /* not fcntl */
-#define TARGET_O_DSYNC 001000000
-#define TARGET_O_LARGEFILE 000004000
-#define TARGET_O_DIRECTORY 000010000 /* must be a directory */
-#define TARGET_O_NOFOLLOW 000000200 /* don't follow links */
-#define TARGET_O_NOATIME 004000000
-#define TARGET_O_CLOEXEC 010000000
-#define TARGET___O_SYNC 000100000
-#define TARGET_O_PATH 020000000
-#elif defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_AARCH64)
-#define TARGET_O_DIRECTORY 040000 /* must be a directory */
-#define TARGET_O_NOFOLLOW 0100000 /* don't follow links */
-#define TARGET_O_DIRECT 0200000 /* direct disk access hint */
-#define TARGET_O_LARGEFILE 0400000
-#elif defined(TARGET_MIPS)
-#define TARGET_O_APPEND 0x0008
-#define TARGET_O_DSYNC 0x0010
-#define TARGET_O_NONBLOCK 0x0080
-#define TARGET_O_CREAT 0x0100 /* not fcntl */
-#define TARGET_O_TRUNC 0x0200 /* not fcntl */
-#define TARGET_O_EXCL 0x0400 /* not fcntl */
-#define TARGET_O_NOCTTY 0x0800 /* not fcntl */
-#define TARGET_FASYNC 0x1000 /* fcntl, for BSD compatibility */
-#define TARGET_O_LARGEFILE 0x2000 /* allow large file opens */
-#define TARGET___O_SYNC 0x4000
-#define TARGET_O_DIRECT 0x8000 /* direct disk access hint */
-#elif defined (TARGET_PPC)
-#define TARGET_O_DIRECTORY 040000 /* must be a directory */
-#define TARGET_O_NOFOLLOW 0100000 /* don't follow links */
-#define TARGET_O_LARGEFILE 0200000
-#define TARGET_O_DIRECT 0400000 /* direct disk access hint */
-#elif defined (TARGET_SPARC)
-#define TARGET_O_APPEND 0x0008
-#define TARGET_FASYNC 0x0040 /* fcntl, for BSD compatibility */
-#define TARGET_O_CREAT 0x0200 /* not fcntl */
-#define TARGET_O_TRUNC 0x0400 /* not fcntl */
-#define TARGET_O_EXCL 0x0800 /* not fcntl */
-#define TARGET_O_DSYNC 0x2000
-#define TARGET_O_NONBLOCK 0x4000
-# ifdef TARGET_SPARC64
-# define TARGET_O_NDELAY 0x0004
-# else
-# define TARGET_O_NDELAY (0x0004 | TARGET_O_NONBLOCK)
-# endif
-#define TARGET_O_NOCTTY 0x8000 /* not fcntl */
-#define TARGET_O_LARGEFILE 0x40000
-#define TARGET_O_DIRECT 0x100000 /* direct disk access hint */
-#define TARGET_O_NOATIME 0x200000
-#define TARGET_O_CLOEXEC 0x400000
-#define TARGET___O_SYNC 0x800000
-#define TARGET_O_PATH 0x1000000
-#endif
-
-/* <asm-generic/fcntl.h> values follow. */
-#define TARGET_O_ACCMODE 0003
-#define TARGET_O_RDONLY 00
-#define TARGET_O_WRONLY 01
-#define TARGET_O_RDWR 02
-#ifndef TARGET_O_CREAT
-#define TARGET_O_CREAT 0100 /* not fcntl */
-#endif
-#ifndef TARGET_O_EXCL
-#define TARGET_O_EXCL 0200 /* not fcntl */
-#endif
-#ifndef TARGET_O_NOCTTY
-#define TARGET_O_NOCTTY 0400 /* not fcntl */
-#endif
-#ifndef TARGET_O_TRUNC
-#define TARGET_O_TRUNC 01000 /* not fcntl */
-#endif
-#ifndef TARGET_O_APPEND
-#define TARGET_O_APPEND 02000
-#endif
-#ifndef TARGET_O_NONBLOCK
-#define TARGET_O_NONBLOCK 04000
-#endif
-#ifndef TARGET_O_DSYNC
-#define TARGET_O_DSYNC 010000
-#endif
-#ifndef TARGET_FASYNC
-#define TARGET_FASYNC 020000 /* fcntl, for BSD compatibility */
-#endif
-#ifndef TARGET_O_DIRECT
-#define TARGET_O_DIRECT 040000 /* direct disk access hint */
-#endif
-#ifndef TARGET_O_LARGEFILE
-#define TARGET_O_LARGEFILE 0100000
-#endif
-#ifndef TARGET_O_DIRECTORY
-#define TARGET_O_DIRECTORY 0200000 /* must be a directory */
-#endif
-#ifndef TARGET_O_NOFOLLOW
-#define TARGET_O_NOFOLLOW 0400000 /* don't follow links */
-#endif
-#ifndef TARGET_O_NOATIME
-#define TARGET_O_NOATIME 01000000
-#endif
-#ifndef TARGET_O_CLOEXEC
-#define TARGET_O_CLOEXEC 02000000
-#endif
-#ifndef TARGET___O_SYNC
-#define TARGET___O_SYNC 04000000
-#endif
-#ifndef TARGET_O_PATH
-#define TARGET_O_PATH 010000000
-#endif
-#ifndef TARGET___O_TMPFILE
-#define TARGET___O_TMPFILE 020000000
-#endif
-#ifndef TARGET_O_TMPFILE
-#define TARGET_O_TMPFILE (TARGET___O_TMPFILE | TARGET_O_DIRECTORY)
-#endif
-#ifndef TARGET_O_NDELAY
-#define TARGET_O_NDELAY TARGET_O_NONBLOCK
-#endif
-#ifndef TARGET_O_SYNC
-#define TARGET_O_SYNC (TARGET___O_SYNC | TARGET_O_DSYNC)
-#endif
-
-struct target_flock {
- short l_type;
- short l_whence;
- abi_long l_start;
- abi_long l_len;
-#if defined(TARGET_MIPS)
- abi_long l_sysid;
-#endif
- int l_pid;
-#if defined(TARGET_MIPS)
- abi_long pad[4];
-#endif
-};
-
-struct target_flock64 {
- short l_type;
- short l_whence;
-#if defined(TARGET_PPC) || defined(TARGET_X86_64) || defined(TARGET_MIPS) \
- || defined(TARGET_SPARC) || defined(TARGET_HPPA) \
- || defined(TARGET_MICROBLAZE) || defined(TARGET_TILEGX)
- int __pad;
-#endif
- abi_llong l_start;
- abi_llong l_len;
- int l_pid;
-} QEMU_PACKED;
-
-#ifdef TARGET_ARM
-struct target_eabi_flock64 {
- short l_type;
- short l_whence;
- int __pad;
- abi_llong l_start;
- abi_llong l_len;
- int l_pid;
-} QEMU_PACKED;
-#endif
-
-struct target_f_owner_ex {
- int type; /* Owner type of ID. */
- int pid; /* ID of owner. */
-};
+#include "target_fcntl.h"
/* soundcard defines */
/* XXX: convert them all to arch independent entries */