mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Change the Win32 port layer so it doesn't use the traceTASK_DELETE macro, but instead the new portCLEAN_UP_TCB macro.
This commit is contained in:
parent
8baa0ac171
commit
bbbdd9c393
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
FreeRTOS V7.1.0 - Copyright (C) 2011 Real Time Engineers Ltd.
|
FreeRTOS V7.1.1-rc1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
|
@ -77,7 +77,6 @@ static void prvProcessSimulatedInterrupts( void );
|
||||||
* Interrupt handlers used by the kernel itself. These are executed from the
|
* Interrupt handlers used by the kernel itself. These are executed from the
|
||||||
* simulated interrupt handler thread.
|
* simulated interrupt handler thread.
|
||||||
*/
|
*/
|
||||||
static unsigned long prvProcessDeleteThreadInterrupt( void );
|
|
||||||
static unsigned long prvProcessYieldInterrupt( void );
|
static unsigned long prvProcessYieldInterrupt( void );
|
||||||
static unsigned long prvProcessTickInterrupt( void );
|
static unsigned long prvProcessTickInterrupt( void );
|
||||||
|
|
||||||
|
@ -150,7 +149,7 @@ portTickType xMinimumWindowsBlockTime = ( portTickType ) 20;
|
||||||
{
|
{
|
||||||
Sleep( portTICK_RATE_MS );
|
Sleep( portTICK_RATE_MS );
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitForSingleObject( pvInterruptEventMutex, INFINITE );
|
WaitForSingleObject( pvInterruptEventMutex, INFINITE );
|
||||||
|
|
||||||
/* The timer has expired, generate the simulated tick event. */
|
/* The timer has expired, generate the simulated tick event. */
|
||||||
|
@ -204,7 +203,6 @@ xThreadState *pxThreadState;
|
||||||
/* Install the interrupt handlers used by the scheduler itself. */
|
/* Install the interrupt handlers used by the scheduler itself. */
|
||||||
vPortSetInterruptHandler( portINTERRUPT_YIELD, prvProcessYieldInterrupt );
|
vPortSetInterruptHandler( portINTERRUPT_YIELD, prvProcessYieldInterrupt );
|
||||||
vPortSetInterruptHandler( portINTERRUPT_TICK, prvProcessTickInterrupt );
|
vPortSetInterruptHandler( portINTERRUPT_TICK, prvProcessTickInterrupt );
|
||||||
vPortSetInterruptHandler( portINTERRUPT_DELETE_THREAD, prvProcessDeleteThreadInterrupt );
|
|
||||||
|
|
||||||
/* Create the events and mutexes that are used to synchronise all the
|
/* Create the events and mutexes that are used to synchronise all the
|
||||||
threads. */
|
threads. */
|
||||||
|
@ -270,12 +268,6 @@ xThreadState *pxThreadState;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static unsigned long prvProcessDeleteThreadInterrupt( void )
|
|
||||||
{
|
|
||||||
return pdTRUE;
|
|
||||||
}
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
static unsigned long prvProcessYieldInterrupt( void )
|
static unsigned long prvProcessYieldInterrupt( void )
|
||||||
{
|
{
|
||||||
return pdTRUE;
|
return pdTRUE;
|
||||||
|
@ -361,15 +353,7 @@ void *pvObjectList[ 2 ];
|
||||||
{
|
{
|
||||||
/* Suspend the old thread. */
|
/* Suspend the old thread. */
|
||||||
pxThreadState = ( xThreadState *) *( ( unsigned long * ) pvOldCurrentTCB );
|
pxThreadState = ( xThreadState *) *( ( unsigned long * ) pvOldCurrentTCB );
|
||||||
|
SuspendThread( pxThreadState->pvThread );
|
||||||
if( ( ulSwitchRequired & ( 1 << portINTERRUPT_DELETE_THREAD ) ) != pdFALSE )
|
|
||||||
{
|
|
||||||
TerminateThread( pxThreadState->pvThread, 0 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SuspendThread( pxThreadState->pvThread );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Obtain the state of the task now selected to enter the
|
/* Obtain the state of the task now selected to enter the
|
||||||
Running state. */
|
Running state. */
|
||||||
|
@ -387,23 +371,13 @@ void vPortDeleteThread( void *pvTaskToDelete )
|
||||||
{
|
{
|
||||||
xThreadState *pxThreadState;
|
xThreadState *pxThreadState;
|
||||||
|
|
||||||
if( pvTaskToDelete == pxCurrentTCB )
|
WaitForSingleObject( pvInterruptEventMutex, INFINITE );
|
||||||
{
|
|
||||||
/* The task is deleting itself, and so the thread that is running now
|
|
||||||
is also to be deleted. This has to be deferred until this thread is
|
|
||||||
no longer running, so its done in the simulated interrupt handler thread. */
|
|
||||||
vPortGenerateSimulatedInterrupt( portINTERRUPT_DELETE_THREAD );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
WaitForSingleObject( pvInterruptEventMutex, INFINITE );
|
|
||||||
|
|
||||||
/* Find the handle of the thread being deleted. */
|
/* Find the handle of the thread being deleted. */
|
||||||
pxThreadState = ( xThreadState * ) ( *( unsigned long *) pvTaskToDelete );
|
pxThreadState = ( xThreadState * ) ( *( unsigned long *) pvTaskToDelete );
|
||||||
TerminateThread( pxThreadState->pvThread, 0 );
|
TerminateThread( pxThreadState->pvThread, 0 );
|
||||||
|
|
||||||
ReleaseMutex( pvInterruptEventMutex );
|
ReleaseMutex( pvInterruptEventMutex );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
FreeRTOS V7.1.0 - Copyright (C) 2011 Real Time Engineers Ltd.
|
FreeRTOS V7.1.1-rc1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
#define portYIELD() vPortGenerateSimulatedInterrupt( portINTERRUPT_YIELD )
|
#define portYIELD() vPortGenerateSimulatedInterrupt( portINTERRUPT_YIELD )
|
||||||
|
|
||||||
void vPortDeleteThread( void *pvThreadToDelete );
|
void vPortDeleteThread( void *pvThreadToDelete );
|
||||||
#define traceTASK_DELETE( pxTCB ) vPortDeleteThread( pxTCB )
|
#define portCLEAN_UP_TCB( pxTCB ) vPortDeleteThread( pxTCB )
|
||||||
#define portDISABLE_INTERRUPTS()
|
#define portDISABLE_INTERRUPTS()
|
||||||
#define portENABLE_INTERRUPTS()
|
#define portENABLE_INTERRUPTS()
|
||||||
|
|
||||||
|
@ -102,7 +102,6 @@ void vPortExitCritical( void );
|
||||||
|
|
||||||
#define portINTERRUPT_YIELD ( 0UL )
|
#define portINTERRUPT_YIELD ( 0UL )
|
||||||
#define portINTERRUPT_TICK ( 1UL )
|
#define portINTERRUPT_TICK ( 1UL )
|
||||||
#define portINTERRUPT_DELETE_THREAD ( 2UL )
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Raise a simulated interrupt represented by the bit mask in ulInterruptMask.
|
* Raise a simulated interrupt represented by the bit mask in ulInterruptMask.
|
||||||
|
|
Loading…
Reference in a new issue