FFI 64-bit updates - progress report

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FFI 64-bit updates - progress report

David T. Lewis
 
I now have FFI working on a 64-bit AMD Linux system for both 32-bit and 64-bit
images. All unit tests pass, including some new tests that I added to provide
more coverage of the FFI primitives. The X11Display examples also work.

This is using the "cdecl" interface in platforms/unix/plugins/SqueakFFIPrims/lib-anyffi.c.
The next step will be to move the changes to a 32 bit Linux system and do the updates
to platforms/unix/plugins/SqueakFFIPrims/x86-sysv.c.

This is work in progress, but I'm attaching a snapshot of the work that I have
done so far. There are changes to the VM, the FFI plugin, and to the FFI support
classes in the image (note: after applying the changes, classes with cdecl pragmas
must be recompiled).

More to follow,

Dave


ffi-patches-dtl.zip (27K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FFI 64-bit updates - progress report

David T. Lewis
 
Resending with the correct zip file. Please ignore the earlier attachment,
which was out of date.

Dave

On Sun, Mar 30, 2008 at 03:26:23PM -0400, David T. Lewis wrote:

>  
> I now have FFI working on a 64-bit AMD Linux system for both 32-bit and 64-bit
> images. All unit tests pass, including some new tests that I added to provide
> more coverage of the FFI primitives. The X11Display examples also work.
>
> This is using the "cdecl" interface in platforms/unix/plugins/SqueakFFIPrims/lib-anyffi.c.
> The next step will be to move the changes to a 32 bit Linux system and do the updates
> to platforms/unix/plugins/SqueakFFIPrims/x86-sysv.c.
>
> This is work in progress, but I'm attaching a snapshot of the work that I have
> done so far. There are changes to the VM, the FFI plugin, and to the FFI support
> classes in the image (note: after applying the changes, classes with cdecl pragmas
> must be recompiled).
>
> More to follow,
>
> Dave
>


ffi-patches-dtl.zip (28K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FFI 64-bit updates - progress report

David T. Lewis
In reply to this post by David T. Lewis
 
This is an update on the status of changes for 32/64 bit clean FFI. I have
attached a snapshot of my current changes.

Overall changes involve:
 - Add FFIPlugin>>primitiveSizeOfPointer for runtime address size check
 - ExternalAddress is either 4 or 8 bytes wide, initialized at image startup
 - Remove all casts from pointer to int for FFI plugin and interpreter
   (VM minor version bump)
 - Recompile all methods with cdecl or apicall pragmas (must to done for an
   image to run properly on a 64 bit host)

Platform FFI testing as of Sat Apr 19 18:39:01 EDT 2008
"GREEN" means no compiler warnings, all SUnits pass, and the X window examples work.

======================================================================================================
VM     config.guess             FFI implementiation             host     image      status
--     ------------             -------------------             ----     -----      ------
unix   i686-pc-linux-gnu        x86-sysv.c+x86-sysv-asm.S       32 bit   32 bit     GREEN
unix   i686-pc-linux-gnu        x86-sysv.c+x86-sysv-asm.S       32 bit   64 bit     GREEN
unix   i686-pc-linux-gnu        any-libffi.c                    32 bit   32 bit     GREEN
unix   i686-pc-linux-gnu        any-libffi.c                    32 bit   64 bit     GREEN
unix   x86_64-unknown-linux-gnu any-libffi.c                    64 bit   32 bit     GREEN
unix   x86_64-unknown-linux-gnu any-libffi.c                    64 bit   64 bit     GREEN
unix   x86_64-unknown-linux-gnu x86_64-sysv.c+x86_64_sysv-asm.S 64 bit   32 bit     Not implemented(*)
unix   x86_64-unknown-linux-gnu x86_64-sysv.c+x86_64_sysv-asm.S 64 bit   64 bit     Not implemented(*)
unix                            ppc-darwin.c+ppc-darwin-asm.S   ?        32 bit     tbd
unix                            ppc-darwin.c+ppc-darwin-asm.S   ?        64 bit     tbd
unix                            ppc-sysv.c+ppc-sysv-asm.S       ?        32 bit     tbd
unix                            ppc-darwin.c+ppc-darwin-asm.S   ?        64 bit     tbd
win32  32 bit Windows on AMD64  sqWin32FFI.c                    32 bit   32 bit     tbd
win32  32 bit Windows on AMD64  sqWin32FFI.c                    32 bit   64 bit     tbd
Mac OS ... (should be easy update)
RiscOS ... (no FFI implementation?)

(*) Is anyone willing and/or able to write a x86_64_sysv-asm.S? I could do the
corresponding x86_64-sysv.c, but could use some help on how to set up a 64 bit
call stack in assembler, never did that before.

- Dave


ffi-patches-4-dtl.zip (31K) Download Attachment