Commit Graph

23 Commits

Author SHA1 Message Date
Anthony Green b4b575ce78 libffi merge
From-SVN: r194722
2012-12-26 16:28:02 +00:00
Anthony Green 34fa7690ac Merge upstream libffi
From-SVN: r184897
2012-03-04 21:11:09 +00:00
Andrew Haley 4ac9cf2b5d ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly instructions.
2011-08-25  Andrew Haley  <aph@redhat.com>

        * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly
        instructions.
        * src/arm/sysv.S (ffi_arm_trampoline): Put them here instead.

From-SVN: r178060
2011-08-25 10:37:36 +00:00
Andrew Haley 4d4a9b72be ffi.c (FFI_INIT_TRAMPOLINE): Clear icache.
2011-07-11  Andrew Haley  <aph@redhat.com>

        * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Clear icache.

From-SVN: r176172
2011-07-11 17:50:04 +00:00
Chung-Lin Tang fac6806566 sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive.
2010-12-03  Chung-Lin Tang  <cltang@codesourcery.com>

	* src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive.
	(ffi_closure_VFP): Same.
	(ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp'
	directive.

From-SVN: r167434
2010-12-03 16:15:26 +00:00
Chung-Lin Tang 46e0720d66 Add ARM VFP ABI support to libffi.
From-SVN: r166032
2010-10-28 18:11:11 +00:00
Matthias Klose 694d3cfd60 sysv.S (__ARM_ARCH__): Define for processor __ARM_ARCH_7EM__.
2010-02-15  Matthias Klose  <doko@ubuntu.com>

        * src/arm/sysv.S (__ARM_ARCH__): Define for processor
        __ARM_ARCH_7EM__.

From-SVN: r156771
2010-02-15 15:19:30 +00:00
Matthias Klose 29d1370a8f PR libffi/40242, PR libffi/41443
2009-09-23  Matthias Klose  <doko@ubuntu.com>

        PR libffi/40242, PR libffi/41443
        * src/arm/sysv.S (__ARM_ARCH__): Define for processors
        __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__,
        __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__.
        Change the conditionals to __SOFTFP__ || __ARM_EABI__
        for -mfloat-abi=softfp to work.

From-SVN: r152075
2009-09-23 14:50:35 +00:00
Andrew Haley 7446546ab0 [multiple changes]
2009-06-04  Andrew Haley  <aph@redhat.com>

	* src/powerpc/ppc_closure.S: Insert licence header.
	* src/powerpc/linux64_closure.S: Likewise.
	* src/m68k/sysv.S: Likewise.

	* src/sh64/ffi.c: Change void (*)() to void (*)(void).
	* src/powerpc/ffi.c: Likewise.
	* src/powerpc/ffi_darwin.c: Likewise.
	* src/m32r/ffi.c: Likewise.
	* src/sh64/ffi.c: Likewise.
	* src/x86/ffi64.c: Likewise.
	* src/alpha/ffi.c: Likewise.
	* src/alpha/osf.S: Likewise.
	* src/frv/ffi.c: Likewise.
	* src/s390/ffi.c: Likewise.
	* src/pa/ffi.c: Likewise.
	* src/pa/hpux32.S: Likewise.
	* src/ia64/unix.S: Likewise.
	* src/ia64/ffi.c: Likewise.
	* src/sparc/ffi.c: Likewise.
	* src/mips/ffi.c: Likewise.
	* src/sh/ffi.c: Likewise.

2008-02-15  David Daney  <ddaney@avtrex.com>

        * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
        Define (conditionally), and use it to include cachectl.h.
        (ffi_prep_closure_loc): Fix cache flushing.
        * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.

From-SVN: r148172
2009-06-04 15:43:03 +00:00
Andrew Haley 5f933ef0d8 2009-06-04 Andrew Haley <aph@redhat.com>
include/ffi.h.in,
        src/arm/ffitarget.h,
        src/arm/ffi.c,
        src/arm/sysv.S,
        src/powerpc/ffitarget.h,
        src/closures.c,
        src/sh64/ffitarget.h,
        src/sh64/ffi.c,
        src/sh64/sysv.S,
        src/types.c,
        src/x86/ffi64.c,
        src/x86/ffitarget.h,
        src/x86/win32.S,
        src/x86/darwin.S,
        src/x86/ffi.c,
        src/x86/sysv.S,
        src/x86/unix64.S,
        src/alpha/ffitarget.h,
        src/alpha/ffi.c,
        src/alpha/osf.S,
        src/m68k/ffitarget.h,
        src/frv/ffitarget.h,
        src/frv/ffi.c,
        src/s390/ffitarget.h,
        src/s390/sysv.S,
        src/cris/ffitarget.h,
        src/pa/linux.S,
        src/pa/ffitarget.h,
        src/pa/ffi.c,
        src/raw_api.c,
        src/ia64/ffitarget.h,
        src/ia64/unix.S,
        src/ia64/ffi.c,
        src/ia64/ia64_flags.h,
        src/java_raw_api.c,
        src/debug.c,
        src/sparc/v9.S,
        src/sparc/ffitarget.h,
        src/sparc/ffi.c,
        src/sparc/v8.S,
        src/mips/ffitarget.h,
        src/mips/n32.S,
        src/mips/o32.S,
        src/mips/ffi.c,
        src/prep_cif.c,
        src/sh/ffitarget.h,
        src/sh/ffi.c,
        src/sh/sysv.S: Update license text.

From-SVN: r148171
2009-06-04 15:11:12 +00:00
Matthias Klose feb5153085 [multiple changes]
2008-03-26  Daniel Jacobowitz  <dan@debian.org>

        * src/arm/sysv.S: Fix ARM comment marker.

2008-03-26  Jakub Jelinek  <jakub@redhat.com>

        * src/alpha/osf.S: Add .note.GNU-stack on Linux.
        * src/s390/sysv.S: Likewise.
        * src/powerpc/ppc_closure.S: Likewise.
        * src/powerpc/sysv.S: Likewise.
        * src/x86/unix64.S: Likewise.
        * src/x86/sysv.S: Likewise.
        * src/sparc/v8.S: Likewise.
        * src/sparc/v9.S: Likewise.
        * src/m68k/sysv.S: Likewise.
        * src/arm/sysv.S: Likewise.

From-SVN: r133594
2008-03-26 08:24:42 +00:00
Andrew Haley cb642590f3 [multiple changes]
2007-09-04    <aph@redhat.com>

	* src/arm/sysv.S (UNWIND): New.
	(Whole file): Conditionally compile unwinder directives.
	* src/arm/sysv.S: Add unwinder directives.

	* src/arm/ffi.c (ffi_prep_args): Align structs by at least 4 bytes.
	Only treat r0 as a struct address if we're actually returning a
	struct by address.
	Only copy the bytes that are actually within a struct.
	(ffi_prep_cif_machdep): A Composite Type not larger than 4 bytes
	is returned in r0, not passed by address.
	(ffi_call): Allocate a word-sized temporary for the case where
	a composite is returned in r0.
	(ffi_prep_incoming_args_SYSV): Align as necessary.

2007-08-05  Steven Newbury  <s_j_newbury@yahoo.co.uk>

	* src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Use __clear_cache instead of 
	directly using the sys_cacheflush syscall.

2007-07-27  Andrew Haley  <aph@redhat.com>

	* src/arm/sysv.S (ffi_closure_SYSV): Add soft-float.

From-SVN: r128093
2007-09-04 17:52:45 +00:00
Andrew Haley 0959e2b887 [multiple changes]
2007-05-18  Aurelien Jarno  <aurelien@aurel32.net>

	* src/arm/ffi.c (ffi_prep_closure_loc): Renamed and ajusted
	from (ffi_prep_closure): ... this.
	(FFI_INIT_TRAMPOLINE): Adjust.

2005-12-31  Phil Blundell  <pb@reciva.com>

	* src/arm/ffi.c (ffi_prep_incoming_args_SYSV, 
        ffi_closure_SYSV_inner, ffi_prep_closure): New, add closure support.
	* src/arm/sysv.S(ffi_closure_SYSV): Likewise.
	* src/arm/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise.
	(FFI_CLOSURES): Enable closure support.

2007-07-03  Andrew Haley  <aph@hedges.billgatliff.com>

        * testsuite/libffi.call/cls_multi_ushort.c,
        testsuite/libffi.call/cls_align_uint16.c,
        testsuite/libffi.call/nested_struct1.c,
        testsuite/libffi.call/nested_struct3.c,
        testsuite/libffi.call/cls_7_1_byte.c,
        testsuite/libffi.call/cls_double.c,
        testsuite/libffi.call/nested_struct5.c,
        testsuite/libffi.call/nested_struct7.c,
        testsuite/libffi.call/cls_sint.c,
        testsuite/libffi.call/nested_struct9.c,
        testsuite/libffi.call/cls_20byte1.c,
        testsuite/libffi.call/cls_multi_sshortchar.c,
        testsuite/libffi.call/cls_align_sint64.c,
        testsuite/libffi.call/cls_3byte2.c,
        testsuite/libffi.call/cls_multi_schar.c,
        testsuite/libffi.call/cls_multi_uchar.c,
        testsuite/libffi.call/cls_19byte.c,
        testsuite/libffi.call/cls_9byte1.c,
        testsuite/libffi.call/cls_align_float.c,
        testsuite/libffi.call/closure_fn1.c,
        testsuite/libffi.call/problem1.c,
        testsuite/libffi.call/closure_fn3.c,
        testsuite/libffi.call/cls_sshort.c,
        testsuite/libffi.call/closure_fn5.c,
        testsuite/libffi.call/cls_align_double.c,
        testsuite/libffi.call/cls_2byte.c,
        testsuite/libffi.call/nested_struct.c,
        testsuite/libffi.call/nested_struct10.c,
        testsuite/libffi.call/cls_4byte.c,
        testsuite/libffi.call/cls_6byte.c,
        testsuite/libffi.call/cls_8byte.c,
        testsuite/libffi.call/cls_multi_sshort.c,
        testsuite/libffi.call/cls_align_uint32.c,
        testsuite/libffi.call/cls_align_sint16.c,
        testsuite/libffi.call/cls_float.c,
        testsuite/libffi.call/cls_20byte.c,
        testsuite/libffi.call/cls_5_1_byte.c,
        testsuite/libffi.call/nested_struct2.c,
        testsuite/libffi.call/cls_24byte.c,
        testsuite/libffi.call/nested_struct4.c,
        testsuite/libffi.call/nested_struct6.c,
        testsuite/libffi.call/cls_64byte.c,
        testsuite/libffi.call/nested_struct8.c,
        testsuite/libffi.call/cls_uint.c,
        testsuite/libffi.call/cls_multi_ushortchar.c,
        testsuite/libffi.call/cls_schar.c,
        testsuite/libffi.call/cls_uchar.c,
        testsuite/libffi.call/cls_align_uint64.c,
        testsuite/libffi.call/cls_ulonglong.c,
        testsuite/libffi.call/cls_align_longdouble.c,
        testsuite/libffi.call/cls_1_1byte.c,
        testsuite/libffi.call/cls_12byte.c,
        testsuite/libffi.call/cls_3_1byte.c,
        testsuite/libffi.call/cls_3byte1.c,
        testsuite/libffi.call/cls_4_1byte.c,
        testsuite/libffi.call/cls_6_1_byte.c,
        testsuite/libffi.call/cls_16byte.c,
        testsuite/libffi.call/cls_18byte.c,
        testsuite/libffi.call/closure_fn0.c,
        testsuite/libffi.call/cls_9byte2.c,
        testsuite/libffi.call/closure_fn2.c,
        testsuite/libffi.call/closure_fn4.c,
        testsuite/libffi.call/cls_ushort.c,
        testsuite/libffi.call/closure_fn6.c,
        testsuite/libffi.call/cls_5byte.c,
        testsuite/libffi.call/cls_align_pointer.c,
        testsuite/libffi.call/cls_7byte.c,
        testsuite/libffi.call/cls_align_sint32.c,
        testsuite/libffi.special/unwindtest_ffi_call.cc,
        testsuite/libffi.special/unwindtest.cc: Enable for ARM.

From-SVN: r126489
2007-07-09 17:33:46 +00:00
Andreas Tobler ac6ed182ed README: Remove notice about 'Crazy Comments'.
2006-04-22  Andreas Tobler  <a.tobler@schweiz.ch>

	* README: Remove notice about 'Crazy Comments'.
	* src/debug.c: Remove lint directives. Cleanup white spaces.
	* src/java_raw_api.c: Likewise.
	* src/prep_cif.c: Likewise.
	* src/raw_api.c: Likewise.
	* src/ffitest.c: Delete. No longer needed, all test cases migrated
	to the testsuite.
	* src/arm/ffi.c: Remove lint directives.
	* src/m32r/ffi.c: Likewise.
	* src/pa/ffi.c: Likewise.
	* src/powerpc/ffi.c: Likewise.
	* src/powerpc/ffi_darwin.c: Likewise.
	* src/sh/ffi.c: Likewise.
	* src/sh64/ffi.c: Likewise.
	* src/x86/ffi.c: Likewise.
	* testsuite/libffi.call/float2.c: Likewise.
	* testsuite/libffi.call/promotion.c: Likewise.
	* testsuite/libffi.call/struct1.c: Likewise.

From-SVN: r113181
2006-04-22 23:17:35 +02:00
Richard Earnshaw f20459f1b2 ffi.c (ffi_prep_cif_machdep): Handle functions that return long long values.
* src/arm/ffi.c (ffi_prep_cif_machdep): Handle functions that return
long long values.  Round stack allocation to a multiple of 8 bytes
for ATPCS compatibility.
* src/arm/sysv.S (ffi_call_SYSV): Rework to avoid use of APCS register
names.  Handle returning long long types.  Add Thumb and interworking
support.  Improve soft-float code.

From-SVN: r89681
2004-10-27 15:10:22 +00:00
Andreas Tobler c5a4ab3a8b commit missing adds.
From-SVN: r72767
2003-10-21 21:07:52 +02:00
Andreas Tobler 1450eb7a07 [multiple changes]
2003-10-21  Andreas Tobler  <a.tobler@schweiz.ch>

	* configure.in: AC_LINK_FILES(ffitarget.h).
	* configure: Regenerate.
	* Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.
	* fficonfig.h.in: Likewise.

2003-10-21  Paolo Bonzini  <bonzini@gnu.org>
	    Richard Henderson  <rth@redhat.com>

	Avoid that ffi.h includes fficonfig.h.

	* Makefile.am (EXTRA_DIST): Include ffitarget.h files
	(TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
	(TARGET_SRC_MIPS_SGI): Removed.
	(MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
	(MIPS_SGI): Removed.
	(CLEANFILES): Removed.
	(mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New
	targets.
	* acconfig.h: Removed.
	* configure.in: Compute sizeofs only for double and long double.
	Use them to define and subst HAVE_LONG_DOUBLE.  Include comments
	into AC_DEFINE instead of using acconfig.h.  Create
	include/ffitarget.h instead of include/fficonfig.h.  Rename
	MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree.
	AC_DEFINE EH_FRAME_FLAGS.
	* include/Makefile.am (DISTCLEANFILES): New automake macro.
	(hack_DATA): Add ffitarget.h.
	* include/ffi.h.in: Remove all system specific definitions.
	Declare raw API even if it is not installed, why bother?
	Use limits.h instead of SIZEOF_* to define ffi_type_*.  Do
	not define EH_FRAME_FLAGS, it is in fficonfig.h now.  Include
	ffitarget.h instead of fficonfig.h.  Remove ALIGN macro.
	(UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead.
	* include/ffi_common.h (bool): Do not define.
	(ffi_assert): Accept failed assertion.
	(ffi_type_test): Return void and accept file/line.
	(FFI_ASSERT): Pass stringized failed assertion.
	(FFI_ASSERT_AT): New macro.
	(FFI_ASSERT_VALID_TYPE): New macro.
	(UINT8, SINT8, UINT16, SINT16, UINT32, SINT32,
	UINT64, SINT64): Define here with gcc's __attribute__ macro
	instead of in ffi.h
	(FLOAT32, ALIGN): Define here instead of in ffi.h
	* include/ffi-mips.h: Removed.  Its content moved to
	src/mips/ffitarget.h after separating assembly and C sections.
	* src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c
	src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c,
	src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S,
	src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c:
	SIZEOF_ARG -> FFI_SIZEOF_ARG.
	* src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+).
	* src/debug.c (ffi_assert): Accept stringized failed assertion.
	(ffi_type_test): Rewritten.
	* src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call
	FFI_ASSERT_VALID_TYPE.
	* src/alpha/ffitarget.h, src/arm/ffitarget.h,
	src/ia64/ffitarget.h, src/m68k/ffitarget.h,
	src/mips/ffitarget.h, src/powerpc/ffitarget.h,
	src/s390/ffitarget.h, src/sh/ffitarget.h,
	src/sh64/ffitarget.h, src/sparc/ffitarget.h,
	src/x86/ffitarget.h: New files.
	* src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S,
	src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S,
	src/powerpc/aix.S, src/powerpc/darwin.S,
	src/powerpc/ffi_darwin.c, src/powerpc/linux64.S,
	src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S,
	src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S,
	src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S,
	src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S:
	include fficonfig.h

From-SVN: r72766
2003-10-21 21:01:58 +02:00
Richard Earnshaw d7b5262524 * src/arm/sysv.S: Fix typo.
From-SVN: r57627
2002-09-29 18:08:58 +00:00
Richard Earnshaw 28165e22cd sysv.S: If we don't have machine/asm.h and the pre-processor has defined...
* src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor
has defined __USER_LABEL_PREFIX__, then use it in CNAME.
(ffi_call_SYSV): Handle soft-float.

From-SVN: r57609
2002-09-28 12:09:27 +00:00
Bo Thorsen c94974caed [multiple changes]
2002-07-16  Bo Thorsen  <bo@suse.de>

	* src/x86/ffi64.c: New file that adds x86-64 support.
	* src/x86/unix64.S: New file that handles argument setup for
	x86-64.
	* src/x86/sysv.S: Don't use this on x86-64.
	* src/x86/ffi.c: Don't use this on x86-64.
	Remove unused vars.
	* src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation
	for x86-64.
	* src/ffitest.c (struct6): New test that tests a special case in
	the x86-64 ABI.
	(struct7): Likewise.
	(struct8): Likewise.
	(struct9): Likewise.
	(closure_test_fn): Silence warning about this when it's not used.
	(main): Add the new tests.
	(main): Fix a couple of wrong casts and silence some compiler warnings.
	* include/ffi.h.in: Add x86-64 ABI definition.
	* fficonfig.h.in: Regenerate.
	* Makefile.am: Add x86-64 support.
	* configure.in: Likewise.
	* Makefile.in: Regenerate.
	* configure: Likewise.

2002-06-24  Bo Thorsen  <bo@suse.de>

	* src/types.c: Merge settings for similar architectures.
	Add x86-64 sizes and alignments.

2002-06-23  Bo Thorsen  <bo@suse.de>

	* src/arm/ffi.c (ffi_prep_args): Remove unused vars.
	* src/sparc/ffi.c (ffi_prep_args_v8): Likewise.
	* src/mips/ffi.c (ffi_prep_args): Likewise.
	* src/m68k/ffi.c (ffi_prep_args): Likewise.

From-SVN: r55571
2002-07-19 01:08:31 +02:00
Nick Clifton 4d2cf7156f Remove RCS ident strings to allow comparisions with multiple source checkouts to work
From-SVN: r40195
2001-03-02 22:21:24 +00:00
Scott Bambrough 7f8c11d571 sysv.S (ffi_call_SYSV): Doubles are not saved to memory correctly.
2000-05-11  Scott Bambrough  <scottb@netwinder.org>

	* libffi/src/arm/sysv.S (ffi_call_SYSV): Doubles are not saved to
	memory correctly.  Use conditional instructions, not branches where
	possible.

From-SVN: r33852
2000-05-11 18:16:37 +00:00
Anthony Green 63e5e3e0db Initial revision
From-SVN: r28593
1999-08-08 13:27:18 +00:00