summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <walsimou@walsimou.com>2009-04-09 16:26:28 +0200
committerAbdoulaye Walsimou Gaye <walsimou@walsimou.com>2009-04-09 16:26:28 +0200
commit064ce05f16cd3b58950ccb174b82e61f362e4318 (patch)
tree2f4a689c97d4399fb972b1a14d1b90b9f08c6fbb
parent8ab4d5eb446cdd5b31b2c1f52f4344b0b147a5df (diff)
downloadfreertos-064ce05f16cd3b58950ccb174b82e61f362e4318.tar.gz
freertos-064ce05f16cd3b58950ccb174b82e61f362e4318.tar.bz2
freertos-064ce05f16cd3b58950ccb174b82e61f362e4318.tar.xz
PIC18_SDCC: save and restore context
This patch modifies the way that context are saved and restored in order to do it in a same manner that SDCC do it when it generates codes. signed-off-by: Gaye Abdoulaye Walsimou <walsimou@walsimou.com>
-rw-r--r--Source/portable/SDCC/PIC18/port.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/Source/portable/SDCC/PIC18/port.c b/Source/portable/SDCC/PIC18/port.c
index 3ca08ae7..6abaa737 100644
--- a/Source/portable/SDCC/PIC18/port.c
+++ b/Source/portable/SDCC/PIC18/port.c
@@ -36,7 +36,7 @@
/*----------------------------------------------------------------------
* Heap needed by memory management (malloc.h) in SDCC
*----------------------------------------------------------------------*/
-volatile __data unsigned char heap[configTOTAL_HEAP_SIZE];
+__data unsigned char heap[configTOTAL_HEAP_SIZE];
/*----------------------------------------------------------------------
* Implementation of functions defined in portable.h for the PIC18 port.
@@ -118,40 +118,39 @@ portSTACK_TYPE *pxPortInitialiseStack(portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
*pxTopOfStack = (portSTACK_TYPE)0x22; /* BSR. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0x33; /* FSR0L. */
+ *pxTopOfStack = (portSTACK_TYPE)0x33; /* PRODL. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0x44; /* FSR0H. */
+ *pxTopOfStack = (portSTACK_TYPE)0x44; /* PRODH. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0x55; /* FSR2L. */
+ *pxTopOfStack = (portSTACK_TYPE)0x55; /* FSR0L. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0x66; /* FSR2H. */
+ *pxTopOfStack = (portSTACK_TYPE)0x66; /* FSR0H. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0x77; /* TABLAT. */
+ *pxTopOfStack = (portSTACK_TYPE)0x77; /* PCLATH. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0x88; /* TBLPTRL. */
+ *pxTopOfStack = (portSTACK_TYPE)0x88; /* PCLATU. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0x99; /* TBLPTRH. */
+ *pxTopOfStack = (portSTACK_TYPE)0x99; /* FSR2H. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0xaa; /* TBLPTRU. */
+ *pxTopOfStack = (portSTACK_TYPE)0xaa; /* FSR2L. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0xbb; /* PRODL. */
+ *pxTopOfStack = (portSTACK_TYPE)0xbb; /* TABLAT. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0xcc; /* PRODH. */
+ *pxTopOfStack = (portSTACK_TYPE)0xcc; /* TBLPTRL. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0xdd; /* PCLATH. */
+ *pxTopOfStack = (portSTACK_TYPE)0xdd; /* TBLPTRH. */
pxTopOfStack--;
- *pxTopOfStack = (portSTACK_TYPE)0xee; /* PCLATU. */
+ *pxTopOfStack = (portSTACK_TYPE)0xee; /* TBLPTRU. */
pxTopOfStack--;
-
/* Next the .registers sections. Assuming that it is portCOMPILER_MANAGED_MEMORY_SIZE*/
for( ucBlock = 0; ucBlock <portCOMPILER_MANAGED_MEMORY_SIZE; ucBlock++ )
{
@@ -175,7 +174,7 @@ portSTACK_TYPE *pxPortInitialiseStack(portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
pxTopOfStack--;
ulAddress >>= 8;
/* TOS Upper. */
- *pxTopOfStack = (portSTACK_TYPE)(ulAddress & (unsigned portLONG)0x00ff );
+ *pxTopOfStack = (portSTACK_TYPE)(ulAddress & (unsigned portLONG)0x00ff);
pxTopOfStack--;
/* Store the number of return addresses on the hardware stack - so far only