Commit 086a4bd7 by Andreas Tobler Committed by Andreas Tobler

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

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

From-SVN: r71238
parent f0985900
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.
......
...@@ -853,7 +853,6 @@ ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue, ...@@ -853,7 +853,6 @@ 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;
...@@ -865,6 +864,19 @@ ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue, ...@@ -865,6 +864,19 @@ ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue,
} }
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:
/* passing long long ints are complex, they must /* passing long long ints are complex, they must
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment