Fix stack addressing
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@33 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
58720009d9
commit
b41f8cccc4
@ -134,9 +134,9 @@ static void up_popcontext(ubyte newsp) __naked
|
|||||||
|
|
||||||
void up_restorecontext(FAR struct xcptcontext *context)
|
void up_restorecontext(FAR struct xcptcontext *context)
|
||||||
{
|
{
|
||||||
int nbytes = context->nbytes;
|
int nbytes = context->nbytes;
|
||||||
FAR ubyte *src = context->stack;
|
FAR ubyte *src = context->stack;
|
||||||
FAR ubyte *dest = (FAR ubyte*)STACK_BASE;
|
NEAR ubyte *dest = (NEAR ubyte*)STACK_BASE;
|
||||||
|
|
||||||
/* Interrupts should be disabled for the following. up_popcontext() will
|
/* Interrupts should be disabled for the following. up_popcontext() will
|
||||||
* set the new interrupt state correctly.
|
* set the new interrupt state correctly.
|
||||||
@ -179,9 +179,9 @@ void up_restorestack(FAR struct xcptcontext *context)
|
|||||||
* context) from internal RAM to XRAM.
|
* context) from internal RAM to XRAM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ubyte nbytes = context->nbytes;
|
ubyte nbytes = context->nbytes;
|
||||||
FAR ubyte *src = context->stack;
|
FAR ubyte *src = context->stack;
|
||||||
FAR ubyte *dest = (FAR ubyte*)STACK_BASE;
|
NEAR ubyte *dest = (NEAR ubyte*)STACK_BASE;
|
||||||
|
|
||||||
while (nbytes--)
|
while (nbytes--)
|
||||||
{
|
{
|
||||||
|
@ -142,9 +142,9 @@ ubyte up_savecontext(FAR struct xcptcontext *context)
|
|||||||
* context) from internal RAM to XRAM.
|
* context) from internal RAM to XRAM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ubyte nbytes = sp - (STACK_BASE-1);
|
ubyte nbytes = sp - (STACK_BASE-1);
|
||||||
FAR ubyte *src = (FAR ubyte*)STACK_BASE;
|
NEAR ubyte *src = (NEAR ubyte*)STACK_BASE;
|
||||||
FAR ubyte *dest = context->stack;
|
FAR ubyte *dest = context->stack;
|
||||||
|
|
||||||
/* Then copy the stack info into the context structure */
|
/* Then copy the stack info into the context structure */
|
||||||
|
|
||||||
@ -191,9 +191,9 @@ void up_savestack(FAR struct xcptcontext *context)
|
|||||||
* context) from internal RAM to XRAM.
|
* context) from internal RAM to XRAM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ubyte nbytes = g_irqtos - (STACK_BASE-1);
|
ubyte nbytes = g_irqtos - (STACK_BASE-1);
|
||||||
FAR ubyte *src = (FAR ubyte*)STACK_BASE;
|
NEAR ubyte *src = (NEAR ubyte*)STACK_BASE;
|
||||||
FAR ubyte *dest = context->stack;
|
FAR ubyte *dest = context->stack;
|
||||||
|
|
||||||
context->nbytes = nbytes;
|
context->nbytes = nbytes;
|
||||||
while (nbytes--)
|
while (nbytes--)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user