Add nesting support.

This commit is contained in:
Richard Barry 2008-05-04 17:36:23 +00:00
parent a9393b891d
commit 0eae0f7549
2 changed files with 139 additions and 88 deletions

View file

@ -51,6 +51,9 @@
* Implementation of functions defined in portable.h for the PIC32MX port.
*----------------------------------------------------------*/
/* Library includes. */
#include <string.h>
/* Scheduler include files. */
#include "FreeRTOS.h"
#include "task.h"
@ -71,6 +74,10 @@ the first task is being restored. */
/* Records the nesting depth of calls to portENTER_CRITICAL(). */
unsigned portBASE_TYPE uxCriticalNesting = 0x55555555;
/* Records the interrupt nesting depth. This starts at one as it will be
decremented to 0 when the first task starts. */
volatile unsigned portBASE_TYPE uxInterruptNesting = 0x01;
/* The stack used by interrupt service routines that cause a context switch. */
portSTACK_TYPE xISRStack[ configISR_STACK_SIZE ] = { 0 };
@ -180,6 +187,8 @@ portBASE_TYPE xPortStartScheduler( void )
{
extern void vPortStartFirstTask( void );
memset( xISRStack, 0x5a, configISR_STACK_SIZE * sizeof( portSTACK_TYPE ) );
/* Setup the timer to generate the tick. Interrupts will have been
disabled by the time we get here. */
prvSetupTimerInterrupt();