qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 3/8] linux-user: Extract target errno to 'target_errno_def


From: Laurent Vivier
Subject: Re: [PATCH v2 3/8] linux-user: Extract target errno to 'target_errno_defs.h'
Date: Thu, 8 Jul 2021 17:25:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

Le 08/07/2021 à 16:11, Philippe Mathieu-Daudé a écrit :
> 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>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  linux-user/aarch64/target_errno_defs.h                   | 6 ++++++
>  linux-user/alpha/target_errno_defs.h                     | 6 ++++++
>  linux-user/arm/target_errno_defs.h                       | 6 ++++++
>  linux-user/cris/target_errno_defs.h                      | 6 ++++++
>  linux-user/{errno_defs.h => generic/target_errno_defs.h} | 4 ++--
>  linux-user/hexagon/target_errno_defs.h                   | 6 ++++++
>  linux-user/hppa/target_errno_defs.h                      | 6 ++++++
>  linux-user/i386/target_errno_defs.h                      | 6 ++++++
>  linux-user/m68k/target_errno_defs.h                      | 6 ++++++
>  linux-user/microblaze/target_errno_defs.h                | 6 ++++++
>  linux-user/mips/target_errno_defs.h                      | 6 ++++++
>  linux-user/mips64/target_errno_defs.h                    | 6 ++++++
>  linux-user/nios2/target_errno_defs.h                     | 6 ++++++
>  linux-user/openrisc/target_errno_defs.h                  | 6 ++++++
>  linux-user/ppc/target_errno_defs.h                       | 6 ++++++
>  linux-user/riscv/target_errno_defs.h                     | 6 ++++++
>  linux-user/s390x/target_errno_defs.h                     | 6 ++++++
>  linux-user/sh4/target_errno_defs.h                       | 6 ++++++
>  linux-user/sparc/target_errno_defs.h                     | 2 ++
>  linux-user/sparc/target_syscall.h                        | 2 --
>  linux-user/syscall_defs.h                                | 2 +-
>  linux-user/x86_64/target_errno_defs.h                    | 6 ++++++
>  linux-user/xtensa/target_errno_defs.h                    | 6 ++++++
>  linux-user/safe-syscall.S                                | 2 +-
>  24 files changed, 120 insertions(+), 6 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.h
> 
> diff --git a/linux-user/aarch64/target_errno_defs.h 
> b/linux-user/aarch64/target_errno_defs.h
> new file mode 100644
> index 00000000000..eee9762ba32
> --- /dev/null
> +++ b/linux-user/aarch64/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef AARCH64_TARGET_ERRNO_DEFS_H
> +#define AARCH64_TARGET_ERRNO_DEFS_H
> +
> +#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 00000000000..54770108c02
> --- /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 00000000000..448cc407662
> --- /dev/null
> +++ b/linux-user/arm/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef ARM_TARGET_ERRNO_DEFS_H
> +#define ARM_TARGET_ERRNO_DEFS_H
> +
> +#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 00000000000..02c040982df
> --- /dev/null
> +++ b/linux-user/cris/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef CRIS_TARGET_ERRNO_DEFS_H
> +#define CRIS_TARGET_ERRNO_DEFS_H
> +
> +#include "../generic/target_errno_defs.h"
> +
> +#endif
> diff --git a/linux-user/errno_defs.h b/linux-user/generic/target_errno_defs.h
> similarity index 99%
> rename from linux-user/errno_defs.h
> rename to linux-user/generic/target_errno_defs.h
> index aaf5208d62d..17d85e0b61b 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 00000000000..0644ae802b4
> --- /dev/null
> +++ b/linux-user/hexagon/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef HEXAGON_TARGET_ERRNO_DEFS_H
> +#define HEXAGON_TARGET_ERRNO_DEFS_H
> +
> +#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 00000000000..d6e9676ce25
> --- /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 00000000000..d34466d583f
> --- /dev/null
> +++ b/linux-user/i386/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef I386_TARGET_ERRNO_DEFS_H
> +#define I386_TARGET_ERRNO_DEFS_H
> +
> +#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 00000000000..91c51b79cdc
> --- /dev/null
> +++ b/linux-user/m68k/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef M68K_TARGET_ERRNO_DEFS_H
> +#define M68K_TARGET_ERRNO_DEFS_H
> +
> +#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 00000000000..7be53eb2365
> --- /dev/null
> +++ b/linux-user/microblaze/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef MICROBLAZE_TARGET_ERRNO_DEFS_H
> +#define MICROBLAZE_TARGET_ERRNO_DEFS_H
> +
> +#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 00000000000..daef95ea703
> --- /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 00000000000..82b0a704f62
> --- /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 00000000000..daceaf30347
> --- /dev/null
> +++ b/linux-user/nios2/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef NIOS2_TARGET_ERRNO_DEFS_H
> +#define NIOS2_TARGET_ERRNO_DEFS_H
> +
> +#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 00000000000..1d32c8798f7
> --- /dev/null
> +++ b/linux-user/openrisc/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef OR1K_TARGET_ERRNO_DEFS_H
> +#define OR1K_TARGET_ERRNO_DEFS_H
> +
> +#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 00000000000..01b25bb5d06
> --- /dev/null
> +++ b/linux-user/ppc/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef PPC_TARGET_ERRNO_DEFS_H
> +#define PPC_TARGET_ERRNO_DEFS_H
> +
> +#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 00000000000..785614ba0a5
> --- /dev/null
> +++ b/linux-user/riscv/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef RISCV_TARGET_ERRNO_DEFS_H
> +#define RISCV_TARGET_ERRNO_DEFS_H
> +
> +#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 00000000000..bca1c3b4a10
> --- /dev/null
> +++ b/linux-user/s390x/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef S390X_TARGET_ERRNO_DEFS_H
> +#define S390X_TARGET_ERRNO_DEFS_H
> +
> +#include "../generic/target_errno_defs.h"
> +
> +#endif
> diff --git a/linux-user/sh4/target_errno_defs.h 
> b/linux-user/sh4/target_errno_defs.h
> new file mode 100644
> index 00000000000..de2de2d3f8d
> --- /dev/null
> +++ b/linux-user/sh4/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef SH4_TARGET_ERRNO_DEFS_H
> +#define SH4_TARGET_ERRNO_DEFS_H
> +
> +#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 e0008109867..416acbb4593 100644
> --- a/linux-user/sparc/target_errno_defs.h
> +++ b/linux-user/sparc/target_errno_defs.h
> @@ -1,6 +1,8 @@
>  #ifndef SPARC_TARGET_ERRNO_DEFS_H
>  #define SPARC_TARGET_ERRNO_DEFS_H
>  
> +#include "../generic/target_errno_defs.h"
> +
>  /* Target errno definitions taken from asm-sparc/errno.h */
>  #undef TARGET_EWOULDBLOCK
>  #define TARGET_EWOULDBLOCK     TARGET_EAGAIN /* Operation would block */
> diff --git a/linux-user/sparc/target_syscall.h 
> b/linux-user/sparc/target_syscall.h
> index dad501d008c..087b39d39c4 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 18b031a2f6a..a5ce487dcc3 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 00000000000..43b4068ba93
> --- /dev/null
> +++ b/linux-user/x86_64/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef X86_64_TARGET_ERRNO_DEFS_H
> +#define X86_64_TARGET_ERRNO_DEFS_H
> +
> +#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 00000000000..7d39e77251c
> --- /dev/null
> +++ b/linux-user/xtensa/target_errno_defs.h
> @@ -0,0 +1,6 @@
> +#ifndef XTENSA_TARGET_ERRNO_DEFS_H
> +#define XTENSA_TARGET_ERRNO_DEFS_H
> +
> +#include "../generic/target_errno_defs.h"
> +
> +#endif
> diff --git a/linux-user/safe-syscall.S b/linux-user/safe-syscall.S
> index b5df6254aea..42ea7c40ba3 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.
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]