2003-10-22 David Daney <ddaney@avtrex.com>
* src/mips/ffitarget.h: Replace undefined UINT32 and friends with
__attribute__((__mode__(__SI__))) and friends.
From-SVN: r72802
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-01 Andreas Tobler <a.tobler@schweiz.ch>
* testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_64 for
SPARC64. Cleanup whitespaces.
From-SVN: r71982
2003-09-18 Andreas Tobler <a.tobler@schweiz.ch>
David Edelsohn <edelsohn@gnu.org>
* src/types.c (double): Add AIX and Darwin to the right TYPEDEF.
* src/powerpc/aix_closure.S: Remove the pointer to the outgoing
parameter stack.
* src/powerpc/darwin_closure.S: Likewise.
* src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures
according to the Darwin/AIX ABI.
(ffi_prep_cif_machdep): Likewise.
(ffi_closure_helper_DARWIN): Likewise.
Remove the outgoing parameter stack logic. Simplify the evaluation
of the different CASE types.
(ffi_prep_clousure): Avoid the casts on lvalues. Change the branch
statement in the trampoline code.
Co-Authored-By: David Edelsohn <edelsohn@gnu.org>
From-SVN: r71530
* src/sh/ffi.c (ffi_prep_args): Take account into the alignement
for the register size.
(ffi_closure_helper_SYSV): Handle the structure return value
address correctly.
(ffi_closure_helper_SYSV): Return the appropriate type when
the registers are used for the structure return value.
* src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for
the 64-bit return value. Update copyright years.
From-SVN: r71521
* src/types.c (double, longdouble): Merge identical SH and ARM
typedefs, and add POWERPC64.
* src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for
struct split over gpr and rest.
(ffi_prep_cif_machdep): Correct intarg_count for structures.
* src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets.
From-SVN: r71295
2003-08-30 Andreas Tobler <a.tobler@schweiz.ch>
* src/java_raw_api.c: Include <stdlib.h> to fix compiler warning
about implicit declaration of abort().
From-SVN: r71071
* src/powerpc/ffi.c (ffi_prep_args64): Modify for changed gcc
structure passing.
(ffi_closure_helper_LINUX64): Likewise.
* src/powerpc/linux64.S: Remove code writing to parm save area.
* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Use return
address in lr from ffi_closure_helper_LINUX64 call to calculate
table address. Optimize function tail.
From-SVN: r70050
2003-07-28 Andreas Tobler <a.tobler@schweiz.ch>
* src/sparc/ffi.c: Handle all floating point registers.
* src/sparc/v9.S: Likewise. Fixes second part of PR target/11410.
From-SVN: r69951
* configure.in (HAVE_RO_EH_FRAME): Check whether .eh_frame section
should be read-only.
* configure: Rebuilt.
* fficonfig.h.in: Rebuilt.
* include/ffi.h.in (EH_FRAME_FLAGS): Define.
* src/alpha/osf.S: Use EH_FRAME_FLAGS.
* src/powerpc/linux64.S: Likewise.
* src/powerpc/linux64_closure.S: Likewise. Include ffi.h.
* src/powerpc/sysv.S: Use EH_FRAME_FLAGS. Use pcrel encoding
if -fpic/-fPIC/-mrelocatable.
* src/powerpc/powerpc_closure.S: Likewise.
* src/sparc/v8.S: If HAVE_RO_EH_FRAME is defined, don't include
#write in .eh_frame flags.
* src/sparc/v9.S: Likewise.
* src/x86/unix64.S: Use EH_FRAME_FLAGS.
* src/x86/sysv.S: Likewise. Use pcrel encoding if -fpic/-fPIC.
* src/s390/sysv.S: Use EH_FRAME_FLAGS. Include ffi.h.
From-SVN: r66887
* configure.in (powerpc64*-*-linux*): Remove.
* configure: Rebuilt.
libffi/
* include/ffi.h.in (POWERPC64): Define if 64-bit.
(enum ffi_abi): Add FFI_LINUX64 on POWERPC.
Make it the default on POWERPC64.
(FFI_TRAMPOLINE_SIZE): Define to 24 on POWERPC64.
* configure.in: Change powerpc-*-linux* into powerpc*-*-linux*.
* configure: Rebuilt.
* src/powerpc/ffi.c (hidden): Define.
(ffi_prep_args_SYSV): Renamed from
ffi_prep_args. Cast pointers to unsigned long to shut up warnings.
(NUM_GPR_ARG_REGISTERS64, NUM_FPR_ARG_REGISTERS64,
ASM_NEEDS_REGISTERS64): New.
(ffi_prep_args64): New function.
(ffi_prep_cif_machdep): Handle FFI_LINUX64 ABI.
(ffi_call): Likewise.
(ffi_prep_closure): Likewise.
(flush_icache): Surround by #ifndef POWERPC64.
(ffi_dblfl): New union type.
(ffi_closure_helper_SYSV): Use it to avoid aliasing problems.
(ffi_closure_helper_LINUX64): New function.
* src/powerpc/ppc_closure.S: Surround whole file by #ifndef
__powerpc64__.
* src/powerpc/sysv.S: Likewise.
(ffi_call_SYSV): Rename ffi_prep_args to ffi_prep_args_SYSV.
* src/powerpc/linux64.S: New file.
* src/powerpc/linux64_closure.S: New file.
* Makefile.am (EXTRA_DIST): Add src/powerpc/linux64.S and
src/powerpc/linux64_closure.S.
(TARGET_SRC_POWERPC): Likewise.
* src/ffitest.c (closure_test_fn, closure_test_fn1, closure_test_fn2,
closure_test_fn3): Fix result printing on big-endian 64-bit
machines.
(main): Print tst2_arg instead of uninitialized tst2_result.
* src/ffitest.c (main): Hide what closure pointer really points to
from the compiler.
From-SVN: r65781
* libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32
bit mode.
* libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV):
Receive closure pointer through parameter, read args using
__builtin_dwarf_cfa.
(FFI_INIT_TRAMPOLINE): Send closure reference through eax.
From-SVN: r64663