2003-09-09 Andreas Tobler <a.tobler@schweiz.ch>

* src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct
	passing correctly.

From-SVN: r71238
This commit is contained in:
Andreas Tobler 2003-09-09 19:37:53 +02:00 committed by Andreas Tobler
parent f098590080
commit 086a4bd7dd
2 changed files with 19 additions and 2 deletions

View File

@ -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> 2003-09-09 Alan Modra <amodra@bigpond.net.au>
* configure: Regenerate. * configure: Regenerate.

View File

@ -853,8 +853,7 @@ ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue,
case FFI_TYPE_SINT32: case FFI_TYPE_SINT32:
case FFI_TYPE_UINT32: case FFI_TYPE_UINT32:
case FFI_TYPE_POINTER: 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) { if (ng < 8) {
avalue[i] = pgr; avalue[i] = pgr;
ng++; ng++;
@ -864,6 +863,19 @@ ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue,
pst++; pst++;
} }
break; 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_SINT64:
case FFI_TYPE_UINT64: case FFI_TYPE_UINT64: