Please keep in mind:
- an int is 16 bit in 68k and 32 bit in ARM. Avoid using int use short
(always 16 bit) and long (always 32 bit) instead?
Also: is the address of your instance of MyARMStructure on a 4 byte
boundary (&myARMStructure & 0x3L == 0)? Do the following to make sure it
is:
- char *myChunk = (char *) MemPtrNew(sizeof(MyARMStructure) + 2);
- if (myChunk & 0x3L != 0) myPtr = (MyARMStructure*)
(myChunk + 2);
else myPtr =
(MyARMStructure*) myChunk;
Now copy you instance of MyARMStructure to myPtr and you should be fine!
Good luck,
Caspar
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
munroel
Sent: Thursday, November 13, 2003 9:39 PM
To: Palm Developer Forum
Subject: ARM UserData68KP
Hi All
I am trying to pass a structure including a pointer to my Arm routine,
modify
the values of the pointer and return the pointer to my 68K app. The
structure
is as follows:
typedef struct MyARMStructure {
int *recordPtr;
unsigned short frequency;
} MyARMStructure;
When I pass this structure to my ARM routine it crashes. However if I
Pass
only the pointer as the userData68KP argument it works fine. Does
anyone know
why this is the case, or how I might avoid this problem. I have done
all the
byte swaping that is necessary, and still the same result. Please
help..
Thanks....
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/