[Ecls-list] Dynamic FFI/callback for x86_64 platforms

Goffioul Michael goffioul at imec.be
Tue Jun 6 12:16:56 UTC 2006


Hi all,

I spent some time to implement dynamic FFI/callback under x86-64
platform,
and the result is in attachment. This is not very different from x86
implementation except that you have to use special registers and align
on 8/16 bytes instead of 4.
This implementation only support Linux ABI, as I don't have any access
to
a Win64 platform.

I'm not sure I should commit in this form, especially as the patch
introduce
platform-dependent code in internal.h and I'm not sure this is a good
thing.

There's also something I'm not sure about, not being a platform expert;
maybe
someone will have some ideas. The Linux ABI doc states that the return
value
of a function should be placed:
1) for integers: in the next available register of the list RAX, RDX
2) for floating-point: in the next available register of the list XMM0,
XMM1
How does a caller know where the return value is actually located?
(sorry for
this potential stupid question)

Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffi_x86_64.diff.bz2
Type: application/octet-stream
Size: 1173 bytes
Desc: ffi_x86_64.diff.bz2
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060606/4cd2120b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffi_x86_64.d.bz2
Type: application/octet-stream
Size: 2430 bytes
Desc: ffi_x86_64.d.bz2
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060606/4cd2120b/attachment-0001.obj>


More information about the ecl-devel mailing list