aboutsummaryrefslogtreecommitdiff
path: root/libffi/src
AgeCommit message (Collapse)AuthorFilesLines
2007-12-06n32.S (ffi_closure_N32): Use 64-bit add instruction on pointer values.David Daney1-3/+3
2007-12-06 David Daney <ddaney@avtrex.com> * src/mips/n32.S (ffi_closure_N32): Use 64-bit add instruction on pointer values. From-SVN: r130655
2007-12-01re PR libffi/31937 (libffi doesn't support ppc without FPU)Andreas Tobler4-40/+202
2007-12-01 Andreas Tobler <a.tobler@schweiz.org> PR libffi/31937 * src/powerpc/ffitarget.h: Introduce new ABI FFI_LINUX_SOFT_FLOAT. Add local FFI_TYPE_UINT128 to handle soft-float long-double-128. * src/powerpc/ffi.c: Distinguish between __NO_FPRS__ and not and set the NUM_FPR_ARG_REGISTERS according to. Add support for potential soft-float support under hard-float architecture. (ffi_prep_args_SYSV): Set NUM_FPR_ARG_REGISTERS to 0 in case of FFI_LINUX_SOFT_FLOAT, handle float, doubles and long-doubles according to the FFI_LINUX_SOFT_FLOAT ABI. (ffi_prep_cif_machdep): Likewise. (ffi_closure_helper_SYSV): Likewise. * src/powerpc/ppc_closure.S: Make sure not to store float/double on archs where __NO_FPRS__ is true. Add FFI_TYPE_UINT128 support. * src/powerpc/sysv.S: Add support for soft-float long-double-128. Adjust copyright notice. From-SVN: r130559
2007-11-25closures.c: Move defintion of MAYBE_UNUSED from here to ...Andreas Tobler1-2/+1
2007-11-25 Andreas Tobler <a.tobler@schweiz.org> * src/closures.c: Move defintion of MAYBE_UNUSED from here to ... * include/ffi_common.h: ... here. Update copyright. From-SVN: r130413
2007-11-17sysv.S: Load correct cr to compare if we have long double.Andreas Tobler3-1/+4
2007-11-17 Andreas Tobler <a.tobler@schweiz.org> * src/powerpc/sysv.S: Load correct cr to compare if we have long double. * src/powerpc/linux64.S: Likewise. * src/powerpc/ffi.c: Add a comment to show which part goes into cr6. * testsuite/libffi.call/return_ldl.c: New test. From-SVN: r130247
2007-09-04[multiple changes]Andrew Haley2-22/+79
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-08-10re PR libffi/28313 (libffi has not been ported to mips64-linux-gnu)David Daney4-89/+591
PR libffi/28313 * configure.ac: Don't treat mips64 as a special case. * Makefile.am (nodist_libffi_la_SOURCES): Add n32.S. * configure: Regenerate * Makefile.in: Ditto. * fficonfig.h.in: Ditto. * src/mips/ffitarget.h (REG_L, REG_S, SUBU, ADDU, SRL, LI): Indent. (LA, EH_FRAME_ALIGN, FDE_ADDR_BYTES): New preprocessor macros. (FFI_DEFAULT_ABI): Set for n64 case. (FFI_CLOSURES, FFI_TRAMPOLINE_SIZE): Define for n32 and n64 cases. * src/mips/n32.S (ffi_call_N32): Add debug macros and labels for FDE. (ffi_closure_N32): New function. (.eh_frame): New section * src/mips/o32.S: Clean up comments. (ffi_closure_O32): Pass ffi_closure parameter in $12. * src/mips/ffi.c: Use FFI_MIPS_N32 instead of _MIPS_SIM == _ABIN32 throughout. (FFI_MIPS_STOP_HERE): New, use in place of ffi_stop_here. (ffi_prep_args): Use unsigned long to hold pointer values. Rewrite to support n32/n64 ABIs. (calc_n32_struct_flags): Rewrite. (calc_n32_return_struct_flags): Remove unused variable. Reverse position of flag bits. (ffi_prep_cif_machdep): Rewrite n32 portion. (ffi_call): Enable for n64. Add special handling for small structure return values. (ffi_prep_closure_loc): Add n32 and n64 support. (ffi_closure_mips_inner_O32): Add cast to silence warning. (copy_struct_N32, ffi_closure_mips_inner_N32): New functions. From-SVN: r127336
2007-08-07sysv.S (ffi_closure_raw_SYSV): Fix typo in previous checkin.Andrew Haley1-1/+1
* src/x86/sysv.S (ffi_closure_raw_SYSV): Fix typo in previous checkin. From-SVN: r127271
2007-08-06re PR testsuite/32843 (libffi.call/return_sc.c)Andrew Haley1-0/+8
PR testsuite/32843 * src/x86/sysv.S (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32, FFI_TYPE_SINT32. From-SVN: r127241
2007-07-31re PR testsuite/32843 (libffi.call/return_sc.c)Andrew Haley2-21/+66
2007-07-30 Andrew Haley <aph@redhat.com> PR testsuite/32843 * src/x86/ffi.c (ffi_prep_cif_machdep): in x86 case, add code for signed/unsigned int8/16. * src/x86/sysv.S (ffi_call_SYSV): Rewrite to: Use a jump table. Remove code to pop args from the stack after call. Special-case signed/unsigned int8/16. * testsuite/libffi.call/return_sc.c (main): Revert. From-SVN: r127093
2007-07-12ffi.c: Don't include sys/cachectl.h.David Daney1-3/+2
* src/mips/ffi.c: Don't include sys/cachectl.h. (ffi_prep_closure_loc): Use __builtin___clear_cache() instead of cacheflush(). From-SVN: r126567
2007-07-09[multiple changes]Andrew Haley3-1/+169
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-05-10ffi.c (ffi_prep_incoming_args_SYSV, [...]): New, add closure support.Roman Zippel3-1/+176
* src/m68k/ffi.c (ffi_prep_incoming_args_SYSV, ffi_closure_SYSV_inner,ffi_prep_closure): New, add closure support. * src/m68k/sysv.S(ffi_closure_SYSV,ffi_closure_struct_SYSV): Likewise. * src/m68k/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise. (FFI_CLOSURES): Enable closure support. From-SVN: r124601
2007-05-10configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test.Roman Zippel1-0/+17
* configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test. * configure: Regenerate. * fficonfig.h.in: Regenerate. * src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC, CFI_OFFSET,CFI_DEF_CFA): New macros. (ffi_call_SYSV): Add callframe annotation. From-SVN: r124600
2007-05-10ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix numerous test suite failures.Roman Zippel2-69/+92
* src/m68k/ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix numerous test suite failures. * src/m68k/sysv.S (ffi_call_SYSV): Likewise. From-SVN: r124599
2007-04-13Makefile.am (EXTRA_DIST): Bring up to date.Paolo Bonzini1-2/+0
2007-04-11 Paolo Bonzini <bonzini@gnu.org> * Makefile.am (EXTRA_DIST): Bring up to date. * Makefile.in: Regenerate. * src/frv/eabi.S: Remove RCS keyword. From-SVN: r123776
2007-04-06configure.ac: Tidy target case.Richard Henderson4-21/+68
* configure.ac: Tidy target case. (HAVE_LONG_DOUBLE): Allow the target to override. * configure: Regenerate. * include/ffi.h.in: Don't define ffi_type_foo if LIBFFI_HIDE_BASIC_TYPES is defined. (ffi_type_longdouble): If not HAVE_LONG_DOUBLE, define to ffi_type_double. * types.c (LIBFFI_HIDE_BASIC_TYPES): Define. (FFI_TYPEDEF, ffi_type_void): Mark the data const. (ffi_type_longdouble): Special case for Alpha. Don't define if long double == double. * src/alpha/ffi.c (FFI_TYPE_LONGDOUBLE): Assert unique value. (ffi_prep_cif_machdep): Handle it as the 128-bit type. (ffi_call, ffi_closure_osf_inner): Likewise. (ffi_closure_osf_inner): Likewise. Mark hidden. (ffi_call_osf, ffi_closure_osf): Mark hidden. * src/alpha/ffitarget.h (FFI_LAST_ABI): Tidy definition. * src/alpha/osf.S (ffi_call_osf, ffi_closure_osf): Mark hidden. (load_table): Handle 128-bit long double. * testsuite/libffi.call/float4.c: Add -mieee for alpha. From-SVN: r123622
2007-04-03closures.c: Include sys/statfs.h.Jakub Jelinek1-1/+63
* src/closures.c: Include sys/statfs.h. (_GNU_SOURCE): Define on Linux. (FFI_MMAP_EXEC_SELINUX): Define. (selinux_enabled): New variable. (selinux_enabled_check): New function. (is_selinux_enabled): Define. (dlmmap): Use it. * configure.ac (NO_EXECUTE_PERMISSION): Set by default. * configure: Rebuilt. From-SVN: r123457
2007-03-08ffi.c (flush_icache): Fix left-over from previous patch.Alexandre Oliva1-8/+5
* src/powerpc/ffi.c (flush_icache): Fix left-over from previous patch. (ffi_prep_closure_loc): Remove unneeded casts. Add needed ones. From-SVN: r122692
2007-03-07ffi.h.in (ffi_closure_alloc, [...]): New.Alexandre Oliva19-139/+749
libffi/ChangeLog: * include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New. (ffi_prep_closure_loc): New. (ffi_prep_raw_closure_loc): New. (ffi_prep_java_raw_closure_loc): New. * src/closures.c: New file. * src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment): Replace sflags with exec_offset. [FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset, sub_segment_exec_offset): New macros. (get_segment_flags, set_segment_flags, check_segment_merge): New macros. (is_mmapped_segment, is_extern_segment): Use get_segment_flags. (add_segment, sys_alloc, create_mspace, create_mspace_with_base, destroy_mspace): Use new macros. (sys_alloc): Silence warning. * Makefile.am (libffi_la_SOURCES): Add src/closures.c. * Makefile.in: Rebuilt. * src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in terms of ffi_prep_closure_loc. * src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted from... (ffi_prep_raw_closure): ... this. Re-implement in terms of the renamed version. * src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and adjusted from... (ffi_prep_java_raw_closure): ... this. Re-implement in terms of the renamed version. * src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from (ffi_prep_closure): ... this. * src/pa/ffi.c: Likewise. * src/cris/ffi.c: Likewise. Adjust. * src/frv/ffi.c: Likewise. * src/ia64/ffi.c: Likewise. * src/mips/ffi.c: Likewise. * src/powerpc/ffi_darwin.c: Likewise. * src/s390/ffi.c: Likewise. * src/sh/ffi.c: Likewise. * src/sh64/ffi.c: Likewise. * src/sparc/ffi.c: Likewise. * src/x86/ffi64.c: Likewise. * src/x86/ffi.c: Likewise. (FFI_INIT_TRAMPOLINE): Adjust. (ffi_prep_raw_closure_loc): Renamed and adjusted from... (ffi_prep_raw_closure): ... this. * src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from (ffi_prep_closure): ... this. (flush_icache): Adjust. boehm-gc/ChangeLog: * include/gc.h (GC_REGISTER_FINALIZER_UNREACHABLE): New. (GC_register_finalizer_unreachable): Declare. (GC_debug_register_finalizer_unreachable): Declare. * finalize.c (GC_unreachable_finalize_mark_proc): New. (GC_register_finalizer_unreachable): New. (GC_finalize): Handle it. * dbg_mlc.c (GC_debug_register_finalizer_unreachable): New. (GC_debug_register_finalizer_no_order): Fix whitespace. libjava/ChangeLog: * include/jvm.h (_Jv_ClosureListFinalizer): New. (_Jv_Linker::create_error_method): Adjust. * boehm.cc (_Jv_ClosureListFinalizer): New. * nogc.cc (_Jv_ClosureListFinalizer): New. * java/lang/Class.h (class _Jv_ClosureList): New. (class java::lang::Class): Declare it as friend. * java/lang/natClass.cc (_Jv_ClosureList::releaseClosures): New. (_Jv_ClosureList::registerClousure): New. * include/execution.h (_Jv_ExecutionEngine): Add get_closure_list. (_Jv_CompiledEngine::do_get_closure_list): New. (_Jv_CompiledEngine::_Jv_CompiledEngine): Use it. (_Jv_IndirectCompiledClass): Add closures. (_Jv_IndirectCompiledEngine::get_aux_info): New. (_Jv_IndirectCompiledEngine::do_allocate_field_initializers): Use it. (_Jv_IndirectCompiledEngine::do_get_closure_list): New. (_Jv_IndirectCompiledEngine::_Jv_IndirectCompiledEngine): Use it. (_Jv_InterpreterEngine::do_get_closure_list): Declare. (_Jv_InterpreterEngine::_Jv_InterpreterEngine): Use it. * interpret.cc (FFI_PREP_RAW_CLOSURE): Use _loc variants. (node_closure): Add closure list. (_Jv_InterpMethod::ncode): Add jclass argument. Use ffi_closure_alloc and the separate code pointer. Register the closure for finalization. (_Jv_JNIMethod::ncode): Likewise. (_Jv_InterpreterEngine::do_create_ncode): Pass klass to ncode. (_Jv_InterpreterEngine::do_get_closure_list): New. * include/java-interp.h (_Jv_InterpMethod::ncode): Adjust. (_Jv_InterpClass): Add closures field. (_Jv_JNIMethod::ncode): Adjust. * defineclass.cc (_Jv_ClassReader::handleCodeAttribute): Adjust. (_Jv_ClassReader::handleMethodsEnd): Likewise. * link.cc (struct method_closure): Add closure list. (_Jv_Linker::create_error_method): Add jclass argument. Use ffi_closure_alloc and the separate code pointer. Register the closure for finalization. (_Jv_Linker::link_symbol_table): Remove outdated comment about sharing of otable and atable. Adjust. * java/lang/reflect/natVMProxy.cc (ncode_closure): Add closure list. (ncode): Add jclass argument. Use ffi_closure_alloc and the separate code pointer. Register the closure for finalization. (java::lang::reflect::VMProxy::generateProxyClass): Adjust. * testsuite/libjava.jar/TestClosureGC.java: New. * testsuite/libjava.jar/TestClosureGC.out: New. * testsuite/libjava.jar/TestClosureGC.xfail: New. * testsuite/libjava.jar/TestClosureGC.jar: New. From-SVN: r122652
2007-03-07dlmalloc.c: New file, imported version 2.8.3 of Doug Lea's malloc.Alexandre Oliva1-0/+5061
* src/dlmalloc.c: New file, imported version 2.8.3 of Doug Lea's malloc. From-SVN: r122651
2007-02-13ffi.c (ffi_prep_args, [...]): Add long double handling.Andreas Krebbel1-0/+27
2007-02-13 Andreas Krebbel <krebbel1@de.ibm.com> * src/s390/ffi.c (ffi_prep_args, ffi_prep_cif_machdep, ffi_closure_helper_SYSV): Add long double handling. From-SVN: r121879
2007-02-02linux64.S (ffi_call_LINUX64): Move restore of r2 immediately after bctrl ↵Jakub Jelinek1-2/+5
instruction. * src/powerpc/linux64.S (ffi_call_LINUX64): Move restore of r2 immediately after bctrl instruction. From-SVN: r121498
2006-12-14configure.ac: Add TARGET for x86_64-*-darwin*.Andreas Tobler2-1/+416
2006-12-14 Andreas Tobler <a.tobler@schweiz.org> * configure.ac: Add TARGET for x86_64-*-darwin*. * Makefile.am (nodist_libffi_la_SOURCES): Add rules for 64-bit sources for X86_DARWIN. * src/x86/ffitarget.h: Set trampoline size for x86_64-*-darwin*. * src/x86/darwin64.S: New file for x86_64-*-darwin* support. * configure: Regenerate. * Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. * testsuite/libffi.special/unwindtest_ffi_call.cc: New test case for ffi_call only. From-SVN: r119856
2006-11-01In gcc/: PR 23067Geoffrey Keating1-5/+56
In gcc/: PR 23067 * c-decl.c (start_struct): Don't create self-containing structures. * config/rs6000/rs6000.c (darwin_rs6000_special_round_type_align): New. * config/rs6000/rs6000-protos.h (darwin_rs6000_special_round_type_align): New. * config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Rewrite. (ROUND_TYPE_ALIGN): Use darwin_rs6000_special_round_type_align. In gcc/testsuite/: PR 23067 * gcc.target/powerpc/darwin-abi-3.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-6.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-7.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-8.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-9.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-10.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-11.c: Remove XFAIL. In libobjc/: * encoding.c (darwin_rs6000_special_round_type_align): New. In libffi/: * src/powerpc/ffi_darwin.c (darwin_adjust_aggregate_sizes): New. (ffi_prep_cif_machdep): Call darwin_adjust_aggregate_sizes for Darwin. * testsuite/libffi.call/nested_struct4.c: Remove Darwin XFAIL. * testsuite/libffi.call/nested_struct6.c: Remove Darwin XFAIL. From-SVN: r118365
2006-10-10configure.ac [...]: Set X86_DARWIN symbol and conditional.Paolo Bonzini3-3/+413
2006-10-10 Paolo Bonzini <bonzini@gnu.org> Sandro Tolaini <tolaini@libero.it> * configure.ac [i*86-*-darwin*]: Set X86_DARWIN symbol and conditional. * configure: Regenerated. * Makefile.am (nodist_libffi_la_SOURCES) [X86_DARWIN]: New case. (EXTRA_DIST): Add src/x86/darwin.S. * Makefile.in: Regenerated. * include/Makefile.in: Regenerated. * testsuite/Makefile.in: Regenerated. * src/x86/ffi.c (ffi_prep_cif_machdep) [X86_DARWIN]: Treat like X86_WIN32, and additionally align stack to 16 bytes. * src/x86/darwin.S: New, based on sysv.S. * src/prep_cif.c (ffi_prep_cif) [X86_DARWIN]: Align > 8-byte structs. Co-Authored-By: Sandro Tolaini <tolaini@libero.it> From-SVN: r117602
2006-05-19ffi.c (ffi_prep_args_pa32): Load floating point arguments from stack slot.John David Anglin1-6/+6
* pa/ffi.c (ffi_prep_args_pa32): Load floating point arguments from stack slot. From-SVN: r113901
2006-04-22README: Remove notice about 'Crazy Comments'.Andreas Tobler13-1576/+87
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-13hpux32.S: Correct unwind offset calculation for ffi_closure_pa32.Andreas Tobler2-2/+2
2006-04-13 Andreas Tobler <a.tobler@schweiz.ch> * src/pa/hpux32.S: Correct unwind offset calculation for ffi_closure_pa32. * src/pa/linux.S: Likewise. From-SVN: r112904
2006-04-12Fix IA-64 problems with denorms getting clobbered by type conversions.James E Wilson1-35/+51
PR libgcj/26483 * src/ia64/ffi.c (stf_spill, ldf_fill): Rewrite as macros. (hfa_type_load): Call stf_spill. (hfa_type_store): Call ldf_fill. (ffi_call): Adjust calls to above routines. Add local temps for macro result. From-SVN: r112900
2006-04-05Makefile.am: Add PA_HPUX port.John David Anglin4-236/+765
2006-04-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> Andreas Tobler <a.tobler@schweiz.ch> * Makefile.am: Add PA_HPUX port. * Makefile.in: Regenerate. * include/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. * configure.ac: Add PA_HPUX rules. * configure: Regenerate. * src/pa/ffitarget.h: Rename linux target to PA_LINUX. Add PA_HPUX and PA64_HPUX. Rename FFI_LINUX ABI to FFI_PA32 ABI. (FFI_TRAMPOLINE_SIZE): Define for 32-bit HP-UX targets. (FFI_TYPE_SMALL_STRUCT2): Define. (FFI_TYPE_SMALL_STRUCT4): Likewise. (FFI_TYPE_SMALL_STRUCT8): Likewise. (FFI_TYPE_SMALL_STRUCT3): Redefine. (FFI_TYPE_SMALL_STRUCT5): Likewise. (FFI_TYPE_SMALL_STRUCT6): Likewise. (FFI_TYPE_SMALL_STRUCT7): Likewise. * src/pa/ffi.c (ROUND_DOWN): Delete. (fldw, fstw, fldd, fstd): Use '__asm__'. (ffi_struct_type): Add support for FFI_TYPE_SMALL_STRUCT2, FFI_TYPE_SMALL_STRUCT4 and FFI_TYPE_SMALL_STRUCT8. (ffi_prep_args_LINUX): Rename to ffi_prep_args_pa32. Update comment. Simplify incrementing of stack slot variable. Change type of local 'n' to unsigned int. (ffi_size_stack_LINUX): Rename to ffi_size_stack_pa32. Handle long double on PA_HPUX. (ffi_prep_cif_machdep): Likewise. (ffi_call): Likewise. (ffi_closure_inner_LINUX): Rename to ffi_closure_inner_pa32. Change return type to ffi_status. Simplify incrementing of stack slot variable. Only copy floating point argument registers when PA_LINUX is true. Reformat debug statement. Add support for FFI_TYPE_SMALL_STRUCT2, FFI_TYPE_SMALL_STRUCT4 and FFI_TYPE_SMALL_STRUCT8. (ffi_closure_LINUX): Rename to ffi_closure_pa32. Add 'extern' to declaration. (ffi_prep_closure): Make linux trampoline conditional on PA_LINUX. Add nops to cache flush. Add trampoline for PA_HPUX. * src/pa/hpux32.S: New file. * src/pa/linux.S (ffi_call_LINUX): Rename to ffi_call_pa32. Rename ffi_prep_args_LINUX to ffi_prep_args_pa32. Localize labels. Add support for 2, 4 and 8-byte small structs. Handle unaligned destinations in 3, 5, 6 and 7-byte small structs. Order argument type checks so that common argument types appear first. (ffi_closure_LINUX): Rename to ffi_closure_pa32. Rename ffi_closure_inner_LINUX to ffi_closure_inner_pa32. Co-Authored-By: Andreas Tobler <a.tobler@schweiz.ch> From-SVN: r112719
2006-03-24ffitarget.h (enum ffi_abi): Add FFI_LINUX.Alan Modra5-163/+196
* src/powerpc/ffitarget.h (enum ffi_abi): Add FFI_LINUX. Default for 32-bit using IBM extended double format. Fix FFI_LAST_ABI. * src/powerpc/ffi.c (ffi_prep_args_SYSV): Handle linux variant of FFI_TYPE_LONGDOUBLE. (ffi_prep_args64): Assert using IBM extended double. (ffi_prep_cif_machdep): Don't munge FFI_TYPE_LONGDOUBLE type. Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args. (ffi_call): Handle FFI_LINUX. (ffi_closure_helper_SYSV): Non FFI_LINUX long double return needs gpr3 return pointer as for struct return. Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args. Don't increment "nf" unnecessarily. * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Load both f1 and f2 for FFI_TYPE_LONGDOUBLE. Move epilogue insns into case table. Don't use r6 as pointer to results, instead use sp offset. Don't make a special call to load lr with case table address, instead use offset from previous call. * src/powerpc/sysv.S (ffi_call_SYSV): Save long double return. * src/powerpc/linux64.S (ffi_call_LINUX64): Simplify long double return. From-SVN: r112340
2006-03-15ffi.c (ffi_prep_cif_machdep): Handle float arguments passed with FP ↵Kaz Kojima2-12/+39
registers correctly. * src/sh64/ffi.c (ffi_prep_cif_machdep): Handle float arguments passed with FP registers correctly. (ffi_closure_helper_SYSV): Likewise. * src/sh64/sysv.S: Likewise. From-SVN: r112083
2006-02-22sysv.S: Fix register numbers in the FDE for ffi_closure_SYSV.Kaz Kojima1-5/+5
* src/sh/sysv.S: Fix register numbers in the FDE for ffi_closure_SYSV. From-SVN: r111362
2006-02-18ffi.c (ffi_closure_helper_SYSV): Remove unused variable and cast integer to ↵Kaz Kojima1-3/+4
void * if needed. * src/sh/ffi.c (ffi_closure_helper_SYSV): Remove unused variable and cast integer to void * if needed. Update the pointer to the FP register saved area correctly. From-SVN: r111225
2006-01-18sysv.S (smst_two_register): Don't call __ashldi3, instead do the shifting ↵Jakub Jelinek2-36/+37
inline. * src/powerpc/sysv.S (smst_two_register): Don't call __ashldi3, instead do the shifting inline. * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't compute %r5 shift count unconditionally. Simplify load sequences for 1, 2, 3, 4 and 8 byte structs, for the remaining struct sizes don't call __lshrdi3, instead do the shifting inline. From-SVN: r109879
2005-12-07ffitarget.h: Remove obsolete sgidefs.h include.Thiemo Seufer3-156/+180
2005-12-07 Thiemo Seufer <ths@networkno.de> * src/mips/ffitarget.h: Remove obsolete sgidefs.h include. Add missing parentheses. * src/mips/o32.S (ffi_call_O32): Code formatting. Define and use A3_OFF, FP_OFF, RA_OFF. Micro-optimizations. (ffi_closure_O32): Likewise, but with newly defined A3_OFF2, A2_OFF2, A1_OFF2, A0_OFF2, RA_OFF2, FP_OFF2, S0_OFF2, GP_OFF2, V1_OFF2, V0_OFF2, FA_1_1_OFF2, FA_1_0_OFF2, FA_0_1_OFF2, FA_0_0_OFF2. * src/mips/ffi.c (ffi_prep_args): Code formatting. Fix endianness bugs. (ffi_prep_closure): Improve trampoline instruction scheduling. (ffi_closure_mips_inner_O32): Fix endianness bugs. From-SVN: r108165
2005-12-03ffi.c: Formatting.Alan Modra1-257/+339
* src/powerpc/ffi.c: Formatting. (ffi_prep_args_SYSV): Avoid possible aliasing problems by using unions. (ffi_prep_args64): Likewise. From-SVN: r107963
2005-09-26float1.c (value_type): New typedef.Tom Tromey2-1/+12
* testsuite/libffi.call/float1.c (value_type): New typedef. (CANARY): New define. (main): Check for result buffer overflow. * src/powerpc/linux64.S: Handle linux64 long double returns. * src/powerpc/ffi.c (FLAG_RETURNS_128BITS): New constant. (ffi_prep_cif_machdep): Handle linux64 long double returns. From-SVN: r104660
2005-08-25re PR target/23404 (gij trashes args of functions with more than 8 fp args)Alan Modra1-2/+4
PR target/23404 * src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack homed fp args. (ffi_status ffi_prep_cif_machdep): Correct stack sizing for same. From-SVN: r103462
2005-08-11configure.ac (HAVE_HIDDEN_VISIBILITY_ATTRIBUTE): New test.Jakub Jelinek5-116/+331
* configure.ac (HAVE_HIDDEN_VISIBILITY_ATTRIBUTE): New test. (AH_BOTTOM): Add FFI_HIDDEN definition. * configure: Rebuilt. * fficonfig.h.in: Rebuilt. * src/powerpc/ffi.c (hidden): Remove. (ffi_closure_LINUX64, ffi_prep_args64, ffi_call_LINUX64, ffi_closure_helper_LINUX64): Use FFI_HIDDEN instead of hidden. * src/powerpc/linux64_closure.S (ffi_closure_LINUX64, .ffi_closure_LINUX64): Use FFI_HIDDEN instead of .hidden. * src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): Remove, add FFI_HIDDEN to its prototype. (ffi_closure_SYSV_inner): New. * src/x86/sysv.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. * src/x86/win32.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. From-SVN: r103002
2005-08-09ppc_closure.S (ffi_closure_SYSV): Use DW_CFA_offset_extended_sf rather than ↵Jakub Jelinek2-4/+4
DW_CFA_GNU_negative_offset_extended. * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Use DW_CFA_offset_extended_sf rather than DW_CFA_GNU_negative_offset_extended. * src/powerpc/sysv.S (ffi_call_SYSV): Likewise. From-SVN: r102900
2005-07-22sysv.S (ffi_call_SYSV): Stop argument popping correctly on sh3.SUGIOKA Toshinobu2-40/+68
* src/sh/sysv.S (ffi_call_SYSV): Stop argument popping correctly on sh3. (ffi_closure_SYSV): Change the stack layout for sh3 struct argument. * src/sh/ffi.c (ffi_prep_args): Fix sh3 argument copy, when it is partially on register. (ffi_closure_helper_SYSV): Likewise. (ffi_prep_cif_machdep): Don't set too many cif->flags. From-SVN: r102298
2005-07-20ffi.c (ffi_call): Handle small structures correctly.Kaz Kojima3-54/+106
* src/sh/ffi.c (ffi_call): Handle small structures correctly. Remove empty line. * src/sh64/ffi.c (simple_type): Remove. (return_type): Handle small structures correctly. (ffi_prep_args): Likewise. (ffi_call): Likewise. (ffi_closure_helper_SYSV): Likewise. * src/sh64/sysv.S (ffi_call_SYSV): Handle 1, 2 and 4-byte return. Emit position independent code if PIC and remove wrong datalabel prefixes from EH data. From-SVN: r102210
2005-07-19Makefile.am (nodist_libffi_la_SOURCES): Add POWERPC_FREEBSD.Andreas Tobler4-29/+168
2005-07-19 Andreas Tobler <a.tobler@schweiz.ch> * Makefile.am (nodist_libffi_la_SOURCES): Add POWERPC_FREEBSD. * Makefile.in: Regenerate. * include/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. * configure.ac: Add POWERPC_FREEBSD rules. * configure: Regenerate. * src/powerpc/ffitarget.h: Add POWERPC_FREEBSD rules. (FFI_SYSV_TYPE_SMALL_STRUCT): Define. * src/powerpc/ffi.c: Add flags to handle small structure returns in ffi_call_SYSV. (ffi_prep_cif_machdep): Handle small structures for SYSV 4 ABI. Aka FFI_SYSV. (ffi_closure_helper_SYSV): Likewise. * src/powerpc/ppc_closure.S: Add return types for small structures. * src/powerpc/sysv.S: Add bits to handle small structures for final SYSV 4 ABI From-SVN: r102174
2005-07-06ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1 as ↵Randolph Chung3-34/+84
FFI_TYPE_SMALL_STRUCT3. * src/pa/ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3. Break out handling for 5-7 byte structures. Kill compilation warnings. (ffi_closure_inner_LINUX): Print return values as hex in debug message. Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3. Properly handle 5-7 byte structure returns. * src/pa/ffitarget.h (FFI_TYPE_SMALL_STRUCT1) (FFI_TYPE_SMALL_STRUCT2): Remove. (FFI_TYPE_SMALL_STRUCT3, FFI_TYPE_SMALL_STRUCT5) (FFI_TYPE_SMALL_STRUCT6, FFI_TYPE_SMALL_STRUCT7): Define. * src/pa/linux.S: Mark source file as using PA1.1 assembly. (checksmst1, checksmst2): Remove. (checksmst3): Optimize handling of 3-byte struct returns. (checksmst567): Properly handle 5-7 byte struct returns. From-SVN: r101650
2005-06-15re PR libffi/21943 (O32 libffi.so fails to link on IRIX 6)Rainer Orth2-2/+4
PR libgcj/21943 * src/mips/n32.S: Enforce PIC code. * src/mips/o32.S: Likewise. From-SVN: r100961
2005-06-01ppc_closure.S (ffi_closure_SYSV): Don't use JUMPTARGET to call ↵Alan Modra2-2/+2
ffi_closure_helper_SYSV. * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't use JUMPTARGET to call ffi_closure_helper_SYSV. Append @local instead. * src/powerpc/sysv.S (ffi_call_SYSV): Likewise for ffi_prep_args_SYSV. From-SVN: r100416
2005-05-08re PR libffi/21285 (gij fails to handle NullPointerException exception)Richard Henderson1-45/+49
PR libffi/21285 * src/alpha/osf.S: Update unwind into to match code. From-SVN: r99415
2005-05-04ffi64.c (ffi_prep_cif_machdep): Save sse-used flag in bit 11 of flags.Richard Henderson2-51/+95
* src/x86/ffi64.c (ffi_prep_cif_machdep): Save sse-used flag in bit 11 of flags. (ffi_call): Mask return type field. Pass ssecount to ffi_call_unix64. (ffi_prep_closure): Set carry bit if sse-used flag set. * src/x86/unix64.S (ffi_call_unix64): Add ssecount argument. Only load sse registers if ssecount non-zero. (ffi_closure_unix64): Only save sse registers if carry set on entry. From-SVN: r99257
2005-04-18Makefile.am: Add CRIS support.Simon Posnjak4-0/+652
* Makefile.am: Add CRIS support. * configure.ac: Likewise. * Makefile.in, configure, testsuite/Makefile.in: Regenerate. * src/cris: New directory. * src/cris/ffi.c, src/cris/sysv.S, src/cris/ffitarget.h: New files. * src/prep_cif.c (ffi_prep_cif): Wrap in #ifndef __CRIS__. Co-Authored-By: Hans-Peter Nilsson <hp@axis.com> From-SVN: r98332