diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-07-08 19:05:45 +0200 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2021-07-12 21:53:35 +0200 |
commit | 8f968b6a24aec7de8b1a1b4d2de922adad689297 (patch) | |
tree | 672c47e157f30ffd9ae8cb26b5a07a4d58b55885 /linux-user | |
parent | f007472331068f35e1cf3dca9adb87a4c1df59e8 (diff) |
linux-user: Extract target errno to 'target_errno_defs.h'
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 <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210708170550.1846343-4-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user')
24 files changed, 139 insertions, 7 deletions
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/generic/target_errno_defs.h index aaf5208d62..17d85e0b61 100644 --- a/linux-user/errno_defs.h +++ b/linux-user/generic/target_errno_defs.h @@ -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 */ 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 |