[Mono-dev] ARM PInvoke issue when using long

D M dm_mono_dev at yahoo.com
Tue Nov 14 04:29:36 EST 2006


I think the issue is with the mini-arm.c add_general (guint *gr, guint *stack_size, ArgInfo *ainfo, gboolean simple) function.
It doesn't work properly for MONO_TYPE_I8/MONO_TYPE_R8 if just the first half fits in one register and the other on the stack.
mono_arch_create_trampoline seems to handle this case.
Is there an easy fix ?

Thanks,

Dan
D M <dm_mono_dev at yahoo.com> wrote: Hi,

I don't really want to add the extra parameters to get around this issue.
Does anybody know if this is gonna get fixed and when ?

Thanks,

Dan

D M <dm_mono_dev at yahoo.com> wrote: Yes, that seems to work.

Dan

Bill Seurer <seurer at us.ibm.com> wrote: I am not familiar with ARM but I had to change a setting in order to get
the JIT to use the right registers for long longs on power on AIX.  Some
architectures require that things too long to fit in a register be passed
starting in only even (or was it odd?) registers.  If you insert another
int between the two long longs (n2 and n3) in your test and it works that
is probably the problem.

I looked and  it was the define ALIGN_DOUBLES in mini-ppc.c.  There's no
such thing in mini-arm.c but maybe the same sort of thing is happening or
not happening as the case may be.
--
Bill Seurer     IBM System i5 internal compiler development   Rochester, MN
Business: seurer at us.ibm.com                         Home:  Bill at seurer.net
http://w3.rchland.ibm.com/~seurer/                  http://www.seurer.net


mono-devel-list-bounces at lists.ximian.com wrote on 11/07/2006 06:32:14 PM:

> Hi,
>
> It seems there is an issue with mono PInvoke on a 32 bit ARM platform.
> If I have a native method declared as:
>
> [DllImport("MyDll")]
> static extern long Test1(int n1, long n2, long n3, int n4, long n5);
>
> extern "C"
> long long Test1(int n1, long long n2, long long n3, int n4, long long n5)
> {
>     printf("Test1 %d,%lld,%lld,%d,%lld\n",
>             n1,
>             n2,
>              n3,
>             n4,
>             n5);
>
>     return 12345;
> }
> and I invoke with the following parameters:
>
> Test1(1, 2, 3, 4, 5);
>
> the result is:
>
> Test1 1,2,12884901888,0,21474836484
>
> 12884901888 =  0x300000000
> 21474836484 = 0x500000004
>
> Dan
>  Get your email and see which of your friends are online - Right on the
> new Yahoo.com _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

    

---------------------------------
Sponsored Link

 $200,000 mortgage for $660/mo - 30/15 yr fixed, reduce debt,  home equity - Click now for info_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

    

---------------------------------
Sponsored Link 
 
Talk more and pay less. Vonage can save you up to $300 a year on your phone bill. Sign up now._______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


 
---------------------------------
Everyone is raving about the all-new Yahoo! Mail beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061114/6755975a/attachment.html 


More information about the Mono-devel-list mailing list