Commit Graph

14 Commits

Author SHA1 Message Date
John David Anglin 5961d13d27 ffi.c (ffi_struct_type): Put type declaration on separate line.
* src/pa/ffi.c (ffi_struct_type): Put type declaration on separate line.
	(ffi_prep_args_pa32): Likewise.
	(ffi_size_stack_pa32): Likewise.
	(ffi_prep_cif_machdep): Likewise.
	(ffi_call): Likewise.  Rename to ffi_call_int.  Add closure argument
	and update call to ffi_call_pa32.
	(ffi_call, ffi_call_go, ffi_prep_go_closure): New.
	(ffi_closure_inner_pa32): Update to handle go closures.
	* src/pa/ffitarget.h (FFI_GO_CLOSURES): Define.
	* src/pa/hpux32.S (ffi_call_pa32): Pass go closure argument in static
	chain register (%ret1).
	(ffi_closure_pa32): Set closure type argument to zero.
	(ffi_go_closure_pa32): New function.  Add unwind data for it.
	* src/pa/linux.S: Likewise.  Use cfi directives for unwind data.
	* testsuite/libffi.go/static-chain.h (STATIC_CHAIN_REG): Define for
	hppa.

From-SVN: r239978
2016-09-04 17:39:05 +00:00
Richard Henderson b1760f7f91 Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16
From-SVN: r219477
2015-01-12 08:19:59 -08:00
Anthony Green 34fa7690ac Merge upstream libffi
From-SVN: r184897
2012-03-04 21:11:09 +00:00
John David Anglin f93a40eaa3 ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE type on HP-UX.
* src/pa/ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE
	type on HP-UX.

From-SVN: r155205
2009-12-14 02:42:18 +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
Alexandre Oliva 18fa3240db ffi.h.in (ffi_closure_alloc, [...]): New.
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-07 07:27:25 +00:00
John David Anglin 84e2e37098 ffi.c (ffi_prep_args_pa32): Load floating point arguments from stack slot.
* pa/ffi.c (ffi_prep_args_pa32): Load floating point arguments from
	stack slot.

From-SVN: r113901
2006-05-19 01:20:22 +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
Andreas Tobler b721158568 hpux32.S: Correct unwind offset calculation for ffi_closure_pa32.
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-13 00:56:19 +02:00
John David Anglin e6c300efaa Makefile.am: Add PA_HPUX port.
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-04-05 23:26:34 +02:00
Randolph Chung b65da30441 ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1 as 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-07-06 03:37:20 +00:00
Matthias Klose 14b078a8f3 linux.S: Fix typo.
2004-03-20  Matthias Klose  <doko@debian.org>

        * src/pa/linux.S: Fix typo.

From-SVN: r79739
2004-03-20 11:58:01 +00:00
Matthias Klose d65a810fe4 [multiple changes]
2004-03-19  Matthias Klose  <doko@debian.org>

        * Makefile.am: Update
        * Makefile.in: Regenerate.
        * src/pa/ffi.h.in: Remove.
        * src/pa/ffitarget.h: New file.

2004-02-10  Randolph Chung  <tausq@debian.org>

        * Makefile.am: Add PA support.
        * Makefile.in: Regenerate.
        * include/Makefile.in: Regenerate.
        * configure.ac: Add PA target.
        * configure: Regenerate.
        * src/pa/ffi.c: New file.
        * src/pa/ffi.h.in: Add PA support.
        * src/pa/linux.S: New file.
        * prep_cif.c: Add PA support.

From-SVN: r79702
2004-03-19 22:34:17 +00:00