Hello, everyone,

I'm currently writing an application (using prc-tools 2.0) which
emulates a processor with several 64 bit registers. In order to achieve
maximum emulation performance, I map the processor's two most frequently
used registers directly to the Palm's 68k registers:

typedef unsigned long long u8;
...
register u8 reg1 __asm__("d6");
register u8 reg2 __asm__("d4");

This maps reg1 to the data registers D6 and D7, and reg2 to D4 and D5.
reg1 and reg2 are global to the application.

My application is rather large, and I had to break it up into 8
additional code resources using multigen etc. Initialization of reg1,
reg2 happens inside the main code resource, reg. modifications are done
in several extra code resources.

Compiling and running the app worked really fine, with one exception:
After calling the application 14 times, during the 15th run, I get 8
subsequent fatal alerts:

"MemoryMgr.c, Line:3036, Chunk over-locked".

This seems to happen during processing the startup code.

I suspect, that these overlocks appear with respect to the code
resources. I'm absolutely sure that these alerts aren't due to any
MemHandleLock/MemHandleUnlock mismatches in my application.

Curiously enough, if I replace the definition of reg2 by

u8 reg2;

the Chunk-overlocked alerts do not appear anymore.

Anyone, who can explain me what happens here? Are D4,D5 used by the
startup code, particularly with respect to extra code resources?

I essentially need to map reg2 to 68k registers, so any idea better than
"just don't use D4 and D5" would be very helpful.

Cheers,

Hans B. Abel


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to