Redirecting A7 is pretty scary unless you mask interrupts, which is probably
a really bad idea!
Is the stack being used up by numerous subroutine calls? Like in recursion?
If so can you re-write not using recursion? If you are creating a lot of
locals/automatic variables on the stack, can you create a stack or queue in
dynamic or storage memory for the variables?
Also, consider reading the article on accessing global variables in shared
libraries (similar technique to external code resources on the Mac). The
article is somewhere in the knowledge base - sorry I forgot the title. But,
then you could re-direct the variable storage there.
If the problem is subroutine calls - try reducing the number of arguments
passed to zero by using global/alternate storage to pass the info-around.
/fn
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ronald
Mercer
Sent: Tuesday, May 30, 2000 2:08 PM
To: Palm Developer Forum
Cc: [EMAIL PROTECTED]
Subject: Virtual Device Drivers and the stack
I am using a virtual device to manipulate packets as they are
entering/leaving
the serial port. My current difficulty is that I am now running out of
stack
space.
Question 1. The function SysGetStackInfo always returns false (indicating
stack
overflow) when called from my driver. Is this function suppose to work when
called from virtual device drivers or will it only work from applications.
Is
there any other way to determine the stack boundaries, and/or current stack
usage?
Possible solutions:
1. Walk through my code again and try to trim down stack usage.
Unfortunately
this will not gain me very much more.
2. Allocate some space from the heap and redirect the A7 register to point
at
the heap while it is in my driver. This is a Pandora's box I probably do
not
want to open.
Any other hints/solutions out there?
Ron Mercer
Certicom Inc.
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/