FFI plugin 64 bit updates (not yet)

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

FFI plugin 64 bit updates (not yet)

David T. Lewis
 
I have been working on updating FFI for 64 bit hosts (Linux). I've
made some progress, but am well short of completing it. I work on
this sporatically, so it may be a while before I can report success.

I mention it here because:

1) If anyone else is working on this, please speak up so I don't duplicate
the work.

2) I will need help from others to complete this, in order to cover
the range of platforms and to integrate changes into the platforms
sources and VMMaker.

I trust that there is general interest in getting this done, but be
warned that I'll be asking some dumb questions and I will need help
to cover the range of supported platforms.

Thanks
Dave

Reply | Threaded
Open this post in threaded view
|

Re: FFI plugin 64 bit updates (not yet)

johnmci
 
Ah well maybe you can merge the two FFI assembler sets for os-x, the  
one I created and the one from Ian's unix tree.

I note the one from the unix tree is incorrect, it does not properly  
do the boundary alignments so then quicktime FFI calls later fail in  
vector processing code on
a memory alignment exception.

This of course is only triggered if you invoke quicktime via FFI on OS-
X.

On Mar 21, 2008, at 8:12 AM, David T. Lewis wrote:

>
> I have been working on updating FFI for 64 bit hosts (Linux). I've
> made some progress, but am well short of completing it. I work on
> this sporatically, so it may be a while before I can report success.
>
> I mention it here because:
>
> 1) If anyone else is working on this, please speak up so I don't  
> duplicate
> the work.
>
> 2) I will need help from others to complete this, in order to cover
> the range of platforms and to integrate changes into the platforms
> sources and VMMaker.
>
> I trust that there is general interest in getting this done, but be
> warned that I'll be asking some dumb questions and I will need help
> to cover the range of supported platforms.
>
> Thanks
> Dave
>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================


Reply | Threaded
Open this post in threaded view
|

Re: FFI plugin 64 bit updates (not yet)

David T. Lewis
 
On Fri, Mar 21, 2008 at 09:56:10AM -0700, John M McIntosh wrote:

> On Mar 21, 2008, at 8:12 AM, David T. Lewis wrote:
> >
> >I have been working on updating FFI for 64 bit hosts (Linux).
> >
>
> Ah well maybe you can merge the two FFI assembler sets for os-x, the  
> one I created and the one from Ian's unix tree.
>
> I note the one from the unix tree is incorrect, it does not properly  
> do the boundary alignments so then quicktime FFI calls later fail in  
> vector processing code on
> a memory alignment exception.
>
> This of course is only triggered if you invoke quicktime via FFI on OS-
> X.
>

Actually I am working with the cdecl implementation that Andreas wrote,
in platforms/unix/plugins/SqueakFFIPrims/any-libffi.c. My plan has been
to get this working on 64 bits, then move all the changes back to a 32 bit
Linux and get them working there with the apicall interface (x86-sysv-asm.S),
and then come back to the list to beg for help.

Why that approach? Because I don't know how to write the assembler routine
to set up a stack frame for 64 bit Linux. And that's only one of the reasons
that I warned you to expect some dumb questions ;)

So here comes the first of the dumb questions: Do you have an assembler
implementation that sets up a call stack for a 64 bit system, and that
would work on Linux as well as OS X? I had assumed that the conventions
would be completely different for 32 bit and 64 bit systems, but I did
not even bother to google the topic to find out.

Dave

Reply | Threaded
Open this post in threaded view
|

Re: FFI plugin 64 bit updates (not yet)

johnmci
 
Apple has a helpful document here

http://developer.apple.com/documentation/DeveloperTools/Conceptual/LowLevelABI/Introduction.html



On Mar 21, 2008, at 11:54 AM, David T. Lewis wrote:

>
> On Fri, Mar 21, 2008 at 09:56:10AM -0700, John M McIntosh wrote:
>> On Mar 21, 2008, at 8:12 AM, David T. Lewis wrote:
>>>
>>> I have been working on updating FFI for 64 bit hosts (Linux).
>>>
>>
>> Ah well maybe you can merge the two FFI assembler sets for os-x, the
>> one I created and the one from Ian's unix tree.
>>
>> I note the one from the unix tree is incorrect, it does not properly
>> do the boundary alignments so then quicktime FFI calls later fail in
>> vector processing code on
>> a memory alignment exception.
>>
>> This of course is only triggered if you invoke quicktime via FFI on  
>> OS-
>> X.
>>
>
> Actually I am working with the cdecl implementation that Andreas  
> wrote,
> in platforms/unix/plugins/SqueakFFIPrims/any-libffi.c. My plan has  
> been
> to get this working on 64 bits, then move all the changes back to a  
> 32 bit
> Linux and get them working there with the apicall interface (x86-
> sysv-asm.S),
> and then come back to the list to beg for help.
>
> Why that approach? Because I don't know how to write the assembler  
> routine
> to set up a stack frame for 64 bit Linux. And that's only one of the  
> reasons
> that I warned you to expect some dumb questions ;)
>
> So here comes the first of the dumb questions: Do you have an  
> assembler
> implementation that sets up a call stack for a 64 bit system, and that
> would work on Linux as well as OS X? I had assumed that the  
> conventions
> would be completely different for 32 bit and 64 bit systems, but I did
> not even bother to google the topic to find out.
>
> Dave
>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================