linux-user: target <-> host errno conversion code refactor
v3 cover linux-user: target <-> host errno conversion code refactor
Hi,
This series extract code related to target errno conversion (to/from host) into a separate header.
Since v2:
- addressed Richard / Laurent review comments Since v1:
- addressed Taylor / Richard / Laurent review comments
Based-on: <[email protected]>
Philippe Mathieu-Daudé (8):
linux-user/syscall: Fix RF-kill errno (typo in ERFKILL) linux-user/sparc: Rename target_errno.h -> target_errno_defs.h
linux-user: Extract target errno to 'target_errno_defs.h' linux-user/alpha: Move errno definitions to 'target_errno_defs.h' linux-user/hppa: Move errno definitions to 'target_errno_defs.h' linux-user/mips: Move errno definitions to 'target_errno_defs.h'
linux-user: Simplify host <-> target errno conversion using macros linux-user/syscall: Remove ERRNO_TABLE_SIZE check
linux-user/aarch64/target_errno_defs.h | 7 +
linux-user/alpha/target_errno_defs.h | 204 ++++++++++++++++
linux-user/alpha/target_syscall.h | 194 ---------------
linux-user/arm/target_errno_defs.h | 7 +
linux-user/cris/target_errno_defs.h | 7 +
.../target_errno_defs.h} | 4 +-
linux-user/hexagon/target_errno_defs.h | 7 +
linux-user/hppa/target_errno_defs.h | 220 +++++++++++++++++
linux-user/hppa/target_syscall.h | 210 -----------------
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 | 221 ++++++++++++++++++
linux-user/mips/target_syscall.h | 211 -----------------
linux-user/mips64/target_errno_defs.h | 10 +
linux-user/mips64/target_syscall.h | 211 -----------------
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/sh4/target_errno_defs.h | 7 +
.../{target_errno.h => target_errno_defs.h} | 11 +-
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 +
linux-user/syscall.c | 164 ++-----------
linux-user/errnos.c.inc | 140 +++++++++++
linux-user/safe-syscall.S | 2 +-
30 files changed, 926 insertions(+), 985 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
rename linux-user/{errno_defs.h => generic/target_errno_defs.h} (99%)
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
rename linux-user/sparc/{target_errno.h => target_errno_defs.h} (97%)
create mode 100644 linux-user/x86_64/target_errno_defs.h
create mode 100644 linux-user/xtensa/target_errno_defs.h
create mode 100644 linux-user/errnos.c.incSignature · 1 line
2.31.1
PATCH v3 1/8 linux-user/syscall: Fix RF-kill errno (typo in ERFKILL)
Affected targets: alpha, hppa, mips/64, sparc
--- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/syscall.c +1 -1
@@ -629,7 +629,7 @@ static uint16_t host_to_target_errno_table[ERRNO_TABLE_SIZE] = { #ifdef ENOMSG [ENOMSG ] =TARGET_ENOMSG , #endif -#ifdef ERKFILL +#ifdef ERFKILL [ERFKILL ] =TARGET_ERFKILL , #endif #ifdef EHWPOISON
Signature · 1 line
2.31.1
PATCH v3 2/8 linux-user/sparc: Rename target_errno.h -> target_errno_defs.h
In reply to Philippe Mathieu-DaudéWe want to have one generic target_errno.h (API to access target errno), and will add target errno definitions in target_errno_defs.h. The sparc target already have its errnos in an header, simply rename it.
---
linux-user/sparc/{target_errno.h => target_errno_defs.h} | 4 ++--
linux-user/sparc/target_syscall.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
rename linux-user/sparc/{target_errno.h => target_errno_defs.h} (99%)linux-user/sparc/target_errno_defs.h renamed from linux-user/sparc/target_errno.h +2 -2
@@ -1,5 +1,5 @@ -#ifndef SPARC_TARGET_ERRNO_H -#define SPARC_TARGET_ERRNO_H +#ifndef SPARC_TARGET_ERRNO_DEFS_H +#define SPARC_TARGET_ERRNO_DEFS_H /* Target errno definitions taken from asm-sparc/errno.h */ #undef TARGET_EWOULDBLOCK
linux-user/sparc/target_syscall.h +1 -1
@@ -1,7 +1,7 @@#ifndef SPARC_TARGET_SYSCALL_H #define SPARC_TARGET_SYSCALL_H -#include "target_errno.h" +#include "target_errno_defs.h" #if defined(TARGET_SPARC64 ) && !defined(TARGET_ABI32 ) struct target_pt_regs {
Signature · 1 line
2.31.1
PATCH v3 3/8 linux-user: Extract target errno to 'target_errno_defs.h'
In reply to Philippe Mathieu-Daudé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'.
---
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 => generic/target_errno_defs.h} | 4 ++--
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/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 +++++++
linux-user/safe-syscall.S | 2 +-
24 files changed, 139 insertions(+), 7 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
rename linux-user/{errno_defs.h => generic/target_errno_defs.h} (99%)
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.hlinux-user/aarch64/target_errno_defs.h new file +7 -0
@@ -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
linux-user/alpha/target_errno_defs.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef ALPHA_TARGET_ERRNO_DEFS_H +#define ALPHA_TARGET_ERRNO_DEFS_H + +#include "../generic/target_errno_defs.h" + +#endif
linux-user/arm/target_errno_defs.h new file +7 -0
@@ -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
linux-user/cris/target_errno_defs.h new file +7 -0
@@ -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
linux-user/generic/target_errno_defs.h renamed from linux-user/errno_defs.h +2 -2
@@ -5,8 +5,8 @@* Taken from asm-generic/errno-base.h and asm-generic/errno.h */ -#ifndef LINUX_USER_ERRNO_DEFS_H -#define LINUX_USER_ERRNO_DEFS_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 */
linux-user/hexagon/target_errno_defs.h new file +7 -0
@@ -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
linux-user/hppa/target_errno_defs.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef HPPA_TARGET_ERRNO_DEFS_H +#define HPPA_TARGET_ERRNO_DEFS_H + +#include "../generic/target_errno_defs.h" + +#endif
linux-user/i386/target_errno_defs.h new file +7 -0
@@ -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
linux-user/m68k/target_errno_defs.h new file +7 -0
@@ -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
linux-user/microblaze/target_errno_defs.h new file +7 -0
@@ -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
linux-user/mips/target_errno_defs.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef MIPS_TARGET_ERRNO_DEFS_H +#define MIPS_TARGET_ERRNO_DEFS_H + +#include "../generic/target_errno_defs.h" + +#endif
linux-user/mips64/target_errno_defs.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef MIPS64_TARGET_ERRNO_DEFS_H +#define MIPS64_TARGET_ERRNO_DEFS_H + +#include "../generic/target_errno_defs.h" + +#endif
linux-user/nios2/target_errno_defs.h new file +7 -0
@@ -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
linux-user/openrisc/target_errno_defs.h new file +7 -0
@@ -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
linux-user/ppc/target_errno_defs.h new file +7 -0
@@ -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
linux-user/riscv/target_errno_defs.h new file +7 -0
@@ -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
linux-user/s390x/target_errno_defs.h new file +7 -0
@@ -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
linux-user/sh4/target_errno_defs.h new file +7 -0
@@ -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
linux-user/sparc/target_errno_defs.h +6 -1
@@ -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
linux-user/sparc/target_syscall.h +0 -2
@@ -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];
linux-user/syscall_defs.h +1 -1
@@ -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
linux-user/x86_64/target_errno_defs.h new file +7 -0
@@ -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
linux-user/xtensa/target_errno_defs.h new file +7 -0
@@ -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
linux-user/safe-syscall.S +1 -1
@@ -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.
Signature · 1 line
2.31.1
PATCH v3 4/8 linux-user/alpha: Move errno definitions to 'target_errno_defs.h'
In reply to Philippe Mathieu-Daudé--- linux-user/alpha/target_errno_defs.h | 198 +++++++++++++++++++++++++++ linux-user/alpha/target_syscall.h | 194 -------------------------- 2 files changed, 198 insertions(+), 194 deletions(-)
linux-user/alpha/target_errno_defs.h +198 -0
@@ -3,4 +3,202 @@#include "../generic/target_errno_defs.h" +/* +* Generic target errno overridden with definitions taken +* from asm-alpha/errno.h +*/ +#undef TARGET_EWOULDBLOCK +#define TARGET_EWOULDBLOCK TARGET_EAGAIN +#undef TARGET_EDEADLK +#define TARGET_EDEADLK 11 +#undef TARGET_EAGAIN +#define TARGET_EAGAIN 35 +#undef TARGET_EINPROGRESS +#define TARGET_EINPROGRESS 36 +#undef TARGET_EALREADY +#define TARGET_EALREADY 37 +#undef TARGET_ENOTSOCK +#define TARGET_ENOTSOCK 38 +#undef TARGET_EDESTADDRREQ +#define TARGET_EDESTADDRREQ 39 +#undef TARGET_EMSGSIZE +#define TARGET_EMSGSIZE 40 +#undef TARGET_EPROTOTYPE +#define TARGET_EPROTOTYPE 41 +#undef TARGET_ENOPROTOOPT +#define TARGET_ENOPROTOOPT 42 +#undef TARGET_EPROTONOSUPPORT +#define TARGET_EPROTONOSUPPORT 43 +#undef TARGET_ESOCKTNOSUPPORT +#define TARGET_ESOCKTNOSUPPORT 44 +#undef TARGET_EOPNOTSUPP +#define TARGET_EOPNOTSUPP 45 +#undef TARGET_EPFNOSUPPORT +#define TARGET_EPFNOSUPPORT 46 +#undef TARGET_EAFNOSUPPORT +#define TARGET_EAFNOSUPPORT 47 +#undef TARGET_EADDRINUSE +#define TARGET_EADDRINUSE 48 +#undef TARGET_EADDRNOTAVAIL +#define TARGET_EADDRNOTAVAIL 49 +#undef TARGET_ENETDOWN +#define TARGET_ENETDOWN 50 +#undef TARGET_ENETUNREACH +#define TARGET_ENETUNREACH 51 +#undef TARGET_ENETRESET +#define TARGET_ENETRESET 52 +#undef TARGET_ECONNABORTED +#define TARGET_ECONNABORTED 53 +#undef TARGET_ECONNRESET +#define TARGET_ECONNRESET 54 +#undef TARGET_ENOBUFS +#define TARGET_ENOBUFS 55 +#undef TARGET_EISCONN +#define TARGET_EISCONN 56 +#undef TARGET_ENOTCONN +#define TARGET_ENOTCONN 57 +#undef TARGET_ESHUTDOWN +#define TARGET_ESHUTDOWN 58 +#undef TARGET_ETOOMANYREFS +#define TARGET_ETOOMANYREFS 59 +#undef TARGET_ETIMEDOUT +#define TARGET_ETIMEDOUT 60 +#undef TARGET_ECONNREFUSED +#define TARGET_ECONNREFUSED 61 +#undef TARGET_ELOOP +#define TARGET_ELOOP 62 +#undef TARGET_ENAMETOOLONG +#define TARGET_ENAMETOOLONG 63 +#undef TARGET_EHOSTDOWN +#define TARGET_EHOSTDOWN 64 +#undef TARGET_EHOSTUNREACH +#define TARGET_EHOSTUNREACH 65 +#undef TARGET_ENOTEMPTY +#define TARGET_ENOTEMPTY 66 +/* Unused 67 */ +#undef TARGET_EUSERS +#define TARGET_EUSERS 68 +#undef TARGET_EDQUOT +#define TARGET_EDQUOT 69 +#undef TARGET_ESTALE +#define TARGET_ESTALE 70 +#undef TARGET_EREMOTE +#define TARGET_EREMOTE 71 +/* Unused 72-76 */ +#undef TARGET_ENOLCK +#define TARGET_ENOLCK 77 +#undef TARGET_ENOSYS +#define TARGET_ENOSYS 78 +/* Unused 79 */ +#undef TARGET_ENOMSG +#define TARGET_ENOMSG 80 +#undef TARGET_EIDRM +#define TARGET_EIDRM 81 +#undef TARGET_ENOSR +#define TARGET_ENOSR 82 +#undef TARGET_ETIME +#define TARGET_ETIME 83 +#undef TARGET_EBADMSG +#define TARGET_EBADMSG 84 +#undef TARGET_EPROTO +#define TARGET_EPROTO 85 +#undef TARGET_ENODATA +#define TARGET_ENODATA 86 +#undef TARGET_ENOSTR +#define TARGET_ENOSTR 87 +#undef TARGET_ECHRNG +#define TARGET_ECHRNG 88 +#undef TARGET_EL2NSYNC +#define TARGET_EL2NSYNC 89 +#undef TARGET_EL3HLT +#define TARGET_EL3HLT 90 +#undef TARGET_EL3RST +#define TARGET_EL3RST 91 +#undef TARGET_ENOPKG +#define TARGET_ENOPKG 92 +#undef TARGET_ELNRNG +#define TARGET_ELNRNG 93 +#undef TARGET_EUNATCH +#define TARGET_EUNATCH 94 +#undef TARGET_ENOCSI +#define TARGET_ENOCSI 95 +#undef TARGET_EL2HLT +#define TARGET_EL2HLT 96 +#undef TARGET_EBADE +#define TARGET_EBADE 97 +#undef TARGET_EBADR +#define TARGET_EBADR 98 +#undef TARGET_EXFULL +#define TARGET_EXFULL 99 +#undef TARGET_ENOANO +#define TARGET_ENOANO 100 +#undef TARGET_EBADRQC +#define TARGET_EBADRQC 101 +#undef TARGET_EBADSLT +#define TARGET_EBADSLT 102 +/* Unused 103 */ +#undef TARGET_EBFONT +#define TARGET_EBFONT 104 +#undef TARGET_ENONET +#define TARGET_ENONET 105 +#undef TARGET_ENOLINK +#define TARGET_ENOLINK 106 +#undef TARGET_EADV +#define TARGET_EADV 107 +#undef TARGET_ESRMNT +#define TARGET_ESRMNT 108 +#undef TARGET_ECOMM +#define TARGET_ECOMM 109 +#undef TARGET_EMULTIHOP +#define TARGET_EMULTIHOP 110 +#undef TARGET_EDOTDOT +#define TARGET_EDOTDOT 111 +#undef TARGET_EOVERFLOW +#define TARGET_EOVERFLOW 112 +#undef TARGET_ENOTUNIQ +#define TARGET_ENOTUNIQ 113 +#undef TARGET_EBADFD +#define TARGET_EBADFD 114 +#undef TARGET_EREMCHG +#define TARGET_EREMCHG 115 +#undef TARGET_EILSEQ +#define TARGET_EILSEQ 116 +/* Same as default 117-121 */ +#undef TARGET_ELIBACC +#define TARGET_ELIBACC 122 +#undef TARGET_ELIBBAD +#define TARGET_ELIBBAD 123 +#undef TARGET_ELIBSCN +#define TARGET_ELIBSCN 124 +#undef TARGET_ELIBMAX +#define TARGET_ELIBMAX 125 +#undef TARGET_ELIBEXEC +#define TARGET_ELIBEXEC 126 +#undef TARGET_ERESTART +#define TARGET_ERESTART 127 +#undef TARGET_ESTRPIPE +#define TARGET_ESTRPIPE 128 +#undef TARGET_ENOMEDIUM +#define TARGET_ENOMEDIUM 129 +#undef TARGET_EMEDIUMTYPE +#define TARGET_EMEDIUMTYPE 130 +#undef TARGET_ECANCELED +#define TARGET_ECANCELED 131 +#undef TARGET_ENOKEY +#define TARGET_ENOKEY 132 +#undef TARGET_EKEYEXPIRED +#define TARGET_EKEYEXPIRED 133 +#undef TARGET_EKEYREVOKED +#define TARGET_EKEYREVOKED 134 +#undef TARGET_EKEYREJECTED +#define TARGET_EKEYREJECTED 135 +#undef TARGET_EOWNERDEAD +#define TARGET_EOWNERDEAD 136 +#undef TARGET_ENOTRECOVERABLE +#define TARGET_ENOTRECOVERABLE 137 +#undef TARGET_ERFKILL +#define TARGET_ERFKILL 138 +#undef TARGET_EHWPOISON +#define TARGET_EHWPOISON 139 +#endif
linux-user/alpha/target_syscall.h +0 -194
200 lines not on this page · raw message
Signature · 1 line
2.31.1
PATCH v3 5/8 linux-user/hppa: Move errno definitions to 'target_errno_defs.h'
In reply to Philippe Mathieu-Daudé--- linux-user/hppa/target_errno_defs.h | 214 ++++++++++++++++++++++++++++ linux-user/hppa/target_syscall.h | 210 --------------------------- 2 files changed, 214 insertions(+), 210 deletions(-)
linux-user/hppa/target_errno_defs.h +214 -0
@@ -3,4 +3,218 @@#include "../generic/target_errno_defs.h" +/* +* Generic target errno overridden with definitions taken +* from asm-parisc/errno.h +*/ +#undef TARGET_EWOULDBLOCK +#define TARGET_EWOULDBLOCK TARGET_EAGAIN/* Operation would block */ +#undef TARGET_ENOMSG +#define TARGET_ENOMSG 35 +#undef TARGET_EIDRM +#define TARGET_EIDRM 36 +#undef TARGET_ECHRNG +#define TARGET_ECHRNG 37 +#undef TARGET_EL2NSYNC +#define TARGET_EL2NSYNC 38 +#undef TARGET_EL3HLT +#define TARGET_EL3HLT 39 +#undef TARGET_EL3RST +#define TARGET_EL3RST 40 +#undef TARGET_ELNRNG +#define TARGET_ELNRNG 41 +#undef TARGET_EUNATCH +#define TARGET_EUNATCH 42 +#undef TARGET_ENOCSI +#define TARGET_ENOCSI 43 +#undef TARGET_EL2HLT +#define TARGET_EL2HLT 44 +#undef TARGET_EDEADLK +#define TARGET_EDEADLK 45 +#undef TARGET_ENOLCK +#define TARGET_ENOLCK 46 +#undef TARGET_EILSEQ +#define TARGET_EILSEQ 47 + +#undef TARGET_ENONET +#define TARGET_ENONET 50 +#undef TARGET_ENODATA +#define TARGET_ENODATA 51 +#undef TARGET_ETIME +#define TARGET_ETIME 52 +#undef TARGET_ENOSR +#define TARGET_ENOSR 53 +#undef TARGET_ENOSTR +#define TARGET_ENOSTR 54 +#undef TARGET_ENOPKG +#define TARGET_ENOPKG 55 + +#undef TARGET_ENOLINK +#define TARGET_ENOLINK 57 +#undef TARGET_EADV +#define TARGET_EADV 58 +#undef TARGET_ESRMNT +#define TARGET_ESRMNT 59 +#undef TARGET_ECOMM +#define TARGET_ECOMM 60 +#undef TARGET_EPROTO +#define TARGET_EPROTO 61 + +#undef TARGET_EMULTIHOP +#define TARGET_EMULTIHOP 64 + +#undef TARGET_EDOTDOT +#define TARGET_EDOTDOT 66 +#undef TARGET_EBADMSG +#define TARGET_EBADMSG 67 +#undef TARGET_EUSERS +#define TARGET_EUSERS 68 +#undef TARGET_EDQUOT +#define TARGET_EDQUOT 69 +#undef TARGET_ESTALE +#define TARGET_ESTALE 70 +#undef TARGET_EREMOTE +#define TARGET_EREMOTE 71 +#undef TARGET_EOVERFLOW +#define TARGET_EOVERFLOW 72 + +#undef TARGET_EBADE +#define TARGET_EBADE 160 +#undef TARGET_EBADR +#define TARGET_EBADR 161 +#undef TARGET_EXFULL +#define TARGET_EXFULL 162 +#undef TARGET_ENOANO +#define TARGET_ENOANO 163 +#undef TARGET_EBADRQC +#define TARGET_EBADRQC 164 +#undef TARGET_EBADSLT +#define TARGET_EBADSLT 165 +#undef TARGET_EBFONT +#define TARGET_EBFONT 166 +#undef TARGET_ENOTUNIQ +#define TARGET_ENOTUNIQ 167 +#undef TARGET_EBADFD +#define TARGET_EBADFD 168 +#undef TARGET_EREMCHG +#define TARGET_EREMCHG 169 +#undef TARGET_ELIBACC +#define TARGET_ELIBACC 170 +#undef TARGET_ELIBBAD +#define TARGET_ELIBBAD 171 +#undef TARGET_ELIBSCN +#define TARGET_ELIBSCN 172 +#undef TARGET_ELIBMAX +#define TARGET_ELIBMAX 173 +#undef TARGET_ELIBEXEC +#define TARGET_ELIBEXEC 174 +#undef TARGET_ERESTART +#define TARGET_ERESTART 175 +#undef TARGET_ESTRPIPE +#define TARGET_ESTRPIPE 176 +#undef TARGET_EUCLEAN +#define TARGET_EUCLEAN 177 +#undef TARGET_ENOTNAM +#define TARGET_ENOTNAM 178 +#undef TARGET_ENAVAIL +#define TARGET_ENAVAIL 179 +#undef TARGET_EISNAM +#define TARGET_EISNAM 180 +#undef TARGET_EREMOTEIO +#define TARGET_EREMOTEIO 181 +#undef TARGET_ENOMEDIUM +#define TARGET_ENOMEDIUM 182 +#undef TARGET_EMEDIUMTYPE +#define TARGET_EMEDIUMTYPE 183 +#undef TARGET_ENOKEY +#define TARGET_ENOKEY 184 +#undef TARGET_EKEYEXPIRED +#define TARGET_EKEYEXPIRED 185 +#undef TARGET_EKEYREVOKED +#define TARGET_EKEYREVOKED 186 +#undef TARGET_EKEYREJECTED +#define TARGET_EKEYREJECTED 187 + +/* Never used in linux. */ +/* #define TARGET_ENOSYM 215 */ +#undef TARGET_ENOTSOCK +#define TARGET_ENOTSOCK 216 +#undef TARGET_EDESTADDRREQ +#define TARGET_EDESTADDRREQ 217 +#undef TARGET_EMSGSIZE +#define TARGET_EMSGSIZE 218 +#undef TARGET_EPROTOTYPE +#define TARGET_EPROTOTYPE 219 +#undef TARGET_ENOPROTOOPT +#define TARGET_ENOPROTOOPT 220 +#undef TARGET_EPROTONOSUPPORT +#define TARGET_EPROTONOSUPPORT 221 +#undef TARGET_ESOCKTNOSUPPORT +#define TARGET_ESOCKTNOSUPPORT 222 +#undef TARGET_EOPNOTSUPP +#define TARGET_EOPNOTSUPP 223 +#undef TARGET_EPFNOSUPPORT +#define TARGET_EPFNOSUPPORT 224 +#undef TARGET_EAFNOSUPPORT +#define TARGET_EAFNOSUPPORT 225 +#undef TARGET_EADDRINUSE +#define TARGET_EADDRINUSE 226 +#undef TARGET_EADDRNOTAVAIL +#define TARGET_EADDRNOTAVAIL 227 +#undef TARGET_ENETDOWN +#define TARGET_ENETDOWN 228 +#undef TARGET_ENETUNREACH +#define TARGET_ENETUNREACH 229 +#undef TARGET_ENETRESET +#define TARGET_ENETRESET 230 +#undef TARGET_ECONNABORTED +#define TARGET_ECONNABORTED 231 +#undef TARGET_ECONNRESET +#define TARGET_ECONNRESET 232 +#undef TARGET_ENOBUFS +#define TARGET_ENOBUFS 233 +#undef TARGET_EISCONN +#define TARGET_EISCONN 234 +#undef TARGET_ENOTCONN +#define TARGET_ENOTCONN 235 +#undef TARGET_ESHUTDOWN +#define TARGET_ESHUTDOWN 236 +#undef TARGET_ETOOMANYREFS +#define TARGET_ETOOMANYREFS 237 +#undef TARGET_ETIMEDOUT +#define TARGET_ETIMEDOUT 238 +#undef TARGET_ECONNREFUSED +#define TARGET_ECONNREFUSED 239 +#define TARGET_EREMOTERELEASE 240 +#undef TARGET_EHOSTDOWN +#define TARGET_EHOSTDOWN 241 +#undef TARGET_EHOSTUNREACH +#define TARGET_EHOSTUNREACH 242 + +#undef TARGET_EALREADY +#define TARGET_EALREADY 244 +#undef TARGET_EINPROGRESS +#define TARGET_EINPROGRESS 245 +#undef TARGET_ENOTEMPTY +#define TARGET_ENOTEMPTY 247 +#undef TARGET_ENAMETOOLONG +#define TARGET_ENAMETOOLONG 248 +#undef TARGET_ELOOP +#define TARGET_ELOOP 249 +#undef TARGET_ENOSYS +#define TARGET_ENOSYS 251 + +#undef TARGET_ECANCELED +#define TARGET_ECANCELED 253 + +#undef TARGET_EOWNERDEAD +#define TARGET_EOWNERDEAD 254 +#undef TARGET_ENOTRECOVERABLE +#define TARGET_ENOTRECOVERABLE 255 + +#undef TARGET_ERFKILL +#define TARGET_ERFKILL 256 +#undef TARGET_EHWPOISON +#define TARGET_EHWPOISON 257 +#endif
linux-user/hppa/target_syscall.h +0 -210
214 lines not on this page · raw message
Signature · 1 line
2.31.1
PATCH v3 6/8 linux-user/mips: Move errno definitions to 'target_errno_defs.h'
In reply to Philippe Mathieu-Daudé--- linux-user/mips/target_errno_defs.h | 215 ++++++++++++++++++++++++++ linux-user/mips/target_syscall.h | 211 ------------------------- linux-user/mips64/target_errno_defs.h | 6 +- linux-user/mips64/target_syscall.h | 211 ------------------------- 4 files changed, 220 insertions(+), 423 deletions(-)
linux-user/mips/target_errno_defs.h +215 -0
@@ -3,4 +3,219 @@#include "../generic/target_errno_defs.h" +/* +* Generic target errno overridden with definitions taken +* from asm-mips/errno.h +*/ + +#undef TARGET_EWOULDBLOCK +#define TARGET_EWOULDBLOCK TARGET_EAGAIN/* Operation would block */ +#undef TARGET_ENOMSG +#define TARGET_ENOMSG 35/* Identifier removed */ +#undef TARGET_EIDRM +#define TARGET_EIDRM 36/* Identifier removed */ +#undef TARGET_ECHRNG +#define TARGET_ECHRNG 37/* Channel number out of range */ +#undef TARGET_EL2NSYNC +#define TARGET_EL2NSYNC 38/* Level 2 not synchronized */ +#undef TARGET_EL3HLT +#define TARGET_EL3HLT 39/* Level 3 halted */ +#undef TARGET_EL3RST +#define TARGET_EL3RST 40/* Level 3 reset */ +#undef TARGET_ELNRNG +#define TARGET_ELNRNG 41/* Link number out of range */ +#undef TARGET_EUNATCH +#define TARGET_EUNATCH 42/* Protocol driver not attached */ +#undef TARGET_ENOCSI +#define TARGET_ENOCSI 43/* No CSI structure available */ +#undef TARGET_EL2HLT +#define TARGET_EL2HLT 44/* Level 2 halted */ +#undef TARGET_EDEADLK +#define TARGET_EDEADLK 45/* Resource deadlock would occur */ +#undef TARGET_ENOLCK +#define TARGET_ENOLCK 46/* No record locks available */ +#undef TARGET_EBADE +#define TARGET_EBADE 50/* Invalid exchange */ +#undef TARGET_EBADR +#define TARGET_EBADR 51/* Invalid request descriptor */ +#undef TARGET_EXFULL +#define TARGET_EXFULL 52/* TARGET_Exchange full */ +#undef TARGET_ENOANO +#define TARGET_ENOANO 53/* No anode */ +#undef TARGET_EBADRQC +#define TARGET_EBADRQC 54/* Invalid request code */ +#undef TARGET_EBADSLT +#define TARGET_EBADSLT 55/* Invalid slot */ +#undef TARGET_EDEADLOCK +#define TARGET_EDEADLOCK 56/* File locking deadlock error */ +#undef TARGET_EBFONT +#define TARGET_EBFONT 59/* Bad font file format */ +#undef TARGET_ENOSTR +#define TARGET_ENOSTR 60/* Device not a stream */ +#undef TARGET_ENODATA +#define TARGET_ENODATA 61/* No data available */ +#undef TARGET_ETIME +#define TARGET_ETIME 62/* Timer expired */ +#undef TARGET_ENOSR +#define TARGET_ENOSR 63/* Out of streams resources */ +#undef TARGET_ENONET +#define TARGET_ENONET 64/* Machine is not on the network */ +#undef TARGET_ENOPKG +#define TARGET_ENOPKG 65/* Package not installed */ +#undef TARGET_EREMOTE +#define TARGET_EREMOTE 66/* Object is remote */ +#undef TARGET_ENOLINK +#define TARGET_ENOLINK 67/* Link has been severed */ +#undef TARGET_EADV +#define TARGET_EADV 68/* Advertise error */ +#undef TARGET_ESRMNT +#define TARGET_ESRMNT 69/* Srmount error */ +#undef TARGET_ECOMM +#define TARGET_ECOMM 70/* Communication error on send */ +#undef TARGET_EPROTO +#define TARGET_EPROTO 71/* Protocol error */ +#undef TARGET_EDOTDOT +#define TARGET_EDOTDOT 73/* RFS specific error */ +#undef TARGET_EMULTIHOP +#define TARGET_EMULTIHOP 74/* Multihop attempted */ +#undef TARGET_EBADMSG +#define TARGET_EBADMSG 77/* Not a data message */ +#undef TARGET_ENAMETOOLONG +#define TARGET_ENAMETOOLONG 78/* File name too long */ +#undef TARGET_EOVERFLOW +#define TARGET_EOVERFLOW 79/* Value too large for defined data type */ +#undef TARGET_ENOTUNIQ +#define TARGET_ENOTUNIQ 80/* Name not unique on network */ +#undef TARGET_EBADFD +#define TARGET_EBADFD 81/* File descriptor in bad state */ +#undef TARGET_EREMCHG +#define TARGET_EREMCHG 82/* Remote address changed */ +#undef TARGET_ELIBACC +#define TARGET_ELIBACC 83/* Can not access a needed shared library */ +#undef TARGET_ELIBBAD +#define TARGET_ELIBBAD 84/* Accessing a corrupted shared library */ +#undef TARGET_ELIBSCN +#define TARGET_ELIBSCN 85/* .lib section in a.out corrupted */ +#undef TARGET_ELIBMAX +#define TARGET_ELIBMAX 86/* Attempting to link in too many shared libraries */ +#undef TARGET_ELIBEXEC +#define TARGET_ELIBEXEC 87/* Cannot exec a shared library directly */ +#undef TARGET_EILSEQ +#define TARGET_EILSEQ 88/* Illegal byte sequence */ +#undef TARGET_ENOSYS +#define TARGET_ENOSYS 89/* Function not implemented */ +#undef TARGET_ELOOP +#define TARGET_ELOOP 90/* Too many symbolic links encountered */ +#undef TARGET_ERESTART +#define TARGET_ERESTART 91/* Interrupted system call should be restarted */ +#undef TARGET_ESTRPIPE +#define TARGET_ESTRPIPE 92/* Streams pipe error */ +#undef TARGET_ENOTEMPTY +#define TARGET_ENOTEMPTY 93/* Directory not empty */ +#undef TARGET_EUSERS +#define TARGET_EUSERS 94/* Too many users */ +#undef TARGET_ENOTSOCK +#define TARGET_ENOTSOCK 95/* Socket operation on non-socket */ +#undef TARGET_EDESTADDRREQ +#define TARGET_EDESTADDRREQ 96/* Destination address required */ +#undef TARGET_EMSGSIZE +#define TARGET_EMSGSIZE 97/* Message too long */ +#undef TARGET_EPROTOTYPE +#define TARGET_EPROTOTYPE 98/* Protocol wrong type for socket */ +#undef TARGET_ENOPROTOOPT +#define TARGET_ENOPROTOOPT 99/* Protocol not available */ +#undef TARGET_EPROTONOSUPPORT +#define TARGET_EPROTONOSUPPORT 120/* Protocol not supported */ +#undef TARGET_ESOCKTNOSUPPORT +#define TARGET_ESOCKTNOSUPPORT 121/* Socket type not supported */ +#undef TARGET_EOPNOTSUPP +#define TARGET_EOPNOTSUPP 122/* Operation not supported on transport endpoint */ +#undef TARGET_EPFNOSUPPORT +#define TARGET_EPFNOSUPPORT 123/* Protocol family not supported */ +#undef TARGET_EAFNOSUPPORT +#define TARGET_EAFNOSUPPORT 124/* Address family not supported by protocol */ +#undef TARGET_EADDRINUSE +#define TARGET_EADDRINUSE 125/* Address already in use */ +#undef TARGET_EADDRNOTAVAIL +#define TARGET_EADDRNOTAVAIL 126/* Cannot assign requested address */ +#undef TARGET_ENETDOWN +#define TARGET_ENETDOWN 127/* Network is down */ +#undef TARGET_ENETUNREACH +#define TARGET_ENETUNREACH 128/* Network is unreachable */ +#undef TARGET_ENETRESET +#define TARGET_ENETRESET 129/* Network dropped connection because of reset */ +#undef TARGET_ECONNABORTED +#define TARGET_ECONNABORTED 130/* Software caused connection abort */ +#undef TARGET_ECONNRESET +#define TARGET_ECONNRESET 131/* Connection reset by peer */ +#undef TARGET_ENOBUFS +#define TARGET_ENOBUFS 132/* No buffer space available */ +#undef TARGET_EISCONN +#define TARGET_EISCONN 133/* Transport endpoint is already connected */ +#undef TARGET_ENOTCONN +#define TARGET_ENOTCONN 134/* Transport endpoint is not connected */ +#undef TARGET_EUCLEAN +#define TARGET_EUCLEAN 135/* Structure needs cleaning */ +#undef TARGET_ENOTNAM +#define TARGET_ENOTNAM 137/* Not a XENIX named type file */ +#undef TARGET_ENAVAIL +#define TARGET_ENAVAIL 138/* No XENIX semaphores available */ +#undef TARGET_EISNAM +#define TARGET_EISNAM 139/* Is a named type file */ +#undef TARGET_EREMOTEIO +#define TARGET_EREMOTEIO 140/* Remote I/O error */ +#undef TARGET_EINIT +#define TARGET_EINIT 141/* Reserved */ +#undef TARGET_EREMDEV +#define TARGET_EREMDEV 142/* TARGET_Error 142 */ +#undef TARGET_ESHUTDOWN +#define TARGET_ESHUTDOWN 143/* Cannot send after transport endpoint shutdown */ +#undef TARGET_ETOOMANYREFS +#define TARGET_ETOOMANYREFS 144/* Too many references: cannot splice */ +#undef TARGET_ETIMEDOUT +#define TARGET_ETIMEDOUT 145/* Connection timed out */ +#undef TARGET_ECONNREFUSED +#define TARGET_ECONNREFUSED 146/* Connection refused */ +#undef TARGET_EHOSTDOWN +#define TARGET_EHOSTDOWN 147/* Host is down */ +#undef TARGET_EHOSTUNREACH +#define TARGET_EHOSTUNREACH 148/* No route to host */ +#undef TARGET_EALREADY +#define TARGET_EALREADY 149/* Operation already in progress */ +#undef TARGET_EINPROGRESS +#define TARGET_EINPROGRESS 150/* Operation now in progress */ +#undef TARGET_ESTALE +#define TARGET_ESTALE 151/* Stale NFS file handle */ +#undef TARGET_ECANCELED +#define TARGET_ECANCELED 158/* AIO operation canceled */ +/* +* These error are Linux extensions. +*/ +#undef TARGET_ENOMEDIUM +#define TARGET_ENOMEDIUM 159/* No medium found */ +#undef TARGET_EMEDIUMTYPE +#define TARGET_EMEDIUMTYPE 160/* Wrong medium type */ +#undef TARGET_ENOKEY +#define TARGET_ENOKEY 161/* Required key not available */ +#undef TARGET_EKEYEXPIRED +#define TARGET_EKEYEXPIRED 162/* Key has expired */ +#undef TARGET_EKEYREVOKED +#define TARGET_EKEYREVOKED 163/* Key has been revoked */ +#undef TARGET_EKEYREJECTED +#define TARGET_EKEYREJECTED 164/* Key was rejected by service */ + +/* for robust mutexes */ +#undef TARGET_EOWNERDEAD +#define TARGET_EOWNERDEAD 165/* Owner died */ +#undef TARGET_ENOTRECOVERABLE +#define TARGET_ENOTRECOVERABLE 166/* State not recoverable */ + +#undef TARGET_ERFKILL +#define TARGET_ERFKILL 167 +#undef TARGET_EHWPOISON +#define TARGET_EHWPOISON 168 + +#undef TARGET_EDQUOT +#define TARGET_EDQUOT 1133/* Quota exceeded */ +#endif
linux-user/mips/target_syscall.h +0 -211
217 lines not on this page · raw message
linux-user/mips64/target_errno_defs.h +5 -1
@@ -1,6 +1,10 @@#ifndef MIPS64_TARGET_ERRNO_DEFS_H #define MIPS64_TARGET_ERRNO_DEFS_H -#include "../generic/target_errno_defs.h" +/* +* The mips64 target uses errno definitions taken from asm-mips/errno.h +* so directly use the mips target errno definitions. +*/ +#include "../mips/target_errno_defs.h" #endif
linux-user/mips64/target_syscall.h +0 -211
217 lines not on this page · raw message
Signature · 1 line
2.31.1
PATCH v3 7/8 linux-user: Simplify host <-> target errno conversion using macros
In reply to Philippe Mathieu-DaudéConvert the host_to_target_errno_table[] array to a switch case to allow compiler optimizations (such noticing the identity function when host and guest errnos match). Extract the errnos list as to a new includible unit, using a generic macro. Remove the code related to target_to_host_errno_table[] initialization.
--- linux-user/syscall.c | 159 ++++------------------------------------ linux-user/errnos.c.inc | 140 +++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+), 145 deletions(-) create mode 100644 linux-user/errnos.c.inc
linux-user/syscall.c +14 -145
@@ -509,150 +509,26 @@ static inline int next_free_host_timer(void)#define ERRNO_TABLE_SIZE 1200 -/* target_to_host_errno_table[] is initialized from -* host_to_target_errno_table[] in syscall_init(). */ -static uint16_t target_to_host_errno_table[ERRNO_TABLE_SIZE ] = { -}; - -/* -* This list is the union of errno values overridden in asm-<arch>/errno.h -* minus the errnos that are not actually generic to all archs. -*/ -static uint16_t host_to_target_errno_table[ERRNO_TABLE_SIZE ] = { - [EAGAIN ] =TARGET_EAGAIN , - [EIDRM ] =TARGET_EIDRM , - [ECHRNG ] =TARGET_ECHRNG , - [EL2NSYNC ] =TARGET_EL2NSYNC , - [EL3HLT ] =TARGET_EL3HLT , - [EL3RST ] =TARGET_EL3RST , - [ELNRNG ] =TARGET_ELNRNG , - [EUNATCH ] =TARGET_EUNATCH , - [ENOCSI ] =TARGET_ENOCSI , - [EL2HLT ] =TARGET_EL2HLT , - [EDEADLK ] =TARGET_EDEADLK , - [ENOLCK ] =TARGET_ENOLCK , - [EBADE ] =TARGET_EBADE , - [EBADR ] =TARGET_EBADR , - [EXFULL ] =TARGET_EXFULL , - [ENOANO ] =TARGET_ENOANO , - [EBADRQC ] =TARGET_EBADRQC , - [EBADSLT ] =TARGET_EBADSLT , - [EBFONT ] =TARGET_EBFONT , - [ENOSTR ] =TARGET_ENOSTR , - [ENODATA ] =TARGET_ENODATA , - [ETIME ] =TARGET_ETIME , - [ENOSR ] =TARGET_ENOSR , - [ENONET ] =TARGET_ENONET , - [ENOPKG ] =TARGET_ENOPKG , - [EREMOTE ] =TARGET_EREMOTE , - [ENOLINK ] =TARGET_ENOLINK , - [EADV ] =TARGET_EADV , - [ESRMNT ] =TARGET_ESRMNT , - [ECOMM ] =TARGET_ECOMM , - [EPROTO ] =TARGET_EPROTO , - [EDOTDOT ] =TARGET_EDOTDOT , - [EMULTIHOP ] =TARGET_EMULTIHOP , - [EBADMSG ] =TARGET_EBADMSG , - [ENAMETOOLONG ] =TARGET_ENAMETOOLONG , - [EOVERFLOW ] =TARGET_EOVERFLOW , - [ENOTUNIQ ] =TARGET_ENOTUNIQ , - [EBADFD ] =TARGET_EBADFD , - [EREMCHG ] =TARGET_EREMCHG , - [ELIBACC ] =TARGET_ELIBACC , - [ELIBBAD ] =TARGET_ELIBBAD , - [ELIBSCN ] =TARGET_ELIBSCN , - [ELIBMAX ] =TARGET_ELIBMAX , - [ELIBEXEC ] =TARGET_ELIBEXEC , - [EILSEQ ] =TARGET_EILSEQ , - [ENOSYS ] =TARGET_ENOSYS , - [ELOOP ] =TARGET_ELOOP , - [ERESTART ] =TARGET_ERESTART , - [ESTRPIPE ] =TARGET_ESTRPIPE , - [ENOTEMPTY ] =TARGET_ENOTEMPTY , - [EUSERS ] =TARGET_EUSERS , - [ENOTSOCK ] =TARGET_ENOTSOCK , - [EDESTADDRREQ ] =TARGET_EDESTADDRREQ , - [EMSGSIZE ] =TARGET_EMSGSIZE , - [EPROTOTYPE ] =TARGET_EPROTOTYPE , - [ENOPROTOOPT ] =TARGET_ENOPROTOOPT , - [EPROTONOSUPPORT ] =TARGET_EPROTONOSUPPORT , - [ESOCKTNOSUPPORT ] =TARGET_ESOCKTNOSUPPORT , - [EOPNOTSUPP ] =TARGET_EOPNOTSUPP , - [EPFNOSUPPORT ] =TARGET_EPFNOSUPPORT , - [EAFNOSUPPORT ] =TARGET_EAFNOSUPPORT , - [EADDRINUSE ] =TARGET_EADDRINUSE , - [EADDRNOTAVAIL ] =TARGET_EADDRNOTAVAIL , - [ENETDOWN ] =TARGET_ENETDOWN , - [ENETUNREACH ] =TARGET_ENETUNREACH , - [ENETRESET ] =TARGET_ENETRESET , - [ECONNABORTED ] =TARGET_ECONNABORTED , - [ECONNRESET ] =TARGET_ECONNRESET , - [ENOBUFS ] =TARGET_ENOBUFS , - [EISCONN ] =TARGET_EISCONN , - [ENOTCONN ] =TARGET_ENOTCONN , - [EUCLEAN ] =TARGET_EUCLEAN , - [ENOTNAM ] =TARGET_ENOTNAM , - [ENAVAIL ] =TARGET_ENAVAIL , - [EISNAM ] =TARGET_EISNAM , - [EREMOTEIO ] =TARGET_EREMOTEIO , - [EDQUOT ] =TARGET_EDQUOT , - [ESHUTDOWN ] =TARGET_ESHUTDOWN , - [ETOOMANYREFS ] =TARGET_ETOOMANYREFS , - [ETIMEDOUT ] =TARGET_ETIMEDOUT , - [ECONNREFUSED ] =TARGET_ECONNREFUSED , - [EHOSTDOWN ] =TARGET_EHOSTDOWN , - [EHOSTUNREACH ] =TARGET_EHOSTUNREACH , - [EALREADY ] =TARGET_EALREADY , - [EINPROGRESS ] =TARGET_EINPROGRESS , - [ESTALE ] =TARGET_ESTALE , - [ECANCELED ] =TARGET_ECANCELED , - [ENOMEDIUM ] =TARGET_ENOMEDIUM , - [EMEDIUMTYPE ] =TARGET_EMEDIUMTYPE , -#ifdef ENOKEY - [ENOKEY ] =TARGET_ENOKEY , -#endif -#ifdef EKEYEXPIRED - [EKEYEXPIRED ] =TARGET_EKEYEXPIRED , -#endif -#ifdef EKEYREVOKED - [EKEYREVOKED ] =TARGET_EKEYREVOKED , -#endif -#ifdef EKEYREJECTED - [EKEYREJECTED ] =TARGET_EKEYREJECTED , -#endif -#ifdef EOWNERDEAD - [EOWNERDEAD ] =TARGET_EOWNERDEAD , -#endif -#ifdef ENOTRECOVERABLE - [ENOTRECOVERABLE ] =TARGET_ENOTRECOVERABLE , -#endif -#ifdef ENOMSG - [ENOMSG ] =TARGET_ENOMSG , -#endif -#ifdef ERFKILL - [ERFKILL ] =TARGET_ERFKILL , -#endif -#ifdef EHWPOISON - [EHWPOISON ] =TARGET_EHWPOISON , -#endif -}; - -static inline int host_to_target_errno (int err) +static inline int host_to_target_errno (int host_errno) { -if (err >=0 && err <ERRNO_TABLE_SIZE && - host_to_target_errno_table[err]) { -return host_to_target_errno_table[err]; +switch (host_errno) { +#define E (X ) case X: return TARGET_##X; +#include "errnos.c.inc" +#undef E +default : +return host_errno; } -return err; } -static inline int target_to_host_errno (int err) +static inline int target_to_host_errno (int target_errno) { -if (err >=0 && err <ERRNO_TABLE_SIZE && - target_to_host_errno_table[err]) { -return target_to_host_errno_table[err]; +switch (target_errno) { +#define E (X ) case TARGET_##X: return X; +#include "errnos.c.inc" +#undef E +default : +return target_errno; } -return err; }static inline abi_long get_errno (abi_long ret)
@@ -7102,7 +6978,6 @@ void syscall_init(void)IOCTLEntry *ie;const argtype *arg_type;int size; -int i;thunk_init (STRUCT_MAX );
@@ -7112,12 +6987,6 @@ void syscall_init(void)#undef STRUCT#undef STRUCT_SPECIAL -/* Build target_to_host_errno_table[] table from -* host_to_target_errno_table[]. */ -for (i =0 ; i <ERRNO_TABLE_SIZE ; i++) { - target_to_host_errno_table[host_to_target_errno_table[i]] = i; - } -/* we patch the ioctl size if necessary. We rely on the fact that no ioctl has all the bits at '1' in the size field */ ie = ioctl_entries;
linux-user/errnos.c.inc new file +140 -0
140 lines not on this page · raw message
Signature · 1 line
2.31.1
Re: [PATCH v3 7/8] linux-user: Simplify host <-> target errno conversion using macros
Quoted 6 lines · Philippe Mathieu-Daudé
Convert the host_to_target_errno_table[] array to a switch case to allow compiler optimizations (such noticing the identity function when host and guest errnos match). Extract the errnos list as to a new includible unit, using a generic macro. Remove the code related to target_to_host_errno_table[] initialization.
Quoted 7 lines
Suggested-by Richard Henderson<[email protected]>Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- linux-user/syscall.c | 159 ++++------------------------------------ linux-user/errnos.c.inc | 140 +++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+), 145 deletions(-)create mode 100644 linux-user/errnos.c.inc
r~
Re: [PATCH v3 7/8] linux-user: Simplify host <-> target errno conversion using macros
In reply to Philippe Mathieu-DaudéLe 08/07/2021 à 19:05, Philippe Mathieu-Daudé a écrit :
Quoted 341 lines
Convert the host_to_target_errno_table[] array to a switch case to allow compiler optimizations (such noticing the identity function when host and guest errnos match). Extract the errnos list as to a new includible unit, using a generic macro. Remove the code related to target_to_host_errno_table[] initialization.
Suggested-by Richard Henderson <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- linux-user/syscall.c | 159 ++++------------------------------------ linux-user/errnos.c.inc | 140 +++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+), 145 deletions(-) create mode 100644 linux-user/errnos.c.inclinux-user/syscall.c +14
-145@@ -509,150 +509,26 @@ static inline int next_free_host_timer(void)#define ERRNO_TABLE_SIZE 1200 -/* target_to_host_errno_table[] is initialized from -* host_to_target_errno_table[] in syscall_init(). */ -static uint16_t target_to_host_errno_table[ERRNO_TABLE_SIZE ] = { -}; - -/* -* This list is the union of errno values overridden in asm-<arch>/errno.h -* minus the errnos that are not actually generic to all archs. -*/ -static uint16_t host_to_target_errno_table[ERRNO_TABLE_SIZE ] = { - [EAGAIN ] =TARGET_EAGAIN , - [EIDRM ] =TARGET_EIDRM , - [ECHRNG ] =TARGET_ECHRNG , - [EL2NSYNC ] =TARGET_EL2NSYNC , - [EL3HLT ] =TARGET_EL3HLT , - [EL3RST ] =TARGET_EL3RST , - [ELNRNG ] =TARGET_ELNRNG , - [EUNATCH ] =TARGET_EUNATCH , - [ENOCSI ] =TARGET_ENOCSI , - [EL2HLT ] =TARGET_EL2HLT , - [EDEADLK ] =TARGET_EDEADLK , - [ENOLCK ] =TARGET_ENOLCK , - [EBADE ] =TARGET_EBADE , - [EBADR ] =TARGET_EBADR , - [EXFULL ] =TARGET_EXFULL , - [ENOANO ] =TARGET_ENOANO , - [EBADRQC ] =TARGET_EBADRQC , - [EBADSLT ] =TARGET_EBADSLT , - [EBFONT ] =TARGET_EBFONT , - [ENOSTR ] =TARGET_ENOSTR , - [ENODATA ] =TARGET_ENODATA , - [ETIME ] =TARGET_ETIME , - [ENOSR ] =TARGET_ENOSR , - [ENONET ] =TARGET_ENONET , - [ENOPKG ] =TARGET_ENOPKG , - [EREMOTE ] =TARGET_EREMOTE , - [ENOLINK ] =TARGET_ENOLINK , - [EADV ] =TARGET_EADV , - [ESRMNT ] =TARGET_ESRMNT , - [ECOMM ] =TARGET_ECOMM , - [EPROTO ] =TARGET_EPROTO , - [EDOTDOT ] =TARGET_EDOTDOT , - [EMULTIHOP ] =TARGET_EMULTIHOP , - [EBADMSG ] =TARGET_EBADMSG , - [ENAMETOOLONG ] =TARGET_ENAMETOOLONG , - [EOVERFLOW ] =TARGET_EOVERFLOW , - [ENOTUNIQ ] =TARGET_ENOTUNIQ , - [EBADFD ] =TARGET_EBADFD , - [EREMCHG ] =TARGET_EREMCHG , - [ELIBACC ] =TARGET_ELIBACC , - [ELIBBAD ] =TARGET_ELIBBAD , - [ELIBSCN ] =TARGET_ELIBSCN , - [ELIBMAX ] =TARGET_ELIBMAX , - [ELIBEXEC ] =TARGET_ELIBEXEC , - [EILSEQ ] =TARGET_EILSEQ , - [ENOSYS ] =TARGET_ENOSYS , - [ELOOP ] =TARGET_ELOOP , - [ERESTART ] =TARGET_ERESTART , - [ESTRPIPE ] =TARGET_ESTRPIPE , - [ENOTEMPTY ] =TARGET_ENOTEMPTY , - [EUSERS ] =TARGET_EUSERS , - [ENOTSOCK ] =TARGET_ENOTSOCK , - [EDESTADDRREQ ] =TARGET_EDESTADDRREQ , - [EMSGSIZE ] =TARGET_EMSGSIZE , - [EPROTOTYPE ] =TARGET_EPROTOTYPE , - [ENOPROTOOPT ] =TARGET_ENOPROTOOPT , - [EPROTONOSUPPORT ] =TARGET_EPROTONOSUPPORT , - [ESOCKTNOSUPPORT ] =TARGET_ESOCKTNOSUPPORT , - [EOPNOTSUPP ] =TARGET_EOPNOTSUPP , - [EPFNOSUPPORT ] =TARGET_EPFNOSUPPORT , - [EAFNOSUPPORT ] =TARGET_EAFNOSUPPORT , - [EADDRINUSE ] =TARGET_EADDRINUSE , - [EADDRNOTAVAIL ] =TARGET_EADDRNOTAVAIL , - [ENETDOWN ] =TARGET_ENETDOWN , - [ENETUNREACH ] =TARGET_ENETUNREACH , - [ENETRESET ] =TARGET_ENETRESET , - [ECONNABORTED ] =TARGET_ECONNABORTED , - [ECONNRESET ] =TARGET_ECONNRESET , - [ENOBUFS ] =TARGET_ENOBUFS , - [EISCONN ] =TARGET_EISCONN , - [ENOTCONN ] =TARGET_ENOTCONN , - [EUCLEAN ] =TARGET_EUCLEAN , - [ENOTNAM ] =TARGET_ENOTNAM , - [ENAVAIL ] =TARGET_ENAVAIL , - [EISNAM ] =TARGET_EISNAM , - [EREMOTEIO ] =TARGET_EREMOTEIO , - [EDQUOT ] =TARGET_EDQUOT , - [ESHUTDOWN ] =TARGET_ESHUTDOWN , - [ETOOMANYREFS ] =TARGET_ETOOMANYREFS , - [ETIMEDOUT ] =TARGET_ETIMEDOUT , - [ECONNREFUSED ] =TARGET_ECONNREFUSED , - [EHOSTDOWN ] =TARGET_EHOSTDOWN , - [EHOSTUNREACH ] =TARGET_EHOSTUNREACH , - [EALREADY ] =TARGET_EALREADY , - [EINPROGRESS ] =TARGET_EINPROGRESS , - [ESTALE ] =TARGET_ESTALE , - [ECANCELED ] =TARGET_ECANCELED , - [ENOMEDIUM ] =TARGET_ENOMEDIUM , - [EMEDIUMTYPE ] =TARGET_EMEDIUMTYPE , -#ifdef ENOKEY - [ENOKEY ] =TARGET_ENOKEY , -#endif -#ifdef EKEYEXPIRED - [EKEYEXPIRED ] =TARGET_EKEYEXPIRED , -#endif -#ifdef EKEYREVOKED - [EKEYREVOKED ] =TARGET_EKEYREVOKED , -#endif -#ifdef EKEYREJECTED - [EKEYREJECTED ] =TARGET_EKEYREJECTED , -#endif -#ifdef EOWNERDEAD - [EOWNERDEAD ] =TARGET_EOWNERDEAD , -#endif -#ifdef ENOTRECOVERABLE - [ENOTRECOVERABLE ] =TARGET_ENOTRECOVERABLE , -#endif -#ifdef ENOMSG - [ENOMSG ] =TARGET_ENOMSG , -#endif -#ifdef ERFKILL - [ERFKILL ] =TARGET_ERFKILL , -#endif -#ifdef EHWPOISON - [EHWPOISON ] =TARGET_EHWPOISON , -#endif -}; - -static inline int host_to_target_errno (int err) +static inline int host_to_target_errno (int host_errno) { -if (err >=0 && err <ERRNO_TABLE_SIZE && - host_to_target_errno_table[err]) { -return host_to_target_errno_table[err]; +switch (host_errno) { +#define E (X ) case X: return TARGET_##X; +#include "errnos.c.inc" +#undef E +default : +return host_errno; } -return err; } -static inline int target_to_host_errno (int err) +static inline int target_to_host_errno (int target_errno) { -if (err >=0 && err <ERRNO_TABLE_SIZE && - target_to_host_errno_table[err]) { -return target_to_host_errno_table[err]; +switch (target_errno) { +#define E (X ) case TARGET_##X: return X; +#include "errnos.c.inc" +#undef E +default : +return target_errno; } -return err; }static inline abi_long get_errno (abi_long ret)@@ -7102,7 +6978,6 @@ void syscall_init(void)IOCTLEntry *ie;const argtype *arg_type;int size; -int i;thunk_init (STRUCT_MAX );@@ -7112,12 +6987,6 @@ void syscall_init(void)#undef STRUCT#undef STRUCT_SPECIAL -/* Build target_to_host_errno_table[] table from -* host_to_target_errno_table[]. */ -for (i =0 ; i <ERRNO_TABLE_SIZE ; i++) { - target_to_host_errno_table[host_to_target_errno_table[i]] = i; - } -/* we patch the ioctl size if necessary. We rely on the fact that no ioctl has all the bits at '1' in the size field */ ie = ioctl_entries;linux-user/errnos.c.inc new file +130
-0@@ -0,0 +1,140 @@ +/* + * This list is the union of errno values overridden in asm-<arch>/errno.h + * minus the errnos that are not actually generic to all archs. + * + * Please keep this list sorted alphabetically. + * + * Copyright (c) 2003 Fabrice Bellard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <http://www.gnu.org/licenses/>. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +E(EADDRINUSE) +E(EADDRNOTAVAIL) +E(EADV) +E(EAFNOSUPPORT) +E(EAGAIN) +E(EALREADY) +E(EBADE) +E(EBADFD) +E(EBADMSG) +E(EBADR) +E(EBADRQC) +E(EBADSLT) +E(EBFONT) +E(ECANCELED) +E(ECHRNG) +E(ECOMM) +E(ECONNABORTED) +E(ECONNREFUSED) +E(ECONNRESET) +E(EDEADLK) +E(EDESTADDRREQ) +E(EDOTDOT) +E(EDQUOT) +E(EHOSTDOWN) +E(EHOSTUNREACH) +#ifdef EHWPOISON +E(EHWPOISON) +#endif +E(EIDRM) +E(EILSEQ) +E(EINPROGRESS) +E(EISCONN) +E(EISNAM) +#ifdef EKEYEXPIRED +E(EKEYEXPIRED) +#endif +#ifdef EKEYREJECTED +E(EKEYREJECTED) +#endif +#ifdef EKEYREVOKED +E(EKEYREVOKED) +#endif +E(EL2HLT) +E(EL2NSYNC) +E(EL3HLT) +E(EL3RST) +E(ELIBACC) +E(ELIBBAD) +E(ELIBEXEC) +E(ELIBMAX) +E(ELIBSCN) +E(ELNRNG) +E(ELOOP) +E(EMEDIUMTYPE) +E(EMSGSIZE) +E(EMULTIHOP) +E(ENAMETOOLONG) +E(ENAVAIL) +E(ENETDOWN) +E(ENETRESET) +E(ENETUNREACH) +E(ENOANO) +E(ENOBUFS) +E(ENOCSI) +E(ENODATA) +#ifdef ENOKEY +E(ENOKEY) +#endif +E(ENOLCK) +E(ENOLINK) +E(ENOMEDIUM) +#ifdef ENOMSG +E(ENOMSG) +#endif +E(ENONET) +E(ENOPKG) +E(ENOPROTOOPT) +E(ENOSR) +E(ENOSTR) +E(ENOSYS) +E(ENOTCONN) +E(ENOTEMPTY) +E(ENOTNAM) +#ifdef ENOTRECOVERABLE +E(ENOTRECOVERABLE) +#endif +E(ENOTSOCK) +E(ENOTUNIQ) +E(EOPNOTSUPP) +E(EOVERFLOW) +#ifdef EOWNERDEAD +E(EOWNERDEAD) +#endif +E(EPFNOSUPPORT) +E(EPROTO) +E(EPROTONOSUPPORT) +E(EPROTOTYPE) +E(EREMCHG) +E(EREMOTE) +E(EREMOTEIO) +E(ERESTART) +#ifdef ERFKILL +E(ERFKILL) +#endif +E(ESHUTDOWN) +E(ESOCKTNOSUPPORT)
linux-user/errnos.c.inc line 140
Quoted 10 lines
linux-user/errnos.c.inc new file +10
-0+E(ESRMNT) +E(ESTALE) +E(ESTRPIPE) +E(ETIME) +E(ETIMEDOUT) +E(ETOOMANYREFS) +E(EUCLEAN) +E(EUNATCH) +E(EUSERS) +E(EXFULL)
PATCH v3 8/8 linux-user/syscall: Remove ERRNO_TABLE_SIZE check
In reply to Philippe Mathieu-DaudéNow than target_to_host_errno() always return an errno, we can remove the unused and arbitrary ERRNO_TABLE_SIZE definition.
--- linux-user/syscall.c | 5 ----- 1 file changed, 5 deletions(-)
linux-user/syscall.c +0 -5
@@ -507,8 +507,6 @@ static inline int next_free_host_timer(void) }#endif -#define ERRNO_TABLE_SIZE 1200 -static inline int host_to_target_errno (int host_errno) {switch (host_errno) {
@@ -548,9 +546,6 @@ const char *target_strerror(int err)return "Successful exit from sigreturn" ; } -if ((err >=ERRNO_TABLE_SIZE ) || (err <0 )) { -return NULL ; - }return strerror (target_to_host_errno (err)); }
Signature · 1 line
2.31.1
Re: [PATCH v3 8/8] linux-user/syscall: Remove ERRNO_TABLE_SIZE check
Quoted 8 lines · Philippe Mathieu-Daudé
Now than
target_to_host_errno()always return an errno, we can remove the unused and arbitraryERRNO_TABLE_SIZEdefinition.Suggested-by Richard Henderson<[email protected]>Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- linux-user/syscall.c | 5 ----- 1 file changed, 5 deletions(-)
r~
Re: [PATCH v3 8/8] linux-user/syscall: Remove ERRNO_TABLE_SIZE check
In reply to Philippe Mathieu-DaudéLe 08/07/2021 à 19:05, Philippe Mathieu-Daudé a écrit :
Quoted 24 lines
Now than
target_to_host_errno()always return an errno, we can remove the unused and arbitraryERRNO_TABLE_SIZEdefinition.Suggested-by Richard Henderson <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- linux-user/syscall.c | 5 ----- 1 file changed, 5 deletions(-)linux-user/syscall.c +0
-2@@ -507,8 +507,6 @@ static inline int next_free_host_timer(void) }#endif -#define ERRNO_TABLE_SIZE 1200 -static inline int host_to_target_errno (int host_errno) {switch (host_errno) {
linux-user/syscall.c const char *target_strerror(int err) · line 551
Quoted 9 lines
linux-user/syscall.c +0
-3@@ -548,9 +546,6 @@ const char *target_strerror(int err)return "Successful exit from sigreturn" ; } -if ((err >=ERRNO_TABLE_SIZE ) || (err <0 )) { -return NULL ; - }return strerror (target_to_host_errno (err)); }
Le 08/07/2021 à 19:05, Philippe Mathieu-Daudé a écrit :
Quoted 67 lines
Hi,
This series extract code related to target errno conversion (to/from host) into a separate header.
Since v2:
- addressed Richard / Laurent review comments Since v1:
- addressed Taylor / Richard / Laurent review commentsBased-on: <[email protected]>
Philippe Mathieu-Daudé (8):
linux-user/syscall: Fix RF-kill errno (typo in ERFKILL) linux-user/sparc: Renametarget_errno.h->target_errno_defs.h
linux-user: Extract target errno to 'target_errno_defs.h' linux-user/alpha: Move errno definitions to 'target_errno_defs.h' linux-user/hppa: Move errno definitions to 'target_errno_defs.h' linux-user/mips: Move errno definitions to 'target_errno_defs.h'
linux-user: Simplify host <-> target errno conversion using macros linux-user/syscall: RemoveERRNO_TABLE_SIZEchecklinux-user/aarch64/target_errno_defs.h | 7 + linux-user/alpha/target_errno_defs.h | 204 ++++++++++++++++ linux-user/alpha/target_syscall.h | 194 --------------- linux-user/arm/target_errno_defs.h | 7 + linux-user/cris/target_errno_defs.h | 7 + .../target_errno_defs.h} | 4 +- linux-user/hexagon/target_errno_defs.h | 7 + linux-user/hppa/target_errno_defs.h | 220 +++++++++++++++++ linux-user/hppa/target_syscall.h | 210 ----------------- 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 | 221 ++++++++++++++++++ linux-user/mips/target_syscall.h | 211 ----------------- linux-user/mips64/target_errno_defs.h | 10 + linux-user/mips64/target_syscall.h | 211 ----------------- 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/sh4/target_errno_defs.h | 7 + .../{target_errno.h => target_errno_defs.h} | 11 +- 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 + linux-user/syscall.c | 164 ++----------- linux-user/errnos.c.inc | 140 +++++++++++ linux-user/safe-syscall.S | 2 +- 30 files changed, 926 insertions(+), 985 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 rename linux-user/{errno_defs.h => generic/target_errno_defs.h} (99%) 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
Quoted 9 lines
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
rename linux-user/sparc/{target_errno.h => target_errno_defs.h} (97%)
create mode 100644 linux-user/x86_64/target_errno_defs.h
create mode 100644 linux-user/xtensa/target_errno_defs.h
create mode 100644 linux-user/errnos.c.incSeries applied to my linux-user-for-6.1 branch.
Thanks,
Laurent