[PATCH v1 2/2] riscv: extend support to 32 bit hosts

Dmitry V. Levin ldv at altlinux.org
Sat Feb 6 15:47:50 UTC 2021


On Sat, Feb 06, 2021 at 04:18:25PM +0100, Karol Gugala wrote:
> 64 and 32 bit targets share most of the code.
> The only difference is supported ioctls and syscalls.

Does riscv32 pass the test suite?

> Signed-off-by: Karol Gugala <kgugala at antmicro.com>
> ---
>  configure.ac              | 4 ++++
>  linux/riscv/ioctls_inc0.h | 6 ++++++
>  linux/riscv/syscallent.h  | 8 +++++++-
>  riscv.c                   | 4 ++--
>  4 files changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 74b64089..a9a37fd8 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -152,6 +152,10 @@ riscv64*)
>  	arch=riscv
>  	AC_DEFINE([RISCV64], 1, [Define for the RISC-V 64-bit architecture])
>  	;;
> +riscv32*)
> +	arch=riscv
> +	AC_DEFINE([RISCV32], 1, [Define for the RISC-V 32-bit architecture])
> +	;;
>  s390)
>  	arch=s390
>  	AC_DEFINE([S390], 1, [Define for the S390 architecture.])
> diff --git a/linux/riscv/ioctls_inc0.h b/linux/riscv/ioctls_inc0.h
> index f9939faa..195c8cf9 100644
> --- a/linux/riscv/ioctls_inc0.h
> +++ b/linux/riscv/ioctls_inc0.h
> @@ -1 +1,7 @@
> +#ifdef RISCV64
>  #include "64/ioctls_inc.h"
> +#elif RISCV32
> +#include "32/ioctls_inc.h"
> +#else
> +#error "Unsupported RISC-V bit width"
> +#endif

We prefer different include paths to ifdef'ery, see e.g. powerpc*.


-- 
ldv


More information about the Strace-devel mailing list