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>
This commit is contained in:
Philippe Mathieu-Daudé 2021-07-08 19:05:45 +02:00 committed by Laurent Vivier
parent f007472331
commit 8f968b6a24
24 changed files with 139 additions and 7 deletions

View File

@ -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

View File

@ -0,0 +1,6 @@
#ifndef ALPHA_TARGET_ERRNO_DEFS_H
#define ALPHA_TARGET_ERRNO_DEFS_H
#include "../generic/target_errno_defs.h"
#endif

View File

@ -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

View File

@ -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

View File

@ -5,8 +5,8 @@
* Taken from asm-generic/errno-base.h and asm-generic/errno.h * Taken from asm-generic/errno-base.h and asm-generic/errno.h
*/ */
#ifndef LINUX_USER_ERRNO_DEFS_H #ifndef GENERIC_TARGET_ERRNO_DEFS_H
#define LINUX_USER_ERRNO_DEFS_H #define GENERIC_TARGET_ERRNO_DEFS_H
#define TARGET_EPERM 1 /* Operation not permitted */ #define TARGET_EPERM 1 /* Operation not permitted */
#define TARGET_ENOENT 2 /* No such file or directory */ #define TARGET_ENOENT 2 /* No such file or directory */

View File

@ -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

View File

@ -0,0 +1,6 @@
#ifndef HPPA_TARGET_ERRNO_DEFS_H
#define HPPA_TARGET_ERRNO_DEFS_H
#include "../generic/target_errno_defs.h"
#endif

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,6 @@
#ifndef MIPS_TARGET_ERRNO_DEFS_H
#define MIPS_TARGET_ERRNO_DEFS_H
#include "../generic/target_errno_defs.h"
#endif

View File

@ -0,0 +1,6 @@
#ifndef MIPS64_TARGET_ERRNO_DEFS_H
#define MIPS64_TARGET_ERRNO_DEFS_H
#include "../generic/target_errno_defs.h"
#endif

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -11,7 +11,7 @@
*/ */
#include "hostdep.h" #include "hostdep.h"
#include "errno_defs.h" #include "target_errno_defs.h"
/* We have the correct host directory on our include path /* We have the correct host directory on our include path
* so that this will pull in the right fragment for the architecture. * so that this will pull in the right fragment for the architecture.

View File

@ -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

View File

@ -1,7 +1,12 @@
#ifndef SPARC_TARGET_ERRNO_DEFS_H #ifndef SPARC_TARGET_ERRNO_DEFS_H
#define 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 #undef TARGET_EWOULDBLOCK
#define TARGET_EWOULDBLOCK TARGET_EAGAIN /* Operation would block */ #define TARGET_EWOULDBLOCK TARGET_EAGAIN /* Operation would block */
#undef TARGET_EINPROGRESS #undef TARGET_EINPROGRESS

View File

@ -1,8 +1,6 @@
#ifndef SPARC_TARGET_SYSCALL_H #ifndef SPARC_TARGET_SYSCALL_H
#define SPARC_TARGET_SYSCALL_H #define SPARC_TARGET_SYSCALL_H
#include "target_errno_defs.h"
#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
struct target_pt_regs { struct target_pt_regs {
abi_ulong u_regs[16]; abi_ulong u_regs[16];

View File

@ -2751,7 +2751,7 @@ struct target_drm_i915_getparam {
#include "socket.h" #include "socket.h"
#include "errno_defs.h" #include "target_errno_defs.h"
#define FUTEX_WAIT 0 #define FUTEX_WAIT 0
#define FUTEX_WAKE 1 #define FUTEX_WAKE 1

View File

@ -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

View File

@ -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