Rebase from GCC
This commit is contained in:
28
ChangeLog
28
ChangeLog
@@ -1,3 +1,31 @@
|
||||
2009-12-25 Matthias Klose <doko@ubuntu.com>
|
||||
|
||||
* man/ffi_call.3: Fix #include in examples.
|
||||
* doc/libffi.texi: Add dircategory.
|
||||
|
||||
2009-12-25 Frank Everdij <f.p.x.everdij@tudelft.nl>
|
||||
|
||||
* include/ffi.h.in: Placed '__GNUC__' ifdef around
|
||||
'__attribute__((aligned(8)))' in ffi_closure, fixes compile for
|
||||
IRIX MIPSPro c99.
|
||||
* include/ffi_common.h: Added '__sgi' define to non
|
||||
'__attribute__((__mode__()))' integer typedefs.
|
||||
* src/mips/ffi.c (ffi_call, ffi_closure_mips_inner_O32,
|
||||
ffi_closure_mips_inner_N32): Added 'defined(_MIPSEB)' to BE check.
|
||||
(ffi_closure_mips_inner_O32, ffi_closure_mips_inner_N32): Added
|
||||
FFI_LONGDOUBLE support and alignment(N32 only).
|
||||
* src/mips/ffitarget.h: Corrected '#include <sgidefs.h>' for IRIX and
|
||||
fixed non '__attribute__((__mode__()))' integer typedefs.
|
||||
* src/mips/n32.S: Put '#ifdef linux' around '.abicalls' and '.eh_frame'
|
||||
since they are Linux/GNU Assembler specific.
|
||||
|
||||
2009-12-25 Bradley Smith <brad@brad-smith.co.uk>
|
||||
|
||||
* configure.ac, Makefile.am, src/avr32/ffi.c,
|
||||
src/avr32/ffitarget.h,
|
||||
src/avr32/sysv.S: Add AVR32 port.
|
||||
* configure, Makefile.in: Rebuilt.
|
||||
|
||||
2009-12-21 Andreas Tobler <a.tobler@schweiz.org>
|
||||
|
||||
* configure.ac: Make i?86 build on FreeBSD and OpenBSD.
|
||||
|
||||
@@ -29,27 +29,6 @@
|
||||
* testsuite/libffi.call/cls_longdouble.c: Ditto.
|
||||
* testsuite/libffi.call/cls_double_va.c: Ditto.
|
||||
|
||||
2009-10-11 Matthias Klose <doko@ubuntu.com>
|
||||
|
||||
* man/ffi_call.3: Fix #include in examples.
|
||||
* doc/libffi.texi: Add dircategory.
|
||||
|
||||
2009-10-23 Frank Everdij <f.p.x.everdij@tudelft.nl>
|
||||
|
||||
* include/ffi.h.in: Placed '__GNUC__' ifdef around
|
||||
'__attribute__((aligned(8)))' in ffi_closure, fixes compile for
|
||||
IRIX MIPSPro c99.
|
||||
* include/ffi_common.h: Added '__sgi' define to non
|
||||
'__attribute__((__mode__()))' integer typedefs.
|
||||
* src/mips/ffi.c (ffi_call, ffi_closure_mips_inner_O32,
|
||||
ffi_closure_mips_inner_N32): Added 'defined(_MIPSEB)' to BE check.
|
||||
(ffi_closure_mips_inner_O32, ffi_closure_mips_inner_N32): Added
|
||||
FFI_LONGDOUBLE support and alignment(N32 only).
|
||||
* src/mips/ffitarget.h: Corrected '#include <sgidefs.h>' for IRIX and
|
||||
fixed non '__attribute__((__mode__()))' integer typedefs.
|
||||
* src/mips/n32.S: Put '#ifdef linux' around '.abicalls' and '.eh_frame'
|
||||
since they are Linux/GNU Assembler specific.
|
||||
|
||||
2009-12-25 Andreas Tobler <a.tobler@schweiz.org>
|
||||
|
||||
* fficonfig.h.in: Rebuilt again.
|
||||
@@ -64,17 +43,6 @@
|
||||
* fficonfig.h.in: Rebuilt.
|
||||
* src/closures.c (dlmmap): Define version for snow leopard.
|
||||
|
||||
2009-10-05 Bradley Smith <brad@brad-smith.co.uk>
|
||||
|
||||
* configure.ac, Makefile.am, src/avr32/ffi.c,
|
||||
src/avr32/ffitarget.h,
|
||||
src/avr32/sysv.S: Add AVR32 port.
|
||||
* testsuite/libffi.call/cls_dbls_struct.c,
|
||||
testsuite/libffi.call/cls_double_va.c,
|
||||
testsuite/libffi.call/cls_longdouble_va.c,
|
||||
testsuite/libffi.call/huge_struct.c: Mark expected failures on
|
||||
AVR32.
|
||||
|
||||
2009-06-16 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* testsuite/libffi.call/cls_align_sint64.c,
|
||||
|
||||
@@ -264,7 +264,6 @@ distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_LTLDFLAGS = @AM_LTLDFLAGS@
|
||||
AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
@@ -479,7 +478,7 @@ nodist_libffi_la_SOURCES = $(am__append_1) $(am__append_2) \
|
||||
libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
|
||||
nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
|
||||
AM_CFLAGS = -Wall -g -fexceptions
|
||||
libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(AM_LTLDFLAGS)
|
||||
libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
|
||||
AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
|
||||
AM_CCASFLAGS = $(AM_CPPFLAGS)
|
||||
all: fficonfig.h
|
||||
|
||||
0
config.guess
vendored
Executable file → Normal file
0
config.guess
vendored
Executable file → Normal file
0
config.sub
vendored
Executable file → Normal file
0
config.sub
vendored
Executable file → Normal file
@@ -1,15 +1,15 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/doc
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
|
||||
2009-06-09T10:21:19.356122Z
|
||||
148309
|
||||
aph
|
||||
2009-12-26T05:01:43.471937Z
|
||||
155471
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ file
|
||||
|
||||
|
||||
|
||||
2009-12-20T06:01:58.272552Z
|
||||
2c36d1d9259ed7b885ff66784a65d3a0
|
||||
2009-06-09T10:21:19.356122Z
|
||||
148309
|
||||
aph
|
||||
2009-12-26T05:00:42.848225Z
|
||||
3d48f7b34f9e140271227980cdfac146
|
||||
2009-12-26T05:01:43.471937Z
|
||||
155471
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ aph
|
||||
|
||||
|
||||
|
||||
15350
|
||||
15362
|
||||
|
||||
stamp-vti
|
||||
file
|
||||
|
||||
@@ -31,7 +31,7 @@ section entitled ``GNU General Public License''.
|
||||
@end quotation
|
||||
@end copying
|
||||
|
||||
@dircategory
|
||||
@dircategory Development
|
||||
@direntry
|
||||
* libffi: (libffi). Portable foreign-function interface library.
|
||||
@end direntry
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
This is ../libffi/doc/libffi.info, produced by makeinfo version 4.13
|
||||
from ../libffi/doc/libffi.texi.
|
||||
This is doc/libffi.info, produced by makeinfo version 4.12 from
|
||||
./doc/libffi.texi.
|
||||
|
||||
This manual is for Libffi, a portable foreign-function interface
|
||||
library.
|
||||
@@ -13,7 +13,7 @@ library.
|
||||
included in the section entitled "GNU General Public License".
|
||||
|
||||
|
||||
INFO-DIR-SECTION Development
|
||||
INFO-DIR-SECTION
|
||||
START-INFO-DIR-ENTRY
|
||||
* libffi: (libffi). Portable foreign-function interface library.
|
||||
END-INFO-DIR-ENTRY
|
||||
@@ -516,18 +516,18 @@ Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top700
|
||||
Node: Introduction1436
|
||||
Node: Using libffi3072
|
||||
Node: The Basics3507
|
||||
Node: Simple Example6114
|
||||
Node: Types7141
|
||||
Node: Primitive Types7424
|
||||
Node: Structures9244
|
||||
Node: Type Example10104
|
||||
Node: Multiple ABIs11327
|
||||
Node: The Closure API11698
|
||||
Node: Missing Features14618
|
||||
Node: Index15111
|
||||
Node: Top670
|
||||
Node: Introduction1406
|
||||
Node: Using libffi3042
|
||||
Node: The Basics3477
|
||||
Node: Simple Example6084
|
||||
Node: Types7111
|
||||
Node: Primitive Types7394
|
||||
Node: Structures9214
|
||||
Node: Type Example10074
|
||||
Node: Multiple ABIs11297
|
||||
Node: The Closure API11668
|
||||
Node: Missing Features14588
|
||||
Node: Index15081
|
||||
|
||||
End Tag Table
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@set UPDATED 25 December 2009
|
||||
@set UPDATED-MONTH December 2009
|
||||
@set EDITION 3.0.9rc7
|
||||
@set VERSION 3.0.9rc7
|
||||
@set UPDATED 14 February 2008
|
||||
@set UPDATED-MONTH February 2008
|
||||
@set EDITION 3.0.8
|
||||
@set VERSION 3.0.8
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@set UPDATED 25 December 2009
|
||||
@set UPDATED-MONTH December 2009
|
||||
@set EDITION 3.0.9rc7
|
||||
@set VERSION 3.0.9rc7
|
||||
@set UPDATED 14 February 2008
|
||||
@set UPDATED-MONTH February 2008
|
||||
@set EDITION 3.0.8
|
||||
@set VERSION 3.0.8
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/include
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
|
||||
2009-12-05T17:18:53.298892Z
|
||||
155012
|
||||
rwild
|
||||
2009-12-26T04:59:25.888276Z
|
||||
155470
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ file
|
||||
|
||||
|
||||
|
||||
2009-12-20T06:01:52.296563Z
|
||||
ec6d4ca2bd2cdaa6a515412cedd717a1
|
||||
2009-06-12T15:57:58.721771Z
|
||||
148433
|
||||
aph
|
||||
2009-12-26T04:53:55.603976Z
|
||||
ed03fb27476d372ad782e6ddea030f3b
|
||||
2009-12-26T04:59:25.888276Z
|
||||
155470
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ aph
|
||||
|
||||
|
||||
|
||||
10882
|
||||
10926
|
||||
|
||||
Makefile.in
|
||||
file
|
||||
@@ -66,7 +66,7 @@ file
|
||||
|
||||
|
||||
|
||||
2009-12-20T06:01:52.296563Z
|
||||
2009-12-26T04:20:27.025981Z
|
||||
bc7944b6049d3417505b65c0d178c0db
|
||||
2009-12-05T17:18:53.298892Z
|
||||
155012
|
||||
@@ -100,11 +100,11 @@ file
|
||||
|
||||
|
||||
|
||||
2009-12-20T06:01:52.297561Z
|
||||
5bffed11a81aed973aeec1041d96e2bc
|
||||
2009-06-12T15:57:58.721771Z
|
||||
148433
|
||||
aph
|
||||
2009-12-26T04:53:55.603976Z
|
||||
6ac39dc1d5ec4b22e08fbdc45913f9e1
|
||||
2009-12-26T04:59:25.888276Z
|
||||
155470
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ aph
|
||||
|
||||
|
||||
|
||||
2904
|
||||
3033
|
||||
|
||||
Makefile.am
|
||||
file
|
||||
|
||||
@@ -256,7 +256,11 @@ typedef struct {
|
||||
ffi_cif *cif;
|
||||
void (*fun)(ffi_cif*,void*,void**,void*);
|
||||
void *user_data;
|
||||
#ifdef __GNUC__
|
||||
} ffi_closure __attribute__((aligned (8)));
|
||||
#else
|
||||
} ffi_closure;
|
||||
#endif
|
||||
|
||||
void *ffi_closure_alloc (size_t size, void **code);
|
||||
void ffi_closure_free (void *);
|
||||
|
||||
@@ -84,15 +84,21 @@ typedef struct
|
||||
} extended_cif;
|
||||
|
||||
/* Terse sized type definitions. */
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) || defined(__sgi)
|
||||
typedef unsigned char UINT8;
|
||||
typedef signed char SINT8;
|
||||
typedef unsigned short UINT16;
|
||||
typedef signed short SINT16;
|
||||
typedef unsigned int UINT32;
|
||||
typedef signed int SINT32;
|
||||
# ifdef _MSC_VER
|
||||
typedef unsigned __int64 UINT64;
|
||||
typedef signed __int64 SINT64;
|
||||
# else
|
||||
# include <inttypes.h>
|
||||
typedef uint64_t UINT64;
|
||||
typedef int64_t SINT64;
|
||||
# endif
|
||||
#else
|
||||
typedef unsigned int UINT8 __attribute__((__mode__(__QI__)));
|
||||
typedef signed int SINT8 __attribute__((__mode__(__QI__)));
|
||||
|
||||
@@ -78,7 +78,6 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_LTLDFLAGS = @AM_LTLDFLAGS@
|
||||
AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
|
||||
0
install-sh
Executable file → Normal file
0
install-sh
Executable file → Normal file
@@ -1,15 +1,15 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/man
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
|
||||
2009-12-05T17:18:53.298892Z
|
||||
155012
|
||||
rwild
|
||||
2009-12-26T05:01:43.471937Z
|
||||
155471
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ file
|
||||
|
||||
|
||||
|
||||
2009-12-20T06:01:58.333556Z
|
||||
77a8c0a182b31529309b91d3aa9d7a35
|
||||
2009-06-12T15:57:58.721771Z
|
||||
148433
|
||||
aph
|
||||
2009-12-26T05:00:42.849225Z
|
||||
dd7b61f56e75a1d052dd10dc02ac4940
|
||||
2009-12-26T05:01:43.471937Z
|
||||
155471
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ aph
|
||||
|
||||
|
||||
|
||||
2337
|
||||
2333
|
||||
|
||||
Makefile.in
|
||||
file
|
||||
@@ -66,7 +66,7 @@ file
|
||||
|
||||
|
||||
|
||||
2009-12-20T06:01:58.334555Z
|
||||
2009-12-26T04:20:27.101235Z
|
||||
05c58ceade6051d8b2ff7afc80cbb9c3
|
||||
2009-12-05T17:18:53.298892Z
|
||||
155012
|
||||
|
||||
@@ -43,7 +43,7 @@ integral type must be used to hold
|
||||
the return value.
|
||||
.Sh EXAMPLES
|
||||
.Bd -literal
|
||||
#include <ffi/ffi.h>
|
||||
#include <ffi.h>
|
||||
#include <stdio.h>
|
||||
|
||||
unsigned char
|
||||
|
||||
@@ -76,7 +76,6 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_LTLDFLAGS = @AM_LTLDFLAGS@
|
||||
AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
|
||||
@@ -14,10 +14,10 @@ Index: libffi/ChangeLog.libffi
|
||||
+ * testsuite/libffi.call/cls_longdouble.c: Ditto.
|
||||
+ * testsuite/libffi.call/cls_double_va.c: Ditto.
|
||||
+
|
||||
2009-10-11 Matthias Klose <doko@ubuntu.com>
|
||||
2009-12-25 Andreas Tobler <a.tobler@schweiz.org>
|
||||
|
||||
* man/ffi_call.3: Fix #include in examples.
|
||||
@@ -219,20 +230,20 @@
|
||||
* fficonfig.h.in: Rebuilt again.
|
||||
@@ -187,20 +198,20 @@
|
||||
2008-12-22 Timothy Wall <twall@users.sf.net>
|
||||
|
||||
* testsuite/libffi.call/closure_fn0.c,
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
stand-alone
|
||||
avr32
|
||||
snow-leopard
|
||||
sgi-mips
|
||||
fix-docs
|
||||
fix-huge_struct-test
|
||||
windows
|
||||
undefine_AC_ARG_VAR_PRECIOUS
|
||||
|
||||
@@ -70,9 +70,9 @@ Index: libffi/ChangeLog.libffi
|
||||
+ * fficonfig.h.in: Rebuilt.
|
||||
+ * src/closures.c (dlmmap): Define version for snow leopard.
|
||||
+
|
||||
2009-10-05 Bradley Smith <brad@brad-smith.co.uk>
|
||||
2009-06-16 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* configure.ac, Makefile.am, src/avr32/ffi.c,
|
||||
* testsuite/libffi.call/cls_align_sint64.c,
|
||||
Index: libffi/configure.ac
|
||||
===================================================================
|
||||
--- libffi.orig/configure.ac
|
||||
@@ -96,15 +96,23 @@ Index: libffi/configure
|
||||
===================================================================
|
||||
--- libffi.orig/configure
|
||||
+++ libffi/configure
|
||||
@@ -14498,7 +14498,7 @@ _ACEOF
|
||||
@@ -14497,6 +14497,16 @@ _ACEOF
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$target" in
|
||||
- i?86-apple-darwin10*)
|
||||
+case "$target" in
|
||||
+ *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define FFI_MMAP_EXEC_WRIT 1
|
||||
+
|
||||
+cat >>confdefs.h <<\_ACEOF
|
||||
+#define FFI_MMAP_EXEC_WRIT 1
|
||||
+_ACEOF
|
||||
+
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
{ $as_echo "$as_me:$LINENO: checking whether .eh_frame section should be read-only" >&5
|
||||
$as_echo_n "checking whether .eh_frame section should be read-only... " >&6; }
|
||||
if test "${libffi_cv_ro_eh_frame+set}" = set; then
|
||||
Index: libffi/fficonfig.h.in
|
||||
===================================================================
|
||||
--- libffi.orig/fficonfig.h.in
|
||||
@@ -119,13 +127,3 @@ Index: libffi/fficonfig.h.in
|
||||
/* Define this is you do not want support for the raw API. */
|
||||
#undef FFI_NO_RAW_API
|
||||
|
||||
@@ -122,9 +125,6 @@
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
-/* Define to the home page for this package. */
|
||||
-#undef PACKAGE_URL
|
||||
-
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
|
||||
1162
patches/stand-alone
1162
patches/stand-alone
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,15 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
|
||||
2009-12-14T02:42:18.232982Z
|
||||
155205
|
||||
danglin
|
||||
2009-12-26T04:59:25.888276Z
|
||||
155470
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -118,6 +118,9 @@ aph
|
||||
frv
|
||||
dir
|
||||
|
||||
avr32
|
||||
dir
|
||||
|
||||
s390
|
||||
dir
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/alpha
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/arm
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
130
src/avr32/.svn/entries
Normal file
130
src/avr32/.svn/entries
Normal file
@@ -0,0 +1,130 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/avr32
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
|
||||
2009-12-26T04:21:07.255800Z
|
||||
155469
|
||||
green
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
138bc75d-0d04-0410-961f-82ee72b054a4
|
||||
|
||||
ffitarget.h
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2009-12-26T03:57:14.102225Z
|
||||
97c80ed302cb9613e2e501a162651ea7
|
||||
2009-12-26T04:21:07.255800Z
|
||||
155469
|
||||
green
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1823
|
||||
|
||||
ffi.c
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2009-12-26T03:57:14.066978Z
|
||||
9ee26077d6b37d391bb6275be0437144
|
||||
2009-12-26T04:21:07.255800Z
|
||||
155469
|
||||
green
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
12330
|
||||
|
||||
sysv.S
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2009-12-26T03:57:14.102225Z
|
||||
808bd4aa64c30850292f3ffe35d19ea5
|
||||
2009-12-26T04:21:07.255800Z
|
||||
155469
|
||||
green
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
4840
|
||||
|
||||
421
src/avr32/.svn/text-base/ffi.c.svn-base
Normal file
421
src/avr32/.svn/text-base/ffi.c.svn-base
Normal file
@@ -0,0 +1,421 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
ffi.c - Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
|
||||
|
||||
AVR32 Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
----------------------------------------------------------------------- */
|
||||
|
||||
#include <ffi.h>
|
||||
#include <ffi_common.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <asm/unistd.h>
|
||||
|
||||
/* #define DEBUG */
|
||||
|
||||
extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
|
||||
unsigned int, unsigned int, unsigned int*, unsigned int,
|
||||
void (*fn)(void));
|
||||
extern void ffi_closure_SYSV (ffi_closure *);
|
||||
|
||||
unsigned int pass_struct_on_stack(ffi_type *type)
|
||||
{
|
||||
if(type->type != FFI_TYPE_STRUCT)
|
||||
return 0;
|
||||
|
||||
if(type->alignment < type->size &&
|
||||
!(type->size == 4 || type->size == 8) &&
|
||||
!(type->size == 8 && type->alignment >= 4))
|
||||
return 1;
|
||||
|
||||
if(type->size == 3 || type->size == 5 || type->size == 6 ||
|
||||
type->size == 7)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ffi_prep_args is called by the assembly routine once stack space
|
||||
* has been allocated for the function's arguments
|
||||
*
|
||||
* This is annoyingly complex since we need to keep track of used
|
||||
* registers.
|
||||
*/
|
||||
|
||||
void ffi_prep_args(char *stack, extended_cif *ecif)
|
||||
{
|
||||
unsigned int i;
|
||||
void **p_argv;
|
||||
ffi_type **p_arg;
|
||||
char *reg_base = stack;
|
||||
char *stack_base = stack + 20;
|
||||
unsigned int stack_offset = 0;
|
||||
unsigned int reg_mask = 0;
|
||||
|
||||
p_argv = ecif->avalue;
|
||||
|
||||
/* If cif->flags is struct then we know it's not passed in registers */
|
||||
if(ecif->cif->flags == FFI_TYPE_STRUCT)
|
||||
{
|
||||
*(void**)reg_base = ecif->rvalue;
|
||||
reg_mask |= 1;
|
||||
}
|
||||
|
||||
for(i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs;
|
||||
i++, p_arg++)
|
||||
{
|
||||
size_t z = (*p_arg)->size;
|
||||
int alignment = (*p_arg)->alignment;
|
||||
int type = (*p_arg)->type;
|
||||
char *addr = 0;
|
||||
|
||||
if(z % 4 != 0)
|
||||
z += (4 - z % 4);
|
||||
|
||||
if(reg_mask != 0x1f)
|
||||
{
|
||||
if(pass_struct_on_stack(*p_arg))
|
||||
{
|
||||
addr = stack_base + stack_offset;
|
||||
stack_offset += z;
|
||||
}
|
||||
else if(z == sizeof(int))
|
||||
{
|
||||
char index = 0;
|
||||
|
||||
while((reg_mask >> index) & 1)
|
||||
index++;
|
||||
|
||||
addr = reg_base + (index * 4);
|
||||
reg_mask |= (1 << index);
|
||||
}
|
||||
else if(z == 2 * sizeof(int))
|
||||
{
|
||||
if(!((reg_mask >> 1) & 1))
|
||||
{
|
||||
addr = reg_base + 4;
|
||||
reg_mask |= (3 << 1);
|
||||
}
|
||||
else if(!((reg_mask >> 3) & 1))
|
||||
{
|
||||
addr = reg_base + 12;
|
||||
reg_mask |= (3 << 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!addr)
|
||||
{
|
||||
addr = stack_base + stack_offset;
|
||||
stack_offset += z;
|
||||
}
|
||||
|
||||
if(type == FFI_TYPE_STRUCT && (*p_arg)->elements[1] == NULL)
|
||||
type = (*p_arg)->elements[0]->type;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case FFI_TYPE_UINT8:
|
||||
*(unsigned int *)addr = (unsigned int)*(UINT8 *)(*p_argv);
|
||||
break;
|
||||
case FFI_TYPE_SINT8:
|
||||
*(signed int *)addr = (signed int)*(SINT8 *)(*p_argv);
|
||||
break;
|
||||
case FFI_TYPE_UINT16:
|
||||
*(unsigned int *)addr = (unsigned int)*(UINT16 *)(*p_argv);
|
||||
break;
|
||||
case FFI_TYPE_SINT16:
|
||||
*(signed int *)addr = (signed int)*(SINT16 *)(*p_argv);
|
||||
break;
|
||||
default:
|
||||
memcpy(addr, *p_argv, z);
|
||||
}
|
||||
|
||||
p_argv++;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Debugging */
|
||||
for(i = 0; i < 5; i++)
|
||||
{
|
||||
if((reg_mask & (1 << i)) == 0)
|
||||
printf("r%d: (unused)\n", 12 - i);
|
||||
else
|
||||
printf("r%d: 0x%08x\n", 12 - i, ((unsigned int*)reg_base)[i]);
|
||||
}
|
||||
|
||||
for(i = 0; i < stack_offset / 4; i++)
|
||||
{
|
||||
printf("sp+%d: 0x%08x\n", i*4, ((unsigned int*)stack_base)[i]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Perform machine dependent cif processing */
|
||||
ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
|
||||
{
|
||||
/* Round the stack up to a multiple of 8 bytes. This isn't needed
|
||||
* everywhere, but it is on some platforms, and it doesn't harm
|
||||
* anything when it isn't needed. */
|
||||
cif->bytes = (cif->bytes + 7) & ~7;
|
||||
|
||||
/* Flag to indicate that he return value is in fact a struct */
|
||||
cif->rstruct_flag = 0;
|
||||
|
||||
/* Set the return type flag */
|
||||
switch(cif->rtype->type)
|
||||
{
|
||||
case FFI_TYPE_SINT8:
|
||||
case FFI_TYPE_UINT8:
|
||||
cif->flags = (unsigned)FFI_TYPE_UINT8;
|
||||
break;
|
||||
case FFI_TYPE_SINT16:
|
||||
case FFI_TYPE_UINT16:
|
||||
cif->flags = (unsigned)FFI_TYPE_UINT16;
|
||||
break;
|
||||
case FFI_TYPE_FLOAT:
|
||||
case FFI_TYPE_SINT32:
|
||||
case FFI_TYPE_UINT32:
|
||||
case FFI_TYPE_POINTER:
|
||||
cif->flags = (unsigned)FFI_TYPE_UINT32;
|
||||
break;
|
||||
case FFI_TYPE_DOUBLE:
|
||||
case FFI_TYPE_SINT64:
|
||||
case FFI_TYPE_UINT64:
|
||||
cif->flags = (unsigned)FFI_TYPE_UINT64;
|
||||
break;
|
||||
case FFI_TYPE_STRUCT:
|
||||
cif->rstruct_flag = 1;
|
||||
if(!pass_struct_on_stack(cif->rtype))
|
||||
{
|
||||
if(cif->rtype->size <= 1)
|
||||
cif->flags = (unsigned)FFI_TYPE_UINT8;
|
||||
else if(cif->rtype->size <= 2)
|
||||
cif->flags = (unsigned)FFI_TYPE_UINT16;
|
||||
else if(cif->rtype->size <= 4)
|
||||
cif->flags = (unsigned)FFI_TYPE_UINT32;
|
||||
else if(cif->rtype->size <= 8)
|
||||
cif->flags = (unsigned)FFI_TYPE_UINT64;
|
||||
else
|
||||
cif->flags = (unsigned)cif->rtype->type;
|
||||
}
|
||||
else
|
||||
cif->flags = (unsigned)cif->rtype->type;
|
||||
break;
|
||||
default:
|
||||
cif->flags = (unsigned)cif->rtype->type;
|
||||
break;
|
||||
}
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
||||
{
|
||||
extended_cif ecif;
|
||||
|
||||
unsigned int size = 0, i = 0;
|
||||
ffi_type **p_arg;
|
||||
|
||||
ecif.cif = cif;
|
||||
ecif.avalue = avalue;
|
||||
|
||||
for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++)
|
||||
size += (*p_arg)->size + (4 - (*p_arg)->size % 4);
|
||||
|
||||
/* If the return value is a struct and we don't have a return value
|
||||
* address then we need to make one */
|
||||
|
||||
/* If cif->flags is struct then it's not suitable for registers */
|
||||
if((rvalue == NULL) && (cif->flags == FFI_TYPE_STRUCT))
|
||||
ecif.rvalue = alloca(cif->rtype->size);
|
||||
else
|
||||
ecif.rvalue = rvalue;
|
||||
|
||||
switch(cif->abi)
|
||||
{
|
||||
case FFI_SYSV:
|
||||
ffi_call_SYSV(ffi_prep_args, &ecif, size, cif->flags,
|
||||
ecif.rvalue, cif->rstruct_flag, fn);
|
||||
break;
|
||||
default:
|
||||
FFI_ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
|
||||
void **avalue, ffi_cif *cif)
|
||||
{
|
||||
register unsigned int i, reg_mask = 0;
|
||||
register void **p_argv;
|
||||
register ffi_type **p_arg;
|
||||
register char *reg_base = stack;
|
||||
register char *stack_base = stack + 20;
|
||||
register unsigned int stack_offset = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Debugging */
|
||||
for(i = 0; i < cif->nargs + 7; i++)
|
||||
{
|
||||
printf("sp+%d: 0x%08x\n", i*4, ((unsigned int*)stack)[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If cif->flags is struct then we know it's not passed in registers */
|
||||
if(cif->flags == FFI_TYPE_STRUCT)
|
||||
{
|
||||
*rvalue = *(void **)reg_base;
|
||||
reg_mask |= 1;
|
||||
}
|
||||
|
||||
p_argv = avalue;
|
||||
|
||||
for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++)
|
||||
{
|
||||
size_t z = (*p_arg)->size;
|
||||
int alignment = (*p_arg)->alignment;
|
||||
|
||||
*p_argv = 0;
|
||||
|
||||
if(z % 4 != 0)
|
||||
z += (4 - z % 4);
|
||||
|
||||
if(reg_mask != 0x1f)
|
||||
{
|
||||
if(pass_struct_on_stack(*p_arg))
|
||||
{
|
||||
*p_argv = (void*)stack_base + stack_offset;
|
||||
stack_offset += z;
|
||||
}
|
||||
else if(z <= sizeof(int))
|
||||
{
|
||||
char index = 0;
|
||||
|
||||
while((reg_mask >> index) & 1)
|
||||
index++;
|
||||
|
||||
*p_argv = (void*)reg_base + (index * 4);
|
||||
reg_mask |= (1 << index);
|
||||
}
|
||||
else if(z == 2 * sizeof(int))
|
||||
{
|
||||
if(!((reg_mask >> 1) & 1))
|
||||
{
|
||||
*p_argv = (void*)reg_base + 4;
|
||||
reg_mask |= (3 << 1);
|
||||
}
|
||||
else if(!((reg_mask >> 3) & 1))
|
||||
{
|
||||
*p_argv = (void*)reg_base + 12;
|
||||
reg_mask |= (3 << 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!*p_argv)
|
||||
{
|
||||
*p_argv = (void*)stack_base + stack_offset;
|
||||
stack_offset += z;
|
||||
}
|
||||
|
||||
if((*p_arg)->type != FFI_TYPE_STRUCT ||
|
||||
(*p_arg)->elements[1] == NULL)
|
||||
{
|
||||
if(alignment == 1)
|
||||
**(unsigned int**)p_argv <<= 24;
|
||||
else if(alignment == 2)
|
||||
**(unsigned int**)p_argv <<= 16;
|
||||
}
|
||||
|
||||
p_argv++;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Debugging */
|
||||
for(i = 0; i < cif->nargs; i++)
|
||||
{
|
||||
printf("sp+%d: 0x%08x\n", i*4, *(((unsigned int**)avalue)[i]));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* This function is jumped to by the trampoline */
|
||||
|
||||
unsigned int ffi_closure_SYSV_inner(ffi_closure *closure, void **respp,
|
||||
void *args)
|
||||
{
|
||||
ffi_cif *cif;
|
||||
void **arg_area;
|
||||
unsigned int i, size = 0;
|
||||
ffi_type **p_arg;
|
||||
|
||||
cif = closure->cif;
|
||||
|
||||
for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++)
|
||||
size += (*p_arg)->size + (4 - (*p_arg)->size % 4);
|
||||
|
||||
arg_area = (void **)alloca(size);
|
||||
|
||||
/* this call will initialize ARG_AREA, such that each element in that
|
||||
* array points to the corresponding value on the stack; and if the
|
||||
* function returns a structure, it will re-set RESP to point to the
|
||||
* structure return address. */
|
||||
|
||||
ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif);
|
||||
|
||||
(closure->fun)(cif, *respp, arg_area, closure->user_data);
|
||||
|
||||
return cif->flags;
|
||||
}
|
||||
|
||||
ffi_status ffi_prep_closure_loc(ffi_closure* closure, ffi_cif* cif,
|
||||
void (*fun)(ffi_cif*, void*, void**, void*), void *user_data,
|
||||
void *codeloc)
|
||||
{
|
||||
FFI_ASSERT(cif->abi == FFI_SYSV);
|
||||
|
||||
unsigned char *__tramp = (unsigned char*)(&closure->tramp[0]);
|
||||
unsigned int __fun = (unsigned int)(&ffi_closure_SYSV);
|
||||
unsigned int __ctx = (unsigned int)(codeloc);
|
||||
unsigned int __rstruct_flag = (unsigned int)(cif->rstruct_flag);
|
||||
unsigned int __inner = (unsigned int)(&ffi_closure_SYSV_inner);
|
||||
*(unsigned int*) &__tramp[0] = 0xebcd1f00; /* pushm r8-r12 */
|
||||
*(unsigned int*) &__tramp[4] = 0xfefc0010; /* ld.w r12, pc[16] */
|
||||
*(unsigned int*) &__tramp[8] = 0xfefb0010; /* ld.w r11, pc[16] */
|
||||
*(unsigned int*) &__tramp[12] = 0xfefa0010; /* ld.w r10, pc[16] */
|
||||
*(unsigned int*) &__tramp[16] = 0xfeff0010; /* ld.w pc, pc[16] */
|
||||
*(unsigned int*) &__tramp[20] = __ctx;
|
||||
*(unsigned int*) &__tramp[24] = __rstruct_flag;
|
||||
*(unsigned int*) &__tramp[28] = __inner;
|
||||
*(unsigned int*) &__tramp[32] = __fun;
|
||||
syscall(__NR_cacheflush, 0, (&__tramp[0]), 36);
|
||||
|
||||
closure->cif = cif;
|
||||
closure->user_data = user_data;
|
||||
closure->fun = fun;
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
50
src/avr32/.svn/text-base/ffitarget.h.svn-base
Normal file
50
src/avr32/.svn/text-base/ffitarget.h.svn-base
Normal file
@@ -0,0 +1,50 @@
|
||||
/* -----------------------------------------------------------------*-C-*-
|
||||
ffitarget.h - Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
|
||||
Target configuration macros for AVR32.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
----------------------------------------------------------------------- */
|
||||
|
||||
#ifndef LIBFFI_TARGET_H
|
||||
#define LIBFFI_TARGET_H
|
||||
|
||||
#ifndef LIBFFI_ASM
|
||||
typedef unsigned long ffi_arg;
|
||||
typedef signed long ffi_sarg;
|
||||
|
||||
typedef enum ffi_abi {
|
||||
FFI_FIRST_ABI = 0,
|
||||
FFI_SYSV,
|
||||
FFI_DEFAULT_ABI = FFI_SYSV,
|
||||
FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
|
||||
} ffi_abi;
|
||||
#endif
|
||||
|
||||
#define FFI_EXTRA_CIF_FIELDS unsigned int rstruct_flag
|
||||
|
||||
/* Definitions for closures */
|
||||
|
||||
#define FFI_CLOSURES 1
|
||||
#define FFI_TRAMPOLINE_SIZE 36
|
||||
#define FFI_NATIVE_RAW_API 0
|
||||
|
||||
#endif
|
||||
208
src/avr32/.svn/text-base/sysv.S.svn-base
Normal file
208
src/avr32/.svn/text-base/sysv.S.svn-base
Normal file
@@ -0,0 +1,208 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
sysv.S - Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
|
||||
|
||||
AVR32 Foreign Function Interface
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
``Software''), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
--------------------------------------------------------------------- */
|
||||
|
||||
#define LIBFFI_ASM
|
||||
#include <fficonfig.h>
|
||||
#include <ffi.h>
|
||||
|
||||
/* r12: ffi_prep_args
|
||||
* r11: &ecif
|
||||
* r10: size
|
||||
* r9: cif->flags
|
||||
* r8: ecif.rvalue
|
||||
* sp+0: cif->rstruct_flag
|
||||
* sp+4: fn */
|
||||
|
||||
.text
|
||||
.align 1
|
||||
.globl ffi_call_SYSV
|
||||
.type ffi_call_SYSV, @function
|
||||
ffi_call_SYSV:
|
||||
stm --sp, r0,r1,lr
|
||||
stm --sp, r8-r12
|
||||
mov r0, sp
|
||||
|
||||
/* Make room for all of the new args. */
|
||||
sub sp, r10
|
||||
/* Pad to make way for potential skipped registers */
|
||||
sub sp, 20
|
||||
|
||||
/* Call ffi_prep_args(stack, &ecif). */
|
||||
/* r11 already set */
|
||||
mov r1, r12
|
||||
mov r12, sp
|
||||
icall r1
|
||||
|
||||
/* Save new argument size */
|
||||
mov r1, r12
|
||||
|
||||
/* Move first 5 parameters in registers. */
|
||||
ldm sp++, r8-r12
|
||||
|
||||
/* call (fn) (...). */
|
||||
ld.w r1, r0[36]
|
||||
icall r1
|
||||
|
||||
/* Remove the space we pushed for the args. */
|
||||
mov sp, r0
|
||||
|
||||
/* Load r1 with the rstruct flag. */
|
||||
ld.w r1, sp[32]
|
||||
|
||||
/* Load r9 with the return type code. */
|
||||
ld.w r9, sp[12]
|
||||
|
||||
/* Load r8 with the return value pointer. */
|
||||
ld.w r8, sp[16]
|
||||
|
||||
/* If the return value pointer is NULL, assume no return value. */
|
||||
cp.w r8, 0
|
||||
breq .Lend
|
||||
|
||||
/* Check if return type is actually a struct */
|
||||
cp.w r1, 0
|
||||
breq 1f
|
||||
|
||||
/* Return 8bit */
|
||||
cp.w r9, FFI_TYPE_UINT8
|
||||
breq .Lstore8
|
||||
|
||||
/* Return 16bit */
|
||||
cp.w r9, FFI_TYPE_UINT16
|
||||
breq .Lstore16
|
||||
|
||||
1:
|
||||
/* Return 32bit */
|
||||
cp.w r9, FFI_TYPE_UINT32
|
||||
breq .Lstore32
|
||||
cp.w r9, FFI_TYPE_UINT16
|
||||
breq .Lstore32
|
||||
cp.w r9, FFI_TYPE_UINT8
|
||||
breq .Lstore32
|
||||
|
||||
/* Return 64bit */
|
||||
cp.w r9, FFI_TYPE_UINT64
|
||||
breq .Lstore64
|
||||
|
||||
/* Didn't match anything */
|
||||
bral .Lend
|
||||
|
||||
.Lstore64:
|
||||
st.w r8[0], r11
|
||||
st.w r8[4], r10
|
||||
bral .Lend
|
||||
|
||||
.Lstore32:
|
||||
st.w r8[0], r12
|
||||
bral .Lend
|
||||
|
||||
.Lstore16:
|
||||
st.h r8[0], r12
|
||||
bral .Lend
|
||||
|
||||
.Lstore8:
|
||||
st.b r8[0], r12
|
||||
bral .Lend
|
||||
|
||||
.Lend:
|
||||
sub sp, -20
|
||||
ldm sp++, r0,r1,pc
|
||||
|
||||
.size ffi_call_SYSV, . - ffi_call_SYSV
|
||||
|
||||
|
||||
/* r12: __ctx
|
||||
* r11: __rstruct_flag
|
||||
* r10: __inner */
|
||||
|
||||
.align 1
|
||||
.globl ffi_closure_SYSV
|
||||
.type ffi_closure_SYSV, @function
|
||||
ffi_closure_SYSV:
|
||||
stm --sp, r0,lr
|
||||
mov r0, r11
|
||||
mov r8, r10
|
||||
sub r10, sp, -8
|
||||
sub sp, 12
|
||||
st.w sp[8], sp
|
||||
sub r11, sp, -8
|
||||
icall r8
|
||||
|
||||
/* Check if return type is actually a struct */
|
||||
cp.w r0, 0
|
||||
breq 1f
|
||||
|
||||
/* Return 8bit */
|
||||
cp.w r12, FFI_TYPE_UINT8
|
||||
breq .Lget8
|
||||
|
||||
/* Return 16bit */
|
||||
cp.w r12, FFI_TYPE_UINT16
|
||||
breq .Lget16
|
||||
|
||||
1:
|
||||
/* Return 32bit */
|
||||
cp.w r12, FFI_TYPE_UINT32
|
||||
breq .Lget32
|
||||
cp.w r12, FFI_TYPE_UINT16
|
||||
breq .Lget32
|
||||
cp.w r12, FFI_TYPE_UINT8
|
||||
breq .Lget32
|
||||
|
||||
/* Return 64bit */
|
||||
cp.w r12, FFI_TYPE_UINT64
|
||||
breq .Lget64
|
||||
|
||||
/* Didn't match anything */
|
||||
bral .Lclend
|
||||
|
||||
.Lget64:
|
||||
ld.w r11, sp[0]
|
||||
ld.w r10, sp[4]
|
||||
bral .Lclend
|
||||
|
||||
.Lget32:
|
||||
ld.w r12, sp[0]
|
||||
bral .Lclend
|
||||
|
||||
.Lget16:
|
||||
ld.uh r12, sp[0]
|
||||
bral .Lclend
|
||||
|
||||
.Lget8:
|
||||
ld.ub r12, sp[0]
|
||||
bral .Lclend
|
||||
|
||||
.Lclend:
|
||||
sub sp, -12
|
||||
ldm sp++, r0,lr
|
||||
sub sp, -20
|
||||
mov pc, lr
|
||||
|
||||
.size ffi_closure_SYSV, . - ffi_closure_SYSV
|
||||
|
||||
#if defined __ELF__ && defined __linux__
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/cris
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/frv
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/ia64
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/m32r
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/m68k
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/mips
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
|
||||
2009-09-15T17:15:33.045042Z
|
||||
151726
|
||||
daney
|
||||
2009-12-26T04:59:25.888276Z
|
||||
155470
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ file
|
||||
|
||||
|
||||
|
||||
2009-12-20T06:01:55.707555Z
|
||||
fdf13476bd3e53815092fde3494d8fc9
|
||||
2009-09-15T17:15:33.045042Z
|
||||
151726
|
||||
daney
|
||||
2009-12-26T04:53:55.604975Z
|
||||
a48654d49076d07b6bc757bfa1c81c94
|
||||
2009-12-26T04:59:25.888276Z
|
||||
155470
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ daney
|
||||
|
||||
|
||||
|
||||
5878
|
||||
6205
|
||||
|
||||
n32.S
|
||||
file
|
||||
@@ -66,11 +66,11 @@ file
|
||||
|
||||
|
||||
|
||||
2009-12-20T06:01:55.708555Z
|
||||
142328c284156e2c2ea05bbcbf19a163
|
||||
2009-09-15T17:15:33.045042Z
|
||||
151726
|
||||
daney
|
||||
2009-12-26T04:53:55.605975Z
|
||||
673e7f68577075b8b9f6a9da7fc13913
|
||||
2009-12-26T04:59:25.888276Z
|
||||
155470
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ daney
|
||||
|
||||
|
||||
|
||||
14437
|
||||
14490
|
||||
|
||||
o32.S
|
||||
file
|
||||
@@ -134,11 +134,11 @@ file
|
||||
|
||||
|
||||
|
||||
2009-12-20T06:01:55.709555Z
|
||||
8ab6839e93489a8417539b6953934de1
|
||||
2009-09-15T17:15:33.045042Z
|
||||
151726
|
||||
daney
|
||||
2009-12-26T04:53:55.604975Z
|
||||
d86a1ed07159fae7554dcb68210ad136
|
||||
2009-12-26T04:59:25.888276Z
|
||||
155470
|
||||
green
|
||||
|
||||
|
||||
|
||||
@@ -160,5 +160,5 @@ daney
|
||||
|
||||
|
||||
|
||||
25747
|
||||
26147
|
||||
|
||||
|
||||
@@ -625,7 +625,7 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
|
||||
{
|
||||
rvalue_copy = alloca (8);
|
||||
copy_rvalue = 1;
|
||||
#ifdef __MIPSEB__
|
||||
#if defined(__MIPSEB__) || defined(_MIPSEB)
|
||||
copy_offset = 4;
|
||||
#endif
|
||||
}
|
||||
@@ -772,9 +772,10 @@ ffi_closure_mips_inner_O32 (ffi_closure *closure,
|
||||
{
|
||||
if (i < 2 && !seen_int &&
|
||||
(arg_types[i]->type == FFI_TYPE_FLOAT ||
|
||||
arg_types[i]->type == FFI_TYPE_DOUBLE))
|
||||
arg_types[i]->type == FFI_TYPE_DOUBLE ||
|
||||
arg_types[i]->type == FFI_TYPE_LONGDOUBLE))
|
||||
{
|
||||
#ifdef __MIPSEB__
|
||||
#if defined(__MIPSEB__) || defined(_MIPSEB)
|
||||
if (arg_types[i]->type == FFI_TYPE_FLOAT)
|
||||
avaluep[i] = ((char *) &fpr[i]) + sizeof (float);
|
||||
else
|
||||
@@ -931,10 +932,16 @@ ffi_closure_mips_inner_N32 (ffi_closure *closure,
|
||||
while (i < avn)
|
||||
{
|
||||
if (arg_types[i]->type == FFI_TYPE_FLOAT
|
||||
|| arg_types[i]->type == FFI_TYPE_DOUBLE)
|
||||
|| arg_types[i]->type == FFI_TYPE_DOUBLE
|
||||
|| arg_types[i]->type == FFI_TYPE_LONGDOUBLE)
|
||||
{
|
||||
argp = (argn >= 8 || soft_float) ? ar + argn : fpr + argn;
|
||||
#ifdef __MIPSEB__
|
||||
if ((arg_types[i]->type == FFI_TYPE_LONGDOUBLE) && ((unsigned)argp & (arg_types[i]->alignment-1)))
|
||||
{
|
||||
argp=(ffi_arg*)ALIGN(argp,arg_types[i]->alignment);
|
||||
argn++;
|
||||
}
|
||||
#if defined(__MIPSEB__) || defined(_MIPSEB)
|
||||
if (arg_types[i]->type == FFI_TYPE_FLOAT && argn < 8)
|
||||
avaluep[i] = ((char *) argp) + sizeof (float);
|
||||
else
|
||||
|
||||
@@ -28,7 +28,10 @@
|
||||
#define LIBFFI_TARGET_H
|
||||
|
||||
#ifdef linux
|
||||
#include <asm/sgidefs.h>
|
||||
# include <asm/sgidefs.h>
|
||||
#else
|
||||
# include <sgidefs.h>
|
||||
#endif
|
||||
# ifndef _ABIN32
|
||||
# define _ABIN32 _MIPS_SIM_NABI32
|
||||
# endif
|
||||
@@ -38,7 +41,6 @@
|
||||
# ifndef _ABIO32
|
||||
# define _ABIO32 _MIPS_SIM_ABI32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(_MIPS_SIM)
|
||||
-- something is very wrong --
|
||||
@@ -154,7 +156,8 @@
|
||||
# endif /* _MIPS_SIM==_ABI64 */
|
||||
#endif /* !FFI_MIPS_O32 */
|
||||
#else /* !LIBFFI_ASM */
|
||||
#ifdef FFI_MIPS_O32
|
||||
# ifdef __GNUC__
|
||||
# ifdef FFI_MIPS_O32
|
||||
/* O32 stack frames have 32bit integer args */
|
||||
typedef unsigned int ffi_arg __attribute__((__mode__(__SI__)));
|
||||
typedef signed int ffi_sarg __attribute__((__mode__(__SI__)));
|
||||
@@ -162,7 +165,18 @@ typedef signed int ffi_sarg __attribute__((__mode__(__SI__)));
|
||||
/* N32 and N64 frames have 64bit integer args */
|
||||
typedef unsigned int ffi_arg __attribute__((__mode__(__DI__)));
|
||||
typedef signed int ffi_sarg __attribute__((__mode__(__DI__)));
|
||||
#endif
|
||||
# endif
|
||||
# else
|
||||
# ifdef FFI_MIPS_O32
|
||||
/* O32 stack frames have 32bit integer args */
|
||||
typedef __uint32_t ffi_arg;
|
||||
typedef __int32_t ffi_sarg;
|
||||
# else
|
||||
/* N32 and N64 frames have 64bit integer args */
|
||||
typedef __uint64_t ffi_arg;
|
||||
typedef __int64_t ffi_sarg;
|
||||
# endif
|
||||
# endif /* __GNUC__ */
|
||||
|
||||
typedef enum ffi_abi {
|
||||
FFI_FIRST_ABI = 0,
|
||||
|
||||
@@ -40,7 +40,9 @@
|
||||
|
||||
#define SIZEOF_FRAME ( 8 * FFI_SIZEOF_ARG )
|
||||
|
||||
#ifdef linux
|
||||
.abicalls
|
||||
#endif
|
||||
.text
|
||||
.align 2
|
||||
.globl ffi_call_N32
|
||||
@@ -527,6 +529,7 @@ cls_epilogue:
|
||||
.LFE2:
|
||||
.end ffi_closure_N32
|
||||
|
||||
#ifdef linux
|
||||
.section .eh_frame,"aw",@progbits
|
||||
.Lframe1:
|
||||
.4byte .LECIE1-.LSCIE1 # length
|
||||
@@ -583,5 +586,6 @@ cls_epilogue:
|
||||
.uleb128 (SIZEOF_FRAME2 - RA_OFF2)/4
|
||||
.align EH_FRAME_ALIGN
|
||||
.LEFDE3:
|
||||
#endif /* linux */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/pa
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/powerpc
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/s390
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/sh
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/sh64
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/sparc
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/src/x86
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/testsuite
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
@@ -32,7 +32,7 @@ file
|
||||
|
||||
|
||||
|
||||
2009-12-20T06:01:58.004568Z
|
||||
2009-12-26T04:20:27.164225Z
|
||||
df80bf4b915a2a2ea84b85d1004cd2b6
|
||||
2009-12-05T17:18:53.298892Z
|
||||
155012
|
||||
|
||||
@@ -53,7 +53,6 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_LTLDFLAGS = @AM_LTLDFLAGS@
|
||||
AM_RUNTESTFLAGS =
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/testsuite/config
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/testsuite/lib
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/testsuite/libffi.call
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: Blake Chaffin 6/6/2007 */
|
||||
|
||||
/* { dg-do run { xfail arm*-*-* strongarm*-*-* xscale*-*-* } } */
|
||||
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
|
||||
#include "ffitest.h"
|
||||
|
||||
static void
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
Originator: Blake Chaffin */
|
||||
|
||||
/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
|
||||
/* { dg-do run { xfail arm*-*-* strongarm*-*-* xscale*-*-* } } */
|
||||
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
|
||||
/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
|
||||
/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: Blake Chaffin 6/6/2007 */
|
||||
|
||||
/* { dg-do run { xfail arm*-*-* strongarm*-*-* xscale*-*-* } } */
|
||||
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
|
||||
/* { dg-output "" { xfail x86_64-*-mingw* } } */
|
||||
#include "ffitest.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: Blake Chaffin 6/6/2007 */
|
||||
|
||||
/* { dg-do run { xfail arm*-*-* strongarm*-*-* xscale*-*-* } } */
|
||||
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
|
||||
#include "ffitest.h"
|
||||
|
||||
void* cls_pointer_fn(void* a1, void* a2)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: Blake Chaffin 6/7/2007 */
|
||||
|
||||
/* { dg-do run { xfail arm*-*-* strongarm*-*-* xscale*-*-* } } */
|
||||
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
|
||||
#include "ffitest.h"
|
||||
|
||||
static long dummyVar;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
10
|
||||
|
||||
dir
|
||||
155452
|
||||
155472
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc/trunk/libffi/testsuite/libffi.special
|
||||
svn+ssh://green@gcc.gnu.org/svn/gcc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user