From: richardbarry Date: Wed, 15 Jun 2011 08:39:45 +0000 (+0000) Subject: Small tidy up of the new MicroBlaze port layer. X-Git-Tag: V7.0.2~152 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=83d1189b10b7288e600b5fdfc71da5e1058d3020;p=freertos Small tidy up of the new MicroBlaze port layer. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1458 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/port.c b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/port.c index 05710e90b..38d271c55 100644 --- a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/port.c +++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/port.c @@ -68,16 +68,16 @@ #include #include #include - -/* Tasks are started with interrupts disabled as they will have their interrupts -enabled as the task starts (when its context is restored for the first time). */ -#define portINITIAL_MSR_STATE ( ( portSTACK_TYPE ) 0x00 ) +#include /* Tasks are started with a critical section nesting of 0 - however prior to the scheduler being commenced we don't want the critical nesting level to reach zero, so it is initialised to a high value. */ #define portINITIAL_NESTING_VALUE ( 0xff ) +/* The bit within the MSR register that enabled/disables interrupts. */ +#define portMSR_IE ( 0x02U ) + /*-----------------------------------------------------------*/ /* @@ -119,19 +119,6 @@ extern void *_SDA2_BASE_, *_SDA_BASE_; const unsigned long ulR2 = ( unsigned long ) &_SDA2_BASE_; const unsigned long ulR13 = ( unsigned long ) &_SDA_BASE_; -#if 0 -//_RB_ - #ifdef XPAR_MICROBLAZE_USE_ICACHE - microblaze_invalidate_icache(); - microblaze_enable_icache(); - #endif - - #ifdef XPAR_MICROBLAZE_USE_DCACHE - microblaze_invalidate_dcache(); - microblaze_enable_dcache(); - #endif -#endif - /* Place a few bytes of known values on the bottom of the stack. This is essential for the Microblaze port and these lines must not be omitted. The parameter value will overwrite the @@ -219,8 +206,10 @@ const unsigned long ulR13 = ( unsigned long ) &_SDA_BASE_; *pxTopOfStack = ( portSTACK_TYPE ) 0x1e; /* R30 - must be saved across function calls. Callee-save. */ pxTopOfStack--; - /* The MSR is stacked between R30 and R31. */ - *pxTopOfStack = portINITIAL_MSR_STATE; + /* The MSR is stacked between R30 and R31. This should have interrupts + disabled. Each task will enable interrupts automatically when it enters + the running state for the first time. */ + *pxTopOfStack = mfmsr() & ~portMSR_IE; pxTopOfStack--; *pxTopOfStack = ( portSTACK_TYPE ) 0x1f; /* R31 - must be saved across function calls. Callee-save. */