+
diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_IAR/settings/RTOSDemo.wsdt b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_IAR/settings/RTOSDemo.wsdt
index 52332e268..df4ecfe95 100644
--- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_IAR/settings/RTOSDemo.wsdt
+++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_IAR/settings/RTOSDemo.wsdt
@@ -25,7 +25,7 @@
-
+
TabID-29494-21985
@@ -33,11 +33,11 @@
Workspace
- RTOSDemo
+ RTOSDemoRTOSDemo/FreeRTOS_SourceRTOSDemo/FreeRTOS_Source/port.c
- 0
+ 0
TabID-28344-23030
@@ -47,20 +47,20 @@
TabID-19430-2343Debug LogDebug-Log
- 0
+ 0
- TextEditor$WS_DIR$\main.c0000064590959090TextEditor$WS_DIR$\main_full.c000006286548654TextEditor$WS_DIR$\main_blinky.c0000063000100000010000001
+ TextEditor$WS_DIR$\main.c000006459095909TextEditor$WS_DIR$\main_full.c000006286548654TextEditor$WS_DIR$\main_blinky.c000006300TextEditor$WS_DIR$\..\..\Source\portable\IAR\ARM_CM4F\portmacro.h00000132489248923TextEditor$WS_DIR$\..\..\Source\tasks.c00000149253848538810100000010000001
- iaridepm.enu1-2-2740389-2-2200200119048203666232738755601-2-21981682-2-216842001002381203666119048203666
+ iaridepm.enu1-2-2742389-2-2200200119048203252232738756098-2-21981682-2-216842001002381203252119048203252
diff --git a/FreeRTOS/Demo/Common/Minimal/TaskNotify.c b/FreeRTOS/Demo/Common/Minimal/TaskNotify.c
index b6a5ebf0f..2dd46fcc4 100644
--- a/FreeRTOS/Demo/Common/Minimal/TaskNotify.c
+++ b/FreeRTOS/Demo/Common/Minimal/TaskNotify.c
@@ -123,6 +123,9 @@ static uint32_t ulTimerNotificationsReceived = 0UL, ulTimerNotificationsSent = 0
/* The timer used to notify the task. */
static TimerHandle_t xTimer = NULL;
+/* Used by the pseudo random number generating function. */
+static uint32_t ulNextRand = 0;
+
/*-----------------------------------------------------------*/
void vStartTaskNotifyTask( void )
@@ -130,6 +133,9 @@ void vStartTaskNotifyTask( void )
/* Create the task that performs some tests by itself, then loops around
being notified by both a software timer and an interrupt. */
xTaskCreate( prvNotifiedTask, "Notified", configMINIMAL_STACK_SIZE, NULL, notifyTASK_PRIORITY, &xTaskToNotify );
+
+ /* Pseudo seed the random number generator. */
+ ulNextRand = ( uint32_t ) prvRand;
}
/*-----------------------------------------------------------*/
@@ -349,9 +355,9 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
}
/*-----------------------------------------------------------*/
-static void prvNotifyingTimer( TimerHandle_t xTimer )
+static void prvNotifyingTimer( TimerHandle_t xNotUsed )
{
- ( void ) xTimer;
+ ( void ) xNotUsed;
xTaskNotifyGive( xTaskToNotify );
@@ -494,9 +500,7 @@ const uint32_t ulMaxSendReceiveDeviation = 5UL;
static UBaseType_t prvRand( void )
{
- static uint32_t ulNextRand = ( uint32_t ) prvRand;
-
- const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
+const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
/* Utility function to generate a pseudo random number. */
ulNextRand = ( ulMultiplier * ulNextRand ) + ulIncrement;
diff --git a/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/.info b/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/.info
index 3aef36351..c99b1caa7 100644
--- a/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/.info
+++ b/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/.info
@@ -3,5 +3,5 @@ VERSION=v14.01
TC_INSTALL=C:\devtools\KPIT\GNURXv14.01-ELF\rx-ELF\rx-ELF\
GCC_STRING=4.7-GNURX_v14.01
VERSION_IDE=
+E2STUDIO_VERSION=3.1.2.09
ACTIVE_CONFIGURATION=HardwareDebug
-E2STUDIO_VERSION=3.0.1.09
diff --git a/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/.settings/language.settings.xml b/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/.settings/language.settings.xml
index f655393b3..48e715a4d 100644
--- a/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/.settings/language.settings.xml
+++ b/FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/.settings/language.settings.xml
@@ -3,11 +3,11 @@
-
-
+
+
diff --git a/FreeRTOS/Demo/WIN32-MSVC/main_full.c b/FreeRTOS/Demo/WIN32-MSVC/main_full.c
index 85691c225..5b1505c50 100644
--- a/FreeRTOS/Demo/WIN32-MSVC/main_full.c
+++ b/FreeRTOS/Demo/WIN32-MSVC/main_full.c
@@ -396,6 +396,8 @@ void *pvAllocated;
/* Called by vApplicationTickHook(), which is defined in main.c. */
void vFullDemoTickHookFunction( void )
{
+TaskHandle_t xTimerTask;
+
/* Call the periodic timer test, which tests the timer API functions that
can be called from an ISR. */
#if( configUSE_PREEMPTION != 0 )
@@ -420,6 +422,10 @@ void vFullDemoTickHookFunction( void )
/* Exercise using task notifications from an interrupt. */
xNotifyTaskFromISR();
+
+ /* For code coverage purposes. */
+ xTimerTask = xTimerGetTimerDaemonTaskHandle();
+ configASSERT( uxTaskPriorityGetFromISR( xTimerTask ) == configTIMER_TASK_PRIORITY );
}
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/include/FreeRTOS.h b/FreeRTOS/Source/include/FreeRTOS.h
index 7fa5d5d10..c57ecd4a6 100644
--- a/FreeRTOS/Source/include/FreeRTOS.h
+++ b/FreeRTOS/Source/include/FreeRTOS.h
@@ -727,6 +727,27 @@ extern "C" {
#define configUSE_TASK_NOTIFICATIONS 1
#endif
+#ifndef portTICK_TYPE_IS_ATOMIC
+ #define portTICK_TYPE_IS_ATOMIC 0
+#endif
+
+#if( portTICK_TYPE_IS_ATOMIC == 0 )
+ /* Either variables of tick type cannot be read atomically, or
+ portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when
+ the tick count is returned to the standard critical section macros. */
+ #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL()
+ #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL()
+ #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
+ #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )
+#else
+ /* The tick type can be read atomically, so critical sections used when the
+ tick count is returned can be defined away. */
+ #define portTICK_TYPE_ENTER_CRITICAL()
+ #define portTICK_TYPE_EXIT_CRITICAL()
+ #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0
+ #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) x
+#endif
+
/* Definitions to allow backward compatibility with FreeRTOS versions prior to
V8 if desired. */
#ifndef configENABLE_BACKWARD_COMPATIBILITY
diff --git a/FreeRTOS/Source/include/task.h b/FreeRTOS/Source/include/task.h
index 1ba9748f9..c77d422f2 100644
--- a/FreeRTOS/Source/include/task.h
+++ b/FreeRTOS/Source/include/task.h
@@ -655,6 +655,14 @@ void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xT
*/
UBaseType_t uxTaskPriorityGet( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+/**
+ * task. h
+ * UBaseType_t uxTaskPriorityGetFromISR( TaskHandle_t xTask );
+ *
+ * A version of uxTaskPriorityGet() that can be used from an ISR.
+ */
+UBaseType_t uxTaskPriorityGetFromISR( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
/**
* task. h
* eTaskState eTaskGetState( TaskHandle_t xTask );
diff --git a/FreeRTOS/Source/portable/CCS/ARM_Cortex-R4/portmacro.h b/FreeRTOS/Source/portable/CCS/ARM_Cortex-R4/portmacro.h
index ea8f4cc92..d77469727 100644
--- a/FreeRTOS/Source/portable/CCS/ARM_Cortex-R4/portmacro.h
+++ b/FreeRTOS/Source/portable/CCS/ARM_Cortex-R4/portmacro.h
@@ -95,6 +95,10 @@ typedef unsigned long UBaseType_t;
#else
typedef uint32_t TickType_t;
#define portMAX_DELAY (TickType_t) 0xFFFFFFFFF
+
+ /* 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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
diff --git a/FreeRTOS/Source/portable/GCC/ARM_CA9/portmacro.h b/FreeRTOS/Source/portable/GCC/ARM_CA9/portmacro.h
index cb397eb72..c7d3e485a 100644
--- a/FreeRTOS/Source/portable/GCC/ARM_CA9/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/ARM_CA9/portmacro.h
@@ -96,6 +96,10 @@ 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. */
+#define portTICK_TYPE_IS_ATOMIC 1
+
/*-----------------------------------------------------------*/
/* Hardware specifics. */
diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM0/portmacro.h b/FreeRTOS/Source/portable/GCC/ARM_CM0/portmacro.h
index 263d141e5..d2761b503 100644
--- a/FreeRTOS/Source/portable/GCC/ARM_CM0/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/ARM_CM0/portmacro.h
@@ -100,6 +100,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h b/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h
index 24cdefc65..507936be3 100644
--- a/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h
@@ -100,6 +100,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/portmacro.h b/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/portmacro.h
index 15040be3d..d731dcf9e 100644
--- a/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/portmacro.h
@@ -100,6 +100,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h b/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h
index 41f1fbc7d..ae08cbf8a 100644
--- a/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h
@@ -100,6 +100,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/GCC/MicroBlaze/portmacro.h b/FreeRTOS/Source/portable/GCC/MicroBlaze/portmacro.h
index 2453cb4a6..4b0bfa7cc 100644
--- a/FreeRTOS/Source/portable/GCC/MicroBlaze/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/MicroBlaze/portmacro.h
@@ -99,6 +99,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/GCC/MicroBlazeV8/portmacro.h b/FreeRTOS/Source/portable/GCC/MicroBlazeV8/portmacro.h
index df14a0e79..e1008c89d 100644
--- a/FreeRTOS/Source/portable/GCC/MicroBlazeV8/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/MicroBlazeV8/portmacro.h
@@ -103,6 +103,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/GCC/NiosII/portmacro.h b/FreeRTOS/Source/portable/GCC/NiosII/portmacro.h
index 7f851d194..0f961e62c 100644
--- a/FreeRTOS/Source/portable/GCC/NiosII/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/NiosII/portmacro.h
@@ -101,6 +101,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/GCC/RX100/portmacro.h b/FreeRTOS/Source/portable/GCC/RX100/portmacro.h
index 34abc39b7..caed167f0 100644
--- a/FreeRTOS/Source/portable/GCC/RX100/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/RX100/portmacro.h
@@ -101,6 +101,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/GCC/RX600/portmacro.h b/FreeRTOS/Source/portable/GCC/RX600/portmacro.h
index 0be80cc15..361b95209 100644
--- a/FreeRTOS/Source/portable/GCC/RX600/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/RX600/portmacro.h
@@ -101,6 +101,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/GCC/RX600v2/portmacro.h b/FreeRTOS/Source/portable/GCC/RX600v2/portmacro.h
index 0be80cc15..361b95209 100644
--- a/FreeRTOS/Source/portable/GCC/RX600v2/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/RX600v2/portmacro.h
@@ -101,6 +101,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/GCC/TriCore_1782/portmacro.h b/FreeRTOS/Source/portable/GCC/TriCore_1782/portmacro.h
index 353ac02e6..5f693eb48 100644
--- a/FreeRTOS/Source/portable/GCC/TriCore_1782/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/TriCore_1782/portmacro.h
@@ -103,6 +103,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*---------------------------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/IAR/ARM_CA5_No_GIC/portmacro.h b/FreeRTOS/Source/portable/IAR/ARM_CA5_No_GIC/portmacro.h
index b6d6ea5bd..be90f89dd 100644
--- a/FreeRTOS/Source/portable/IAR/ARM_CA5_No_GIC/portmacro.h
+++ b/FreeRTOS/Source/portable/IAR/ARM_CA5_No_GIC/portmacro.h
@@ -101,6 +101,10 @@
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
+
/*-----------------------------------------------------------*/
/* Hardware specifics. */
diff --git a/FreeRTOS/Source/portable/IAR/ARM_CA9/portmacro.h b/FreeRTOS/Source/portable/IAR/ARM_CA9/portmacro.h
index 5ef448ec8..8079e211f 100644
--- a/FreeRTOS/Source/portable/IAR/ARM_CA9/portmacro.h
+++ b/FreeRTOS/Source/portable/IAR/ARM_CA9/portmacro.h
@@ -101,6 +101,10 @@
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
+
/*-----------------------------------------------------------*/
/* Hardware specifics. */
diff --git a/FreeRTOS/Source/portable/IAR/ARM_CM0/portmacro.h b/FreeRTOS/Source/portable/IAR/ARM_CM0/portmacro.h
index c5eead3c0..a4ec1b7bf 100644
--- a/FreeRTOS/Source/portable/IAR/ARM_CM0/portmacro.h
+++ b/FreeRTOS/Source/portable/IAR/ARM_CM0/portmacro.h
@@ -1,5 +1,5 @@
/*
- FreeRTOS V8.1.2 - Copyright (C) 2014 Real Time Engineers Ltd.
+ FreeRTOS V8.1.2 - Copyright (C) 2014 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
@@ -101,6 +101,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/IAR/ARM_CM3/portmacro.h b/FreeRTOS/Source/portable/IAR/ARM_CM3/portmacro.h
index 6b0a97dd4..828dd9ce6 100644
--- a/FreeRTOS/Source/portable/IAR/ARM_CM3/portmacro.h
+++ b/FreeRTOS/Source/portable/IAR/ARM_CM3/portmacro.h
@@ -100,6 +100,10 @@ typedef unsigned long UBaseType_t;
#else
typedef uint32_t TickType_t;
#define portMAX_DELAY 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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/IAR/ARM_CM4F/portmacro.h b/FreeRTOS/Source/portable/IAR/ARM_CM4F/portmacro.h
index 3c3b76f2e..502c0e54f 100644
--- a/FreeRTOS/Source/portable/IAR/ARM_CM4F/portmacro.h
+++ b/FreeRTOS/Source/portable/IAR/ARM_CM4F/portmacro.h
@@ -100,6 +100,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
@@ -110,11 +114,19 @@ typedef unsigned long UBaseType_t;
/*-----------------------------------------------------------*/
/* Scheduler utilities. */
+#define portYIELD() \
+{ \
+ /* Set a PendSV to request a context switch. */ \
+ portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; \
+ __DSB(); \
+ __ISB(); \
+}
+
#define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
-#define portYIELD() vPortYield()
-#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) vPortYield()
+#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) portYIELD()
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
+
/*-----------------------------------------------------------*/
/* Architecture specific optimisations. */
@@ -145,12 +157,19 @@ typedef unsigned long UBaseType_t;
extern void vPortEnterCritical( void );
extern void vPortExitCritical( void );
-#define portDISABLE_INTERRUPTS() ulPortRaiseBASEPRI()
-#define portENABLE_INTERRUPTS() vPortSetBASEPRI( 0 )
+#define portDISABLE_INTERRUPTS() \
+{ \
+ /* Work around. */ \
+ __set_BASEPRI( configMAX_SYSCALL_INTERRUPT_PRIORITY ); \
+ __DSB(); \
+ __ISB(); \
+}
+
+#define portENABLE_INTERRUPTS() __set_BASEPRI( 0 )
#define portENTER_CRITICAL() vPortEnterCritical()
#define portEXIT_CRITICAL() vPortExitCritical()
-#define portSET_INTERRUPT_MASK_FROM_ISR() ulPortRaiseBASEPRI()
-#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortSetBASEPRI( x )
+#define portSET_INTERRUPT_MASK_FROM_ISR() __get_BASEPRI(); portDISABLE_INTERRUPTS()
+#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) __set_BASEPRI( x )
/*-----------------------------------------------------------*/
/* Tickless idle/low power functionality. */
@@ -176,49 +195,6 @@ not necessary for to use this port. They are defined so the common demo files
/* portNOP() is not required by this port. */
#define portNOP()
-#ifndef portFORCE_INLINE
- #define portFORCE_INLINE _Pragma("inline=forced")
-#endif
-
-portFORCE_INLINE static void vPortYield( void )
-{
- /* Set a PendSV to request a context switch. */
- portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
-
- /* Barriers are normally not required but do ensure the code is completely
- within the specified behaviour for the architecture. */
- __DSB();
- __ISB();
-}
-/*-----------------------------------------------------------*/
-
-portFORCE_INLINE static uint32_t ulPortRaiseBASEPRI( void )
-{
-uint32_t ulOriginalBASEPRI;
-
- __asm volatile
- (
- " mrs %0, basepri \n" \
- " mov r1, %1 \n" \
- " msr basepri, r1 \n" \
- " isb \n" \
- " dsb \n" \
- :"=r" (ulOriginalBASEPRI) : "i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) : "r1"
- );
-
- /* This return will not be reached but is necessary to prevent compiler
- warnings. */
- return ulOriginalBASEPRI;
-}
-/*-----------------------------------------------------------*/
-
-portFORCE_INLINE static void vPortSetBASEPRI( uint32_t ulNewMaskValue )
-{
- __asm volatile
- (
- " msr basepri, %0 " :: "r" ( ulNewMaskValue )
- );
-}
/*-----------------------------------------------------------*/
/* Suppress warnings that are generated by the IAR tools, but cannot be fixed in
diff --git a/FreeRTOS/Source/portable/IAR/RX100/portmacro.h b/FreeRTOS/Source/portable/IAR/RX100/portmacro.h
index de93d76ca..18a79fd3e 100644
--- a/FreeRTOS/Source/portable/IAR/RX100/portmacro.h
+++ b/FreeRTOS/Source/portable/IAR/RX100/portmacro.h
@@ -107,6 +107,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/IAR/RX600/portmacro.h b/FreeRTOS/Source/portable/IAR/RX600/portmacro.h
index 85d5ef526..dd1a15a48 100644
--- a/FreeRTOS/Source/portable/IAR/RX600/portmacro.h
+++ b/FreeRTOS/Source/portable/IAR/RX600/portmacro.h
@@ -104,6 +104,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/MPLAB/PIC32MX/portmacro.h b/FreeRTOS/Source/portable/MPLAB/PIC32MX/portmacro.h
index 4a9a12c70..f6cc189ec 100644
--- a/FreeRTOS/Source/portable/MPLAB/PIC32MX/portmacro.h
+++ b/FreeRTOS/Source/portable/MPLAB/PIC32MX/portmacro.h
@@ -102,6 +102,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/MPLAB/PIC32MZ/portmacro.h b/FreeRTOS/Source/portable/MPLAB/PIC32MZ/portmacro.h
index bfd028fce..601c1e45c 100644
--- a/FreeRTOS/Source/portable/MPLAB/PIC32MZ/portmacro.h
+++ b/FreeRTOS/Source/portable/MPLAB/PIC32MZ/portmacro.h
@@ -102,6 +102,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/MSVC-MingW/portmacro.h b/FreeRTOS/Source/portable/MSVC-MingW/portmacro.h
index eaae2af27..9de96d80c 100644
--- a/FreeRTOS/Source/portable/MSVC-MingW/portmacro.h
+++ b/FreeRTOS/Source/portable/MSVC-MingW/portmacro.h
@@ -91,6 +91,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/* Hardware specifics. */
diff --git a/FreeRTOS/Source/portable/RVDS/ARM_CA9/portmacro.h b/FreeRTOS/Source/portable/RVDS/ARM_CA9/portmacro.h
index 7e0ae12a8..cf88df071 100644
--- a/FreeRTOS/Source/portable/RVDS/ARM_CA9/portmacro.h
+++ b/FreeRTOS/Source/portable/RVDS/ARM_CA9/portmacro.h
@@ -100,6 +100,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/RVDS/ARM_CM0/portmacro.h b/FreeRTOS/Source/portable/RVDS/ARM_CM0/portmacro.h
index 23dd302d5..791e3334f 100644
--- a/FreeRTOS/Source/portable/RVDS/ARM_CM0/portmacro.h
+++ b/FreeRTOS/Source/portable/RVDS/ARM_CM0/portmacro.h
@@ -100,6 +100,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/RVDS/ARM_CM3/portmacro.h b/FreeRTOS/Source/portable/RVDS/ARM_CM3/portmacro.h
index 733023988..a47010d37 100644
--- a/FreeRTOS/Source/portable/RVDS/ARM_CM3/portmacro.h
+++ b/FreeRTOS/Source/portable/RVDS/ARM_CM3/portmacro.h
@@ -100,6 +100,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/RVDS/ARM_CM4F/portmacro.h b/FreeRTOS/Source/portable/RVDS/ARM_CM4F/portmacro.h
index 93a055555..2b29b7253 100644
--- a/FreeRTOS/Source/portable/RVDS/ARM_CM4F/portmacro.h
+++ b/FreeRTOS/Source/portable/RVDS/ARM_CM4F/portmacro.h
@@ -100,6 +100,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/Renesas/RX100/portmacro.h b/FreeRTOS/Source/portable/Renesas/RX100/portmacro.h
index 3dfb9d97a..db17b4304 100644
--- a/FreeRTOS/Source/portable/Renesas/RX100/portmacro.h
+++ b/FreeRTOS/Source/portable/Renesas/RX100/portmacro.h
@@ -104,6 +104,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/Renesas/RX200/portmacro.h b/FreeRTOS/Source/portable/Renesas/RX200/portmacro.h
index 3fdbda8cb..a9ac54edd 100644
--- a/FreeRTOS/Source/portable/Renesas/RX200/portmacro.h
+++ b/FreeRTOS/Source/portable/Renesas/RX200/portmacro.h
@@ -104,6 +104,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/Renesas/RX600/portmacro.h b/FreeRTOS/Source/portable/Renesas/RX600/portmacro.h
index e401400d8..0cae97892 100644
--- a/FreeRTOS/Source/portable/Renesas/RX600/portmacro.h
+++ b/FreeRTOS/Source/portable/Renesas/RX600/portmacro.h
@@ -104,6 +104,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/Renesas/RX600v2/portmacro.h b/FreeRTOS/Source/portable/Renesas/RX600v2/portmacro.h
index 1960ff197..fd180f03a 100644
--- a/FreeRTOS/Source/portable/Renesas/RX600v2/portmacro.h
+++ b/FreeRTOS/Source/portable/Renesas/RX600v2/portmacro.h
@@ -104,6 +104,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/Renesas/SH2A_FPU/portmacro.h b/FreeRTOS/Source/portable/Renesas/SH2A_FPU/portmacro.h
index de49388d8..39dfcb674 100644
--- a/FreeRTOS/Source/portable/Renesas/SH2A_FPU/portmacro.h
+++ b/FreeRTOS/Source/portable/Renesas/SH2A_FPU/portmacro.h
@@ -103,6 +103,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/portable/Tasking/ARM_CM4F/portmacro.h b/FreeRTOS/Source/portable/Tasking/ARM_CM4F/portmacro.h
index b98add8ed..02354e9ee 100644
--- a/FreeRTOS/Source/portable/Tasking/ARM_CM4F/portmacro.h
+++ b/FreeRTOS/Source/portable/Tasking/ARM_CM4F/portmacro.h
@@ -101,6 +101,10 @@ typedef unsigned long UBaseType_t;
#else
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. */
+ #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Source/tasks.c b/FreeRTOS/Source/tasks.c
index 74edf06e1..99c005fcc 100644
--- a/FreeRTOS/Source/tasks.c
+++ b/FreeRTOS/Source/tasks.c
@@ -1080,8 +1080,8 @@ TCB_t * pxNewTCB;
uxSavedInterruptState = portSET_INTERRUPT_MASK_FROM_ISR();
{
- /* If null is passed in here then we are changing the
- priority of the calling function. */
+ /* If null is passed in here then it is the priority of the calling
+ task that is being queried. */
pxTCB = prvGetTCBFromHandle( xTask );
uxReturn = pxTCB->uxPriority;
}
@@ -1743,11 +1743,11 @@ TickType_t xTaskGetTickCount( void )
TickType_t xTicks;
/* Critical section required if running on a 16 bit processor. */
- taskENTER_CRITICAL();
+ portTICK_TYPE_ENTER_CRITICAL();
{
xTicks = xTickCount;
}
- taskEXIT_CRITICAL();
+ portTICK_TYPE_EXIT_CRITICAL();
return xTicks;
}
@@ -1774,11 +1774,11 @@ UBaseType_t uxSavedInterruptStatus;
link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
- uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+ uxSavedInterruptStatus = portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR();
{
xReturn = xTickCount;
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
return xReturn;
}
@@ -3510,7 +3510,7 @@ TCB_t *pxTCB;
/* Pad the end of the string with spaces to ensure columns line up when
printed out. */
- for( x = strlen( pcBuffer ); x < configMAX_TASK_NAME_LEN; x++ )
+ for( x = strlen( pcBuffer ); x < ( configMAX_TASK_NAME_LEN - 1 ); x++ )
{
pcBuffer[ x ] = ' ';
}
@@ -3578,22 +3578,22 @@ TCB_t *pxTCB;
{
switch( pxTaskStatusArray[ x ].eCurrentState )
{
- case eReady: cStatus = tskREADY_CHAR;
- break;
+ case eReady: cStatus = tskREADY_CHAR;
+ break;
- case eBlocked: cStatus = tskBLOCKED_CHAR;
- break;
+ case eBlocked: cStatus = tskBLOCKED_CHAR;
+ break;
- case eSuspended: cStatus = tskSUSPENDED_CHAR;
- break;
+ case eSuspended: cStatus = tskSUSPENDED_CHAR;
+ break;
- case eDeleted: cStatus = tskDELETED_CHAR;
- break;
+ case eDeleted: cStatus = tskDELETED_CHAR;
+ break;
- default: /* Should not get here, but it is included
- to prevent static checking errors. */
- cStatus = 0x00;
- break;
+ default: /* Should not get here, but it is included
+ to prevent static checking errors. */
+ cStatus = 0x00;
+ break;
}
/* Write the task name to the string, padding with spaces so it
@@ -3685,13 +3685,13 @@ TCB_t *pxTCB;
ulTotalRunTimeDiv100 has already been divided by 100. */
ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalTime;
+ /* Write the task name to the string, padding with
+ spaces so it can be printed in tabular form more
+ easily. */
+ pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
+
if( ulStatsAsPercentage > 0UL )
{
- /* Write the task name to the string, padding with
- spaces so it can be printed in tabular form more
- easily. */
- pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
-
#ifdef portLU_PRINTF_SPECIFIER_REQUIRED
{
sprintf( pcWriteBuffer, "\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage );
@@ -3710,13 +3710,13 @@ TCB_t *pxTCB;
consumed less than 1% of the total run time. */
#ifdef portLU_PRINTF_SPECIFIER_REQUIRED
{
- sprintf( pcWriteBuffer, "%s\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter );
+ sprintf( pcWriteBuffer, "\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter );
}
#else
{
/* sizeof( int ) == sizeof( long ) so a smaller
printf() library can be used. */
- sprintf( pcWriteBuffer, "%s\t\t%u\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter );
+ sprintf( pcWriteBuffer, "\t\t%u\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter );
}
#endif
}
diff --git a/FreeRTOS/Source/timers.c b/FreeRTOS/Source/timers.c
index 080e4e8fe..73268aa0a 100644
--- a/FreeRTOS/Source/timers.c
+++ b/FreeRTOS/Source/timers.c
@@ -468,10 +468,10 @@ BaseType_t xTimerListsWereSwitched;
if( xTaskResumeAll() == pdFALSE )
{
- /* Yield to wait for either a command to arrive, or the block time
- to expire. If a command arrived between the critical section being
- exited and this yield then the yield will not cause the task
- to block. */
+ /* Yield to wait for either a command to arrive, or the
+ block time to expire. If a command arrived between the
+ critical section being exited and this yield then the yield
+ will not cause the task to block. */
portYIELD_WITHIN_API();
}
else
@@ -843,7 +843,7 @@ Timer_t * const pxTimer = ( Timer_t * ) xTimer;
xMessage.u.xCallbackParameters.ulParameter2 = ulParameter2;
xReturn = xQueueSendFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );
-
+
tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, xReturn );
return xReturn;
@@ -869,7 +869,7 @@ Timer_t * const pxTimer = ( Timer_t * ) xTimer;
xReturn = xQueueSendToBack( xTimerQueue, &xMessage, xTicksToWait );
tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, xReturn );
-
+
return xReturn;
}