Commit c4f17c6f by Ulrich Weigand Committed by Ulrich Weigand

configure.in: Add s390x-*-linux-* target.

	* configure.in: Add s390x-*-linux-* target.
	* configure: Regenerate.
	* include/ffi.h.in: Define S390X for s390x targets.
	(FFI_CLOSURES): Define for s390/s390x.
	(FFI_TRAMPOLINE_SIZE): Likewise.
	(FFI_NATIVE_RAW_API): Likewise.
	* src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390.
	* src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x.
	* src/s390/ffi.c: Major rework of existing code.  Add support for
	s390x targets.  Add closure support.
	* src/s390/sysv.S: Likewise.

From-SVN: r57646
parent b93a0fe6
2002-09-30 Ulrich Weigand <uweigand@de.ibm.com>
* configure.in: Add s390x-*-linux-* target.
* configure: Regenerate.
* include/ffi.h.in: Define S390X for s390x targets.
(FFI_CLOSURES): Define for s390/s390x.
(FFI_TRAMPOLINE_SIZE): Likewise.
(FFI_NATIVE_RAW_API): Likewise.
* src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390.
* src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x.
* src/s390/ffi.c: Major rework of existing code. Add support for
s390x targets. Add closure support.
* src/s390/sysv.S: Likewise.
2002-09-29 Richard Earnshaw <rearnsha@arm.com> 2002-09-29 Richard Earnshaw <rearnsha@arm.com>
* src/arm/sysv.S: Fix typo. * src/arm/sysv.S: Fix typo.
......
...@@ -70,6 +70,7 @@ powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; ...@@ -70,6 +70,7 @@ powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; s390-*-linux-*) TARGET=S390; TARGETDIR=s390;;
s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;;
x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;; x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;;
sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;; sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;;
esac esac
......
...@@ -164,6 +164,12 @@ extern "C" { ...@@ -164,6 +164,12 @@ extern "C" {
#endif #endif
#endif #endif
#ifdef S390
#if defined (__s390x__)
#define S390X
#endif
#endif
#ifndef LIBFFI_ASM #ifndef LIBFFI_ASM
/* ---- Generic type definitions ----------------------------------------- */ /* ---- Generic type definitions ----------------------------------------- */
...@@ -435,6 +441,16 @@ struct ffi_ia64_trampoline_struct { ...@@ -435,6 +441,16 @@ struct ffi_ia64_trampoline_struct {
#define FFI_TRAMPOLINE_SIZE 24 /* see struct below */ #define FFI_TRAMPOLINE_SIZE 24 /* see struct below */
#define FFI_NATIVE_RAW_API 0 #define FFI_NATIVE_RAW_API 0
#elif defined(S390)
#define FFI_CLOSURES 1
#ifdef S390X
#define FFI_TRAMPOLINE_SIZE 32
#else
#define FFI_TRAMPOLINE_SIZE 16
#endif
#define FFI_NATIVE_RAW_API 0
#elif defined(SH) #elif defined(SH)
#define FFI_CLOSURES 1 #define FFI_CLOSURES 1
......
...@@ -103,9 +103,8 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, ...@@ -103,9 +103,8 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif,
/* Perform a sanity check on the return type */ /* Perform a sanity check on the return type */
FFI_ASSERT(ffi_type_test(cif->rtype)); FFI_ASSERT(ffi_type_test(cif->rtype));
/* x86-64 and s390 stack space allocation is handled in prep_machdep. /* x86-64 and s390 stack space allocation is handled in prep_machdep. */
TODO: Disable this for s390 too? */ #if !defined M68K && !defined __x86_64__ && !defined S390
#if !defined M68K && !defined __x86_64__
/* Make space for the return structure pointer */ /* Make space for the return structure pointer */
if (cif->rtype->type == FFI_TYPE_STRUCT if (cif->rtype->type == FFI_TYPE_STRUCT
#ifdef SPARC #ifdef SPARC
...@@ -124,8 +123,7 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, ...@@ -124,8 +123,7 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif,
if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK))
return FFI_BAD_TYPEDEF; return FFI_BAD_TYPEDEF;
/* TODO: Disable this calculation for s390 too? */ #if !defined __x86_64__ && !defined S390
#ifndef __x86_64__
#ifdef SPARC #ifdef SPARC
if (((*ptr)->type == FFI_TYPE_STRUCT if (((*ptr)->type == FFI_TYPE_STRUCT
&& ((*ptr)->size > 16 || cif->abi != FFI_V9)) && ((*ptr)->size > 16 || cif->abi != FFI_V9))
......
...@@ -42,7 +42,7 @@ FFI_INTEGRAL_TYPEDEF(uint32, 4, 4, FFI_TYPE_UINT32); ...@@ -42,7 +42,7 @@ FFI_INTEGRAL_TYPEDEF(uint32, 4, 4, FFI_TYPE_UINT32);
FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32); FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32);
FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT); FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT);
#if defined ALPHA || defined SPARC64 || defined X86_64 #if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X
FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER); FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment