Kernel updates:

+ Added vTimerSetTimerID() to compliment vTimerGetTimerID().  Now the timer ID can be used as timer local storage.
+ Updated comments and added some additional assert() calls.

Win32 port:
+ Some changes to allow easier 64-bit builds

PIC24/dsPIC port:
+ Added NOP after disable interrupt instruction.
This commit is contained in:
Richard Barry 2015-02-11 15:41:30 +00:00
parent dfdc319518
commit 86b09bfeb9
13 changed files with 153 additions and 55 deletions

View file

@ -322,7 +322,7 @@ xThreadState *pxThreadState;
/* Start the highest priority task by obtaining its associated thread
state structure, in which is stored the thread handle. */
pxThreadState = ( xThreadState * ) *( ( uint32_t * ) pxCurrentTCB );
pxThreadState = ( xThreadState * ) *( ( size_t * ) pxCurrentTCB );
ulCriticalNesting = portNO_CRITICAL_NESTING;
/* Bump up the priority of the thread that is going to run, in the
@ -422,12 +422,12 @@ void *pvObjectList[ 2 ];
if( pvOldCurrentTCB != pxCurrentTCB )
{
/* Suspend the old thread. */
pxThreadState = ( xThreadState *) *( ( uint32_t * ) pvOldCurrentTCB );
pxThreadState = ( xThreadState *) *( ( size_t * ) pvOldCurrentTCB );
SuspendThread( pxThreadState->pvThread );
/* Obtain the state of the task now selected to enter the
Running state. */
pxThreadState = ( xThreadState * ) ( *( uint32_t *) pxCurrentTCB );
pxThreadState = ( xThreadState * ) ( *( size_t *) pxCurrentTCB );
ResumeThread( pxThreadState->pvThread );
}
}
@ -446,7 +446,7 @@ uint32_t ulErrorCode;
( void ) ulErrorCode;
/* Find the handle of the thread being deleted. */
pxThreadState = ( xThreadState * ) ( *( uint32_t *) pvTaskToDelete );
pxThreadState = ( xThreadState * ) ( *( size_t *) pvTaskToDelete );
/* Check that the thread is still valid, it might have been closed by
vPortCloseRunningThread() - which will be the case if the task associated
@ -477,7 +477,7 @@ uint32_t ulErrorCode;
( void ) ulErrorCode;
/* Find the handle of the thread being deleted. */
pxThreadState = ( xThreadState * ) ( *( uint32_t *) pvTaskToDelete );
pxThreadState = ( xThreadState * ) ( *( size_t *) pvTaskToDelete );
pvThread = pxThreadState->pvThread;
/* Raise the Windows priority of the thread to ensure the FreeRTOS scheduler

View file

@ -81,8 +81,9 @@
#define portDOUBLE double
#define portLONG long
#define portSHORT short
#define portSTACK_TYPE uint32_t
#define portSTACK_TYPE size_t
#define portBASE_TYPE long
#define portPOINTER_SIZE_TYPE size_t
typedef portSTACK_TYPE StackType_t;
typedef long BaseType_t;
@ -96,15 +97,21 @@ typedef unsigned long UBaseType_t;
typedef uint32_t TickType_t;
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
/* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
not need to be guarded with a critical section. */
/* 32/64-bit tick type on a 32/64-bit architecture, so reads of the tick
count do not need to be guarded with a critical section. */
#define portTICK_TYPE_IS_ATOMIC 1
#endif
/* Hardware specifics. */
#define portSTACK_GROWTH ( -1 )
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
#define portBYTE_ALIGNMENT 4
#if defined( __x86_64_ _) || defined( _M_X64 )
#define portBYTE_ALIGNMENT 8
#else
#define portBYTE_ALIGNMENT 4
#endif
#define portYIELD() vPortGenerateSimulatedInterrupt( portINTERRUPT_YIELD )
@ -186,3 +193,4 @@ void vPortGenerateSimulatedInterrupt( uint32_t ulInterruptNumber );
void vPortSetInterruptHandler( uint32_t ulInterruptNumber, uint32_t (*pvHandler)( void ) );
#endif