summaryrefslogtreecommitdiff
path: root/libffi
diff options
context:
space:
mode:
authorandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-09 17:37:53 +0000
committerandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-09 17:37:53 +0000
commit06855f3ab7bf44ef20d680e005ae05e7f0697bb9 (patch)
treec28314a33b91f14b646d643523e7ac75c39fa73d /libffi
parent4db2a9dbeb1f3b3871a1967faa9d0d72d3042520 (diff)
downloadgcc-06855f3ab7bf44ef20d680e005ae05e7f0697bb9.tar.gz
2003-09-09 Andreas Tobler <a.tobler@schweiz.ch>
* src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct passing correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71238 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi')
-rw-r--r--libffi/ChangeLog5
-rw-r--r--libffi/src/powerpc/ffi.c16
2 files changed, 19 insertions, 2 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 19493bb2eed..bc9f28a62a6 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,8 @@
+2003-09-09 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct
+ passing correctly.
+
2003-09-09 Alan Modra <amodra@bigpond.net.au>
* configure: Regenerate.
diff --git a/libffi/src/powerpc/ffi.c b/libffi/src/powerpc/ffi.c
index 30ab7efb0c6..010050f91ba 100644
--- a/libffi/src/powerpc/ffi.c
+++ b/libffi/src/powerpc/ffi.c
@@ -853,8 +853,7 @@ ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue,
case FFI_TYPE_SINT32:
case FFI_TYPE_UINT32:
case FFI_TYPE_POINTER:
- case FFI_TYPE_STRUCT:
- /* there are 8 gpr registers used to pass values */
+ /* there are 8 gpr registers used to pass values */
if (ng < 8) {
avalue[i] = pgr;
ng++;
@@ -864,6 +863,19 @@ ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue,
pst++;
}
break;
+
+ case FFI_TYPE_STRUCT:
+ /* Structs are passed by reference. The address will appear in a
+ gpr if it is one of the first 8 arguments. */
+ if (ng < 8) {
+ avalue[i] = (void *) *pgr;
+ ng++;
+ pgr++;
+ } else {
+ avalue[i] = (void *) *pst;
+ pst++;
+ }
+ break;
case FFI_TYPE_SINT64:
case FFI_TYPE_UINT64: