From 8f968b6a24aec7de8b1a1b4d2de922adad689297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 8 Jul 2021 19:05:45 +0200 Subject: linux-user: Extract target errno to 'target_errno_defs.h' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want to access the target errno indepently of the rest of the linux-user code. Move the header containing the generic errno definitions ('errno_defs.h') to 'generic/target_errno_defs.h', create a new 'target_errno_defs.h' in each target which itself includes 'generic/target_errno_defs.h'. Suggested-by: Richard Henderson Reviewed-by: Laurent Vivier Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210708170550.1846343-4-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- linux-user/aarch64/target_errno_defs.h | 7 ++ linux-user/alpha/target_errno_defs.h | 6 ++ linux-user/arm/target_errno_defs.h | 7 ++ linux-user/cris/target_errno_defs.h | 7 ++ linux-user/errno_defs.h | 167 ------------------------------ linux-user/generic/target_errno_defs.h | 167 ++++++++++++++++++++++++++++++ linux-user/hexagon/target_errno_defs.h | 7 ++ linux-user/hppa/target_errno_defs.h | 6 ++ linux-user/i386/target_errno_defs.h | 7 ++ linux-user/m68k/target_errno_defs.h | 7 ++ linux-user/microblaze/target_errno_defs.h | 7 ++ linux-user/mips/target_errno_defs.h | 6 ++ linux-user/mips64/target_errno_defs.h | 6 ++ linux-user/nios2/target_errno_defs.h | 7 ++ linux-user/openrisc/target_errno_defs.h | 7 ++ linux-user/ppc/target_errno_defs.h | 7 ++ linux-user/riscv/target_errno_defs.h | 7 ++ linux-user/s390x/target_errno_defs.h | 7 ++ linux-user/safe-syscall.S | 2 +- linux-user/sh4/target_errno_defs.h | 7 ++ linux-user/sparc/target_errno_defs.h | 7 +- linux-user/sparc/target_syscall.h | 2 - linux-user/syscall_defs.h | 2 +- linux-user/x86_64/target_errno_defs.h | 7 ++ linux-user/xtensa/target_errno_defs.h | 7 ++ 25 files changed, 304 insertions(+), 172 deletions(-) create mode 100644 linux-user/aarch64/target_errno_defs.h create mode 100644 linux-user/alpha/target_errno_defs.h create mode 100644 linux-user/arm/target_errno_defs.h create mode 100644 linux-user/cris/target_errno_defs.h delete mode 100644 linux-user/errno_defs.h create mode 100644 linux-user/generic/target_errno_defs.h create mode 100644 linux-user/hexagon/target_errno_defs.h create mode 100644 linux-user/hppa/target_errno_defs.h create mode 100644 linux-user/i386/target_errno_defs.h create mode 100644 linux-user/m68k/target_errno_defs.h create mode 100644 linux-user/microblaze/target_errno_defs.h create mode 100644 linux-user/mips/target_errno_defs.h create mode 100644 linux-user/mips64/target_errno_defs.h create mode 100644 linux-user/nios2/target_errno_defs.h create mode 100644 linux-user/openrisc/target_errno_defs.h create mode 100644 linux-user/ppc/target_errno_defs.h create mode 100644 linux-user/riscv/target_errno_defs.h create mode 100644 linux-user/s390x/target_errno_defs.h create mode 100644 linux-user/sh4/target_errno_defs.h create mode 100644 linux-user/x86_64/target_errno_defs.h create mode 100644 linux-user/xtensa/target_errno_defs.h diff --git a/linux-user/aarch64/target_errno_defs.h b/linux-user/aarch64/target_errno_defs.h new file mode 100644 index 0000000000..461b547728 --- /dev/null +++ b/linux-user/aarch64/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef AARCH64_TARGET_ERRNO_DEFS_H +#define AARCH64_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/alpha/target_errno_defs.h b/linux-user/alpha/target_errno_defs.h new file mode 100644 index 0000000000..54770108c0 --- /dev/null +++ b/linux-user/alpha/target_errno_defs.h @@ -0,0 +1,6 @@ +#ifndef ALPHA_TARGET_ERRNO_DEFS_H +#define ALPHA_TARGET_ERRNO_DEFS_H + +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/arm/target_errno_defs.h b/linux-user/arm/target_errno_defs.h new file mode 100644 index 0000000000..fd84373238 --- /dev/null +++ b/linux-user/arm/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef ARM_TARGET_ERRNO_DEFS_H +#define ARM_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/cris/target_errno_defs.h b/linux-user/cris/target_errno_defs.h new file mode 100644 index 0000000000..1cf43b17a5 --- /dev/null +++ b/linux-user/cris/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef CRIS_TARGET_ERRNO_DEFS_H +#define CRIS_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/errno_defs.h b/linux-user/errno_defs.h deleted file mode 100644 index aaf5208d62..0000000000 --- a/linux-user/errno_defs.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Target definitions of errnos. These may be overridden by an - * architecture specific header if needed. - * - * Taken from asm-generic/errno-base.h and asm-generic/errno.h - */ - -#ifndef LINUX_USER_ERRNO_DEFS_H -#define LINUX_USER_ERRNO_DEFS_H - -#define TARGET_EPERM 1 /* Operation not permitted */ -#define TARGET_ENOENT 2 /* No such file or directory */ -#define TARGET_ESRCH 3 /* No such process */ -#define TARGET_EINTR 4 /* Interrupted system call */ -#define TARGET_EIO 5 /* I/O error */ -#define TARGET_ENXIO 6 /* No such device or address */ -#define TARGET_E2BIG 7 /* Argument list too long */ -#define TARGET_ENOEXEC 8 /* TARGET_Exec format error */ -#define TARGET_EBADF 9 /* Bad file number */ -#define TARGET_ECHILD 10 /* No child processes */ -#define TARGET_EAGAIN 11 /* Try again */ -#define TARGET_ENOMEM 12 /* Out of memory */ -#define TARGET_EACCES 13 /* Permission denied */ -#define TARGET_EFAULT 14 /* Bad address */ -#define TARGET_ENOTBLK 15 /* Block device required */ -#define TARGET_EBUSY 16 /* Device or resource busy */ -#define TARGET_EEXIST 17 /* File exists */ -#define TARGET_EXDEV 18 /* Cross-device link */ -#define TARGET_ENODEV 19 /* No such device */ -#define TARGET_ENOTDIR 20 /* Not a directory */ -#define TARGET_EISDIR 21 /* Is a directory */ -#define TARGET_EINVAL 22 /* Invalid argument */ -#define TARGET_ENFILE 23 /* File table overflow */ -#define TARGET_EMFILE 24 /* Too many open files */ -#define TARGET_ENOTTY 25 /* Not a typewriter */ -#define TARGET_ETXTBSY 26 /* Text file busy */ -#define TARGET_EFBIG 27 /* File too large */ -#define TARGET_ENOSPC 28 /* No space left on device */ -#define TARGET_ESPIPE 29 /* Illegal seek */ -#define TARGET_EROFS 30 /* Read-only file system */ -#define TARGET_EMLINK 31 /* Too many links */ -#define TARGET_EPIPE 32 /* Broken pipe */ -#define TARGET_EDOM 33 /* Math argument out of domain of func */ -#define TARGET_ERANGE 34 /* Math result not representable */ - -#define TARGET_EDEADLK 35 /* Resource deadlock would occur */ -#define TARGET_ENAMETOOLONG 36 /* File name too long */ -#define TARGET_ENOLCK 37 /* No record locks available */ -#define TARGET_ENOSYS 38 /* Function not implemented */ -#define TARGET_ENOTEMPTY 39 /* Directory not empty */ -#define TARGET_ELOOP 40 /* Too many symbolic links encountered */ - -#define TARGET_ENOMSG 42 /* No message of desired type */ -#define TARGET_EIDRM 43 /* Identifier removed */ -#define TARGET_ECHRNG 44 /* Channel number out of range */ -#define TARGET_EL2NSYNC 45 /* Level 2 not synchronized */ -#define TARGET_EL3HLT 46 /* Level 3 halted */ -#define TARGET_EL3RST 47 /* Level 3 reset */ -#define TARGET_ELNRNG 48 /* Link number out of range */ -#define TARGET_EUNATCH 49 /* Protocol driver not attached */ -#define TARGET_ENOCSI 50 /* No CSI structure available */ -#define TARGET_EL2HLT 51 /* Level 2 halted */ -#define TARGET_EBADE 52 /* Invalid exchange */ -#define TARGET_EBADR 53 /* Invalid request descriptor */ -#define TARGET_EXFULL 54 /* TARGET_Exchange full */ -#define TARGET_ENOANO 55 /* No anode */ -#define TARGET_EBADRQC 56 /* Invalid request code */ -#define TARGET_EBADSLT 57 /* Invalid slot */ - -#define TARGET_EBFONT 59 /* Bad font file format */ -#define TARGET_ENOSTR 60 /* Device not a stream */ -#define TARGET_ENODATA 61 /* No data available */ -#define TARGET_ETIME 62 /* Timer expired */ -#define TARGET_ENOSR 63 /* Out of streams resources */ -#define TARGET_ENONET 64 /* Machine is not on the network */ -#define TARGET_ENOPKG 65 /* Package not installed */ -#define TARGET_EREMOTE 66 /* Object is remote */ -#define TARGET_ENOLINK 67 /* Link has been severed */ -#define TARGET_EADV 68 /* Advertise error */ -#define TARGET_ESRMNT 69 /* Srmount error */ -#define TARGET_ECOMM 70 /* Communication error on send */ -#define TARGET_EPROTO 71 /* Protocol error */ -#define TARGET_EMULTIHOP 72 /* Multihop attempted */ -#define TARGET_EDOTDOT 73 /* RFS specific error */ -#define TARGET_EBADMSG 74 /* Not a data message */ -#define TARGET_EOVERFLOW 75 /* Value too large for defined data type */ -#define TARGET_ENOTUNIQ 76 /* Name not unique on network */ -#define TARGET_EBADFD 77 /* File descriptor in bad state */ -#define TARGET_EREMCHG 78 /* Remote address changed */ -#define TARGET_ELIBACC 79 /* Can not access a needed shared library */ -#define TARGET_ELIBBAD 80 /* Accessing a corrupted shared library */ -#define TARGET_ELIBSCN 81 /* .lib section in a.out corrupted */ -#define TARGET_ELIBMAX 82 /* Attempting to link in too many shared libraries */ -#define TARGET_ELIBEXEC 83 /* Cannot exec a shared library directly */ -#define TARGET_EILSEQ 84 /* Illegal byte sequence */ -#define TARGET_ERESTART 85 /* Interrupted system call should be restarted */ -#define TARGET_ESTRPIPE 86 /* Streams pipe error */ -#define TARGET_EUSERS 87 /* Too many users */ -#define TARGET_ENOTSOCK 88 /* Socket operation on non-socket */ -#define TARGET_EDESTADDRREQ 89 /* Destination address required */ -#define TARGET_EMSGSIZE 90 /* Message too long */ -#define TARGET_EPROTOTYPE 91 /* Protocol wrong type for socket */ -#define TARGET_ENOPROTOOPT 92 /* Protocol not available */ -#define TARGET_EPROTONOSUPPORT 93 /* Protocol not supported */ -#define TARGET_ESOCKTNOSUPPORT 94 /* Socket type not supported */ -#define TARGET_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define TARGET_EPFNOSUPPORT 96 /* Protocol family not supported */ -#define TARGET_EAFNOSUPPORT 97 /* Address family not supported by protocol */ -#define TARGET_EADDRINUSE 98 /* Address already in use */ -#define TARGET_EADDRNOTAVAIL 99 /* Cannot assign requested address */ -#define TARGET_ENETDOWN 100 /* Network is down */ -#define TARGET_ENETUNREACH 101 /* Network is unreachable */ -#define TARGET_ENETRESET 102 /* Network dropped connection because of reset */ -#define TARGET_ECONNABORTED 103 /* Software caused connection abort */ -#define TARGET_ECONNRESET 104 /* Connection reset by peer */ -#define TARGET_ENOBUFS 105 /* No buffer space available */ -#define TARGET_EISCONN 106 /* Transport endpoint is already connected */ -#define TARGET_ENOTCONN 107 /* Transport endpoint is not connected */ -#define TARGET_ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -#define TARGET_ETOOMANYREFS 109 /* Too many references: cannot splice */ -#define TARGET_ETIMEDOUT 110 /* Connection timed out */ -#define TARGET_ECONNREFUSED 111 /* Connection refused */ -#define TARGET_EHOSTDOWN 112 /* Host is down */ -#define TARGET_EHOSTUNREACH 113 /* No route to host */ -#define TARGET_EALREADY 114 /* Operation already in progress */ -#define TARGET_EINPROGRESS 115 /* Operation now in progress */ -#define TARGET_ESTALE 116 /* Stale NFS file handle */ -#define TARGET_EUCLEAN 117 /* Structure needs cleaning */ -#define TARGET_ENOTNAM 118 /* Not a XENIX named type file */ -#define TARGET_ENAVAIL 119 /* No XENIX semaphores available */ -#define TARGET_EISNAM 120 /* Is a named type file */ -#define TARGET_EREMOTEIO 121 /* Remote I/O error */ -#define TARGET_EDQUOT 122 /* Quota exceeded */ - -#define TARGET_ENOMEDIUM 123 /* No medium found */ -#define TARGET_EMEDIUMTYPE 124 /* Wrong medium type */ -#define TARGET_ECANCELED 125 /* Operation Canceled */ -#define TARGET_ENOKEY 126 /* Required key not available */ -#define TARGET_EKEYEXPIRED 127 /* Key has expired */ -#define TARGET_EKEYREVOKED 128 /* Key has been revoked */ -#define TARGET_EKEYREJECTED 129 /* Key was rejected by service */ - -/* for robust mutexes */ -#define TARGET_EOWNERDEAD 130 /* Owner died */ -#define TARGET_ENOTRECOVERABLE 131 /* State not recoverable */ - -#define TARGET_ERFKILL 132 /* Operation not possible due to RF-kill */ -#define TARGET_EHWPOISON 133 /* Memory page has hardware error */ - -/* QEMU internal, not visible to the guest. This is returned when a - * system call should be restarted, to tell the main loop that it - * should wind the guest PC backwards so it will re-execute the syscall - * after handling any pending signals. They match with the ones the guest - * kernel uses for the same purpose. - */ -#define TARGET_ERESTARTSYS 512 /* Restart system call (if SA_RESTART) */ - -/* QEMU internal, not visible to the guest. This is returned by the - * do_sigreturn() code after a successful sigreturn syscall, to indicate - * that it has correctly set the guest registers and so the main loop - * should not touch them. We use the value the guest would use for - * ERESTART_NOINTR (which is kernel internal) to guarantee that we won't - * clash with a valid guest errno now or in the future. - */ -#define TARGET_QEMU_ESIGRETURN 513 /* Return from signal */ - -#endif diff --git a/linux-user/generic/target_errno_defs.h b/linux-user/generic/target_errno_defs.h new file mode 100644 index 0000000000..17d85e0b61 --- /dev/null +++ b/linux-user/generic/target_errno_defs.h @@ -0,0 +1,167 @@ +/* + * Target definitions of errnos. These may be overridden by an + * architecture specific header if needed. + * + * Taken from asm-generic/errno-base.h and asm-generic/errno.h + */ + +#ifndef GENERIC_TARGET_ERRNO_DEFS_H +#define GENERIC_TARGET_ERRNO_DEFS_H + +#define TARGET_EPERM 1 /* Operation not permitted */ +#define TARGET_ENOENT 2 /* No such file or directory */ +#define TARGET_ESRCH 3 /* No such process */ +#define TARGET_EINTR 4 /* Interrupted system call */ +#define TARGET_EIO 5 /* I/O error */ +#define TARGET_ENXIO 6 /* No such device or address */ +#define TARGET_E2BIG 7 /* Argument list too long */ +#define TARGET_ENOEXEC 8 /* TARGET_Exec format error */ +#define TARGET_EBADF 9 /* Bad file number */ +#define TARGET_ECHILD 10 /* No child processes */ +#define TARGET_EAGAIN 11 /* Try again */ +#define TARGET_ENOMEM 12 /* Out of memory */ +#define TARGET_EACCES 13 /* Permission denied */ +#define TARGET_EFAULT 14 /* Bad address */ +#define TARGET_ENOTBLK 15 /* Block device required */ +#define TARGET_EBUSY 16 /* Device or resource busy */ +#define TARGET_EEXIST 17 /* File exists */ +#define TARGET_EXDEV 18 /* Cross-device link */ +#define TARGET_ENODEV 19 /* No such device */ +#define TARGET_ENOTDIR 20 /* Not a directory */ +#define TARGET_EISDIR 21 /* Is a directory */ +#define TARGET_EINVAL 22 /* Invalid argument */ +#define TARGET_ENFILE 23 /* File table overflow */ +#define TARGET_EMFILE 24 /* Too many open files */ +#define TARGET_ENOTTY 25 /* Not a typewriter */ +#define TARGET_ETXTBSY 26 /* Text file busy */ +#define TARGET_EFBIG 27 /* File too large */ +#define TARGET_ENOSPC 28 /* No space left on device */ +#define TARGET_ESPIPE 29 /* Illegal seek */ +#define TARGET_EROFS 30 /* Read-only file system */ +#define TARGET_EMLINK 31 /* Too many links */ +#define TARGET_EPIPE 32 /* Broken pipe */ +#define TARGET_EDOM 33 /* Math argument out of domain of func */ +#define TARGET_ERANGE 34 /* Math result not representable */ + +#define TARGET_EDEADLK 35 /* Resource deadlock would occur */ +#define TARGET_ENAMETOOLONG 36 /* File name too long */ +#define TARGET_ENOLCK 37 /* No record locks available */ +#define TARGET_ENOSYS 38 /* Function not implemented */ +#define TARGET_ENOTEMPTY 39 /* Directory not empty */ +#define TARGET_ELOOP 40 /* Too many symbolic links encountered */ + +#define TARGET_ENOMSG 42 /* No message of desired type */ +#define TARGET_EIDRM 43 /* Identifier removed */ +#define TARGET_ECHRNG 44 /* Channel number out of range */ +#define TARGET_EL2NSYNC 45 /* Level 2 not synchronized */ +#define TARGET_EL3HLT 46 /* Level 3 halted */ +#define TARGET_EL3RST 47 /* Level 3 reset */ +#define TARGET_ELNRNG 48 /* Link number out of range */ +#define TARGET_EUNATCH 49 /* Protocol driver not attached */ +#define TARGET_ENOCSI 50 /* No CSI structure available */ +#define TARGET_EL2HLT 51 /* Level 2 halted */ +#define TARGET_EBADE 52 /* Invalid exchange */ +#define TARGET_EBADR 53 /* Invalid request descriptor */ +#define TARGET_EXFULL 54 /* TARGET_Exchange full */ +#define TARGET_ENOANO 55 /* No anode */ +#define TARGET_EBADRQC 56 /* Invalid request code */ +#define TARGET_EBADSLT 57 /* Invalid slot */ + +#define TARGET_EBFONT 59 /* Bad font file format */ +#define TARGET_ENOSTR 60 /* Device not a stream */ +#define TARGET_ENODATA 61 /* No data available */ +#define TARGET_ETIME 62 /* Timer expired */ +#define TARGET_ENOSR 63 /* Out of streams resources */ +#define TARGET_ENONET 64 /* Machine is not on the network */ +#define TARGET_ENOPKG 65 /* Package not installed */ +#define TARGET_EREMOTE 66 /* Object is remote */ +#define TARGET_ENOLINK 67 /* Link has been severed */ +#define TARGET_EADV 68 /* Advertise error */ +#define TARGET_ESRMNT 69 /* Srmount error */ +#define TARGET_ECOMM 70 /* Communication error on send */ +#define TARGET_EPROTO 71 /* Protocol error */ +#define TARGET_EMULTIHOP 72 /* Multihop attempted */ +#define TARGET_EDOTDOT 73 /* RFS specific error */ +#define TARGET_EBADMSG 74 /* Not a data message */ +#define TARGET_EOVERFLOW 75 /* Value too large for defined data type */ +#define TARGET_ENOTUNIQ 76 /* Name not unique on network */ +#define TARGET_EBADFD 77 /* File descriptor in bad state */ +#define TARGET_EREMCHG 78 /* Remote address changed */ +#define TARGET_ELIBACC 79 /* Can not access a needed shared library */ +#define TARGET_ELIBBAD 80 /* Accessing a corrupted shared library */ +#define TARGET_ELIBSCN 81 /* .lib section in a.out corrupted */ +#define TARGET_ELIBMAX 82 /* Attempting to link in too many shared libraries */ +#define TARGET_ELIBEXEC 83 /* Cannot exec a shared library directly */ +#define TARGET_EILSEQ 84 /* Illegal byte sequence */ +#define TARGET_ERESTART 85 /* Interrupted system call should be restarted */ +#define TARGET_ESTRPIPE 86 /* Streams pipe error */ +#define TARGET_EUSERS 87 /* Too many users */ +#define TARGET_ENOTSOCK 88 /* Socket operation on non-socket */ +#define TARGET_EDESTADDRREQ 89 /* Destination address required */ +#define TARGET_EMSGSIZE 90 /* Message too long */ +#define TARGET_EPROTOTYPE 91 /* Protocol wrong type for socket */ +#define TARGET_ENOPROTOOPT 92 /* Protocol not available */ +#define TARGET_EPROTONOSUPPORT 93 /* Protocol not supported */ +#define TARGET_ESOCKTNOSUPPORT 94 /* Socket type not supported */ +#define TARGET_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ +#define TARGET_EPFNOSUPPORT 96 /* Protocol family not supported */ +#define TARGET_EAFNOSUPPORT 97 /* Address family not supported by protocol */ +#define TARGET_EADDRINUSE 98 /* Address already in use */ +#define TARGET_EADDRNOTAVAIL 99 /* Cannot assign requested address */ +#define TARGET_ENETDOWN 100 /* Network is down */ +#define TARGET_ENETUNREACH 101 /* Network is unreachable */ +#define TARGET_ENETRESET 102 /* Network dropped connection because of reset */ +#define TARGET_ECONNABORTED 103 /* Software caused connection abort */ +#define TARGET_ECONNRESET 104 /* Connection reset by peer */ +#define TARGET_ENOBUFS 105 /* No buffer space available */ +#define TARGET_EISCONN 106 /* Transport endpoint is already connected */ +#define TARGET_ENOTCONN 107 /* Transport endpoint is not connected */ +#define TARGET_ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ +#define TARGET_ETOOMANYREFS 109 /* Too many references: cannot splice */ +#define TARGET_ETIMEDOUT 110 /* Connection timed out */ +#define TARGET_ECONNREFUSED 111 /* Connection refused */ +#define TARGET_EHOSTDOWN 112 /* Host is down */ +#define TARGET_EHOSTUNREACH 113 /* No route to host */ +#define TARGET_EALREADY 114 /* Operation already in progress */ +#define TARGET_EINPROGRESS 115 /* Operation now in progress */ +#define TARGET_ESTALE 116 /* Stale NFS file handle */ +#define TARGET_EUCLEAN 117 /* Structure needs cleaning */ +#define TARGET_ENOTNAM 118 /* Not a XENIX named type file */ +#define TARGET_ENAVAIL 119 /* No XENIX semaphores available */ +#define TARGET_EISNAM 120 /* Is a named type file */ +#define TARGET_EREMOTEIO 121 /* Remote I/O error */ +#define TARGET_EDQUOT 122 /* Quota exceeded */ + +#define TARGET_ENOMEDIUM 123 /* No medium found */ +#define TARGET_EMEDIUMTYPE 124 /* Wrong medium type */ +#define TARGET_ECANCELED 125 /* Operation Canceled */ +#define TARGET_ENOKEY 126 /* Required key not available */ +#define TARGET_EKEYEXPIRED 127 /* Key has expired */ +#define TARGET_EKEYREVOKED 128 /* Key has been revoked */ +#define TARGET_EKEYREJECTED 129 /* Key was rejected by service */ + +/* for robust mutexes */ +#define TARGET_EOWNERDEAD 130 /* Owner died */ +#define TARGET_ENOTRECOVERABLE 131 /* State not recoverable */ + +#define TARGET_ERFKILL 132 /* Operation not possible due to RF-kill */ +#define TARGET_EHWPOISON 133 /* Memory page has hardware error */ + +/* QEMU internal, not visible to the guest. This is returned when a + * system call should be restarted, to tell the main loop that it + * should wind the guest PC backwards so it will re-execute the syscall + * after handling any pending signals. They match with the ones the guest + * kernel uses for the same purpose. + */ +#define TARGET_ERESTARTSYS 512 /* Restart system call (if SA_RESTART) */ + +/* QEMU internal, not visible to the guest. This is returned by the + * do_sigreturn() code after a successful sigreturn syscall, to indicate + * that it has correctly set the guest registers and so the main loop + * should not touch them. We use the value the guest would use for + * ERESTART_NOINTR (which is kernel internal) to guarantee that we won't + * clash with a valid guest errno now or in the future. + */ +#define TARGET_QEMU_ESIGRETURN 513 /* Return from signal */ + +#endif diff --git a/linux-user/hexagon/target_errno_defs.h b/linux-user/hexagon/target_errno_defs.h new file mode 100644 index 0000000000..da033a9a9e --- /dev/null +++ b/linux-user/hexagon/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef HEXAGON_TARGET_ERRNO_DEFS_H +#define HEXAGON_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/hppa/target_errno_defs.h b/linux-user/hppa/target_errno_defs.h new file mode 100644 index 0000000000..d6e9676ce2 --- /dev/null +++ b/linux-user/hppa/target_errno_defs.h @@ -0,0 +1,6 @@ +#ifndef HPPA_TARGET_ERRNO_DEFS_H +#define HPPA_TARGET_ERRNO_DEFS_H + +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/i386/target_errno_defs.h b/linux-user/i386/target_errno_defs.h new file mode 100644 index 0000000000..459b2189e2 --- /dev/null +++ b/linux-user/i386/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef I386_TARGET_ERRNO_DEFS_H +#define I386_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/m68k/target_errno_defs.h b/linux-user/m68k/target_errno_defs.h new file mode 100644 index 0000000000..96485a7543 --- /dev/null +++ b/linux-user/m68k/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef M68K_TARGET_ERRNO_DEFS_H +#define M68K_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/microblaze/target_errno_defs.h b/linux-user/microblaze/target_errno_defs.h new file mode 100644 index 0000000000..91a0bbf9dc --- /dev/null +++ b/linux-user/microblaze/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef MICROBLAZE_TARGET_ERRNO_DEFS_H +#define MICROBLAZE_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/mips/target_errno_defs.h b/linux-user/mips/target_errno_defs.h new file mode 100644 index 0000000000..daef95ea70 --- /dev/null +++ b/linux-user/mips/target_errno_defs.h @@ -0,0 +1,6 @@ +#ifndef MIPS_TARGET_ERRNO_DEFS_H +#define MIPS_TARGET_ERRNO_DEFS_H + +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/mips64/target_errno_defs.h b/linux-user/mips64/target_errno_defs.h new file mode 100644 index 0000000000..82b0a704f6 --- /dev/null +++ b/linux-user/mips64/target_errno_defs.h @@ -0,0 +1,6 @@ +#ifndef MIPS64_TARGET_ERRNO_DEFS_H +#define MIPS64_TARGET_ERRNO_DEFS_H + +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/nios2/target_errno_defs.h b/linux-user/nios2/target_errno_defs.h new file mode 100644 index 0000000000..28120013e2 --- /dev/null +++ b/linux-user/nios2/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef NIOS2_TARGET_ERRNO_DEFS_H +#define NIOS2_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/openrisc/target_errno_defs.h b/linux-user/openrisc/target_errno_defs.h new file mode 100644 index 0000000000..cdf159746b --- /dev/null +++ b/linux-user/openrisc/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef OR1K_TARGET_ERRNO_DEFS_H +#define OR1K_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/ppc/target_errno_defs.h b/linux-user/ppc/target_errno_defs.h new file mode 100644 index 0000000000..a24a973342 --- /dev/null +++ b/linux-user/ppc/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef PPC_TARGET_ERRNO_DEFS_H +#define PPC_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/riscv/target_errno_defs.h b/linux-user/riscv/target_errno_defs.h new file mode 100644 index 0000000000..5e377a2fce --- /dev/null +++ b/linux-user/riscv/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef RISCV_TARGET_ERRNO_DEFS_H +#define RISCV_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/s390x/target_errno_defs.h b/linux-user/s390x/target_errno_defs.h new file mode 100644 index 0000000000..f4c09700b5 --- /dev/null +++ b/linux-user/s390x/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef S390X_TARGET_ERRNO_DEFS_H +#define S390X_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/safe-syscall.S b/linux-user/safe-syscall.S index b5df6254ae..42ea7c40ba 100644 --- a/linux-user/safe-syscall.S +++ b/linux-user/safe-syscall.S @@ -11,7 +11,7 @@ */ #include "hostdep.h" -#include "errno_defs.h" +#include "target_errno_defs.h" /* We have the correct host directory on our include path * so that this will pull in the right fragment for the architecture. diff --git a/linux-user/sh4/target_errno_defs.h b/linux-user/sh4/target_errno_defs.h new file mode 100644 index 0000000000..e90adb54ab --- /dev/null +++ b/linux-user/sh4/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef SH4_TARGET_ERRNO_DEFS_H +#define SH4_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/sparc/target_errno_defs.h b/linux-user/sparc/target_errno_defs.h index e000810986..de4f1ffb0a 100644 --- a/linux-user/sparc/target_errno_defs.h +++ b/linux-user/sparc/target_errno_defs.h @@ -1,7 +1,12 @@ #ifndef SPARC_TARGET_ERRNO_DEFS_H #define SPARC_TARGET_ERRNO_DEFS_H -/* Target errno definitions taken from asm-sparc/errno.h */ +#include "../generic/target_errno_defs.h" + +/* + * Generic target errno overridden with definitions taken + * from asm-sparc/errno.h + */ #undef TARGET_EWOULDBLOCK #define TARGET_EWOULDBLOCK TARGET_EAGAIN /* Operation would block */ #undef TARGET_EINPROGRESS diff --git a/linux-user/sparc/target_syscall.h b/linux-user/sparc/target_syscall.h index dad501d008..087b39d39c 100644 --- a/linux-user/sparc/target_syscall.h +++ b/linux-user/sparc/target_syscall.h @@ -1,8 +1,6 @@ #ifndef SPARC_TARGET_SYSCALL_H #define SPARC_TARGET_SYSCALL_H -#include "target_errno_defs.h" - #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) struct target_pt_regs { abi_ulong u_regs[16]; diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 18b031a2f6..a5ce487dcc 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2751,7 +2751,7 @@ struct target_drm_i915_getparam { #include "socket.h" -#include "errno_defs.h" +#include "target_errno_defs.h" #define FUTEX_WAIT 0 #define FUTEX_WAKE 1 diff --git a/linux-user/x86_64/target_errno_defs.h b/linux-user/x86_64/target_errno_defs.h new file mode 100644 index 0000000000..cb2a0f6e0b --- /dev/null +++ b/linux-user/x86_64/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef X86_64_TARGET_ERRNO_DEFS_H +#define X86_64_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif diff --git a/linux-user/xtensa/target_errno_defs.h b/linux-user/xtensa/target_errno_defs.h new file mode 100644 index 0000000000..66fade2d0c --- /dev/null +++ b/linux-user/xtensa/target_errno_defs.h @@ -0,0 +1,7 @@ +#ifndef XTENSA_TARGET_ERRNO_DEFS_H +#define XTENSA_TARGET_ERRNO_DEFS_H + +/* Target uses generic errno */ +#include "../generic/target_errno_defs.h" + +#endif -- cgit v1.2.3