From a1bc34c0a7929130577e4c9dd418845674dd35c3 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Wed, 16 Mar 2016 21:53:20 +0000 Subject: [PATCH] Add support for s390[x]. Signed-off-by: Dimitri John Ledkov Signed-off-by: Richard Yao Signed-off-by: Brian Behlendorf Closes #4425 --- lib/libefi/rdwr_efi.c | 2 +- lib/libspl/include/sys/isa_defs.h | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/libefi/rdwr_efi.c b/lib/libefi/rdwr_efi.c index 6995463cf7..a914c0df08 100644 --- a/lib/libefi/rdwr_efi.c +++ b/lib/libefi/rdwr_efi.c @@ -154,7 +154,7 @@ struct dk_map2 default_vtoc_map[NDKMAP] = { #if defined(_SUNOS_VTOC_16) #if defined(i386) || defined(__amd64) || defined(__arm) || \ - defined(__powerpc) || defined(__sparc) + defined(__powerpc) || defined(__sparc) || defined(__s390__) { V_BOOT, V_UNMNT }, /* i - 8 */ { V_ALTSCTR, 0 }, /* j - 9 */ diff --git a/lib/libspl/include/sys/isa_defs.h b/lib/libspl/include/sys/isa_defs.h index 60c6a3bf96..61f4cd96a9 100644 --- a/lib/libspl/include/sys/isa_defs.h +++ b/lib/libspl/include/sys/isa_defs.h @@ -157,7 +157,22 @@ extern "C" { #endif #endif -#else /* Currently x86_64, i386, arm, powerpc, and sparc are supported */ +/* s390 arch specific defines */ +#elif defined(__s390__) +#if defined(__s390x__) +#if !defined(_LP64) +#define _LP64 +#endif +#else +#if !defined(_ILP32) +#define _ILP32 +#endif +#endif + +#define _BIG_ENDIAN +#define _SUNOS_VTOC_16 + +#else /* Currently x86_64, i386, arm, powerpc, s390, and sparc are supported */ #error "Unsupported ISA type" #endif