mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 05:21:59 -04:00
Changes to core code and port layer:
+ Add configASSERT() into ARM Cortex-M ports to check the number of priority bit settings. + Clear the 'control' register before starting ARM Cortex-M4F ports in case the FPU is used before the scheduler is started. This just saves a few bytes on the main stack as it prevents space being left for a later save of FPU registers. + Added xSemaphoreGetMutexHolderFromISR(). + Corrected use of portNVIC_PENDSVSET to portNVIC_PENDSVSET_BIT in MPU ports.
This commit is contained in:
parent
bdbf347c22
commit
75ffac21d7
|
@ -137,7 +137,7 @@ to exclude the API function. */
|
||||||
|
|
||||||
/* This demo makes use of one or more example stats formatting functions. These
|
/* This demo makes use of one or more example stats formatting functions. These
|
||||||
format the raw data provided by the uxTaskGetSystemState() function in to human
|
format the raw data provided by the uxTaskGetSystemState() function in to human
|
||||||
readable ASCII form. See the notes in the implementation of vTaskList() within
|
readable ASCII form. See the notes in the implementation of vTaskList() within
|
||||||
FreeRTOS/Source/tasks.c for limitations. */
|
FreeRTOS/Source/tasks.c for limitations. */
|
||||||
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
|
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ FreeRTOS/Source/tasks.c for limitations. */
|
||||||
#ifdef __NVIC_PRIO_BITS
|
#ifdef __NVIC_PRIO_BITS
|
||||||
#define configPRIO_BITS __NVIC_PRIO_BITS
|
#define configPRIO_BITS __NVIC_PRIO_BITS
|
||||||
#else
|
#else
|
||||||
#define configPRIO_BITS 5 /* 15 priority levels */
|
#define configPRIO_BITS 5 /* 31 priority levels */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x1f
|
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x1f
|
||||||
|
@ -160,9 +160,9 @@ FreeRTOS/Source/tasks.c for limitations. */
|
||||||
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
||||||
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
||||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||||||
|
|
||||||
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
|
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
|
||||||
|
|
||||||
#define vPortSVCHandler SVC_Handler
|
#define vPortSVCHandler SVC_Handler
|
||||||
#define xPortPendSVHandler PendSV_Handler
|
#define xPortPendSVHandler PendSV_Handler
|
||||||
#define vPortSVCHandler SVC_Handler
|
#define vPortSVCHandler SVC_Handler
|
||||||
|
|
|
@ -68,10 +68,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following #error directive is to remind users that a batch file must be
|
* The following #error directive is to remind users that a batch file must be
|
||||||
* executed prior to this project being built. The batch file *cannot* be
|
* executed prior to this project being built. The batch file *cannot* be
|
||||||
* executed from within the IDE! Once it has been executed, re-open or refresh
|
* executed from within the IDE! Once it has been executed, re-open or refresh
|
||||||
* the Eclipse project and remove the #error line below.
|
* the Eclipse project and remove the #error line below.
|
||||||
*/
|
*/
|
||||||
#error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above.
|
#error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above.
|
||||||
|
@ -140,7 +140,7 @@ to exclude the API function. */
|
||||||
|
|
||||||
/* This demo makes use of one or more example stats formatting functions. These
|
/* This demo makes use of one or more example stats formatting functions. These
|
||||||
format the raw data provided by the uxTaskGetSystemState() function in to human
|
format the raw data provided by the uxTaskGetSystemState() function in to human
|
||||||
readable ASCII form. See the notes in the implementation of vTaskList() within
|
readable ASCII form. See the notes in the implementation of vTaskList() within
|
||||||
FreeRTOS/Source/tasks.c for limitations. */
|
FreeRTOS/Source/tasks.c for limitations. */
|
||||||
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
|
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ unsigned long ulGetRunTimeCounterValue( void );
|
||||||
#ifdef __NVIC_PRIO_BITS
|
#ifdef __NVIC_PRIO_BITS
|
||||||
#define configPRIO_BITS __NVIC_PRIO_BITS
|
#define configPRIO_BITS __NVIC_PRIO_BITS
|
||||||
#else
|
#else
|
||||||
#define configPRIO_BITS 5 /* 15 priority levels */
|
#define configPRIO_BITS 5 /* 31 priority levels */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x1f
|
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x1f
|
||||||
|
@ -165,9 +165,9 @@ unsigned long ulGetRunTimeCounterValue( void );
|
||||||
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
||||||
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
||||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||||||
|
|
||||||
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
|
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
|
||||||
|
|
||||||
#define vPortSVCHandler SVC_Handler
|
#define vPortSVCHandler SVC_Handler
|
||||||
#define xPortPendSVHandler PendSV_Handler
|
#define xPortPendSVHandler PendSV_Handler
|
||||||
#define vPortSVCHandler SVC_Handler
|
#define vPortSVCHandler SVC_Handler
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -12,7 +12,7 @@
|
||||||
<name>General</name>
|
<name>General</name>
|
||||||
<archiveVersion>3</archiveVersion>
|
<archiveVersion>3</archiveVersion>
|
||||||
<data>
|
<data>
|
||||||
<version>21</version>
|
<version>24</version>
|
||||||
<wantNonLocal>1</wantNonLocal>
|
<wantNonLocal>1</wantNonLocal>
|
||||||
<debug>1</debug>
|
<debug>1</debug>
|
||||||
<option>
|
<option>
|
||||||
|
@ -27,11 +27,6 @@
|
||||||
<name>ListPath</name>
|
<name>ListPath</name>
|
||||||
<state>Debug\List</state>
|
<state>Debug\List</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
|
||||||
<name>Variant</name>
|
|
||||||
<version>19</version>
|
|
||||||
<state>37</state>
|
|
||||||
</option>
|
|
||||||
<option>
|
<option>
|
||||||
<name>GEndianMode</name>
|
<name>GEndianMode</name>
|
||||||
<state>0</state>
|
<state>0</state>
|
||||||
|
@ -58,11 +53,6 @@
|
||||||
<name>GOutputBinary</name>
|
<name>GOutputBinary</name>
|
||||||
<state>0</state>
|
<state>0</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
|
||||||
<name>FPU</name>
|
|
||||||
<version>2</version>
|
|
||||||
<state>0</state>
|
|
||||||
</option>
|
|
||||||
<option>
|
<option>
|
||||||
<name>OGCoreOrChip</name>
|
<name>OGCoreOrChip</name>
|
||||||
<state>1</state>
|
<state>1</state>
|
||||||
|
@ -87,7 +77,7 @@
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGLastSavedByProductVersion</name>
|
<name>OGLastSavedByProductVersion</name>
|
||||||
<state>6.30.7.53437</state>
|
<state>7.60.1.11206</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>GeneralEnableMisra</name>
|
<name>GeneralEnableMisra</name>
|
||||||
|
@ -99,7 +89,7 @@
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGChipSelectEditMenu</name>
|
<name>OGChipSelectEditMenu</name>
|
||||||
<state>STM32F10xxB ST STM32F10xxB</state>
|
<state>STM32F103ZG ST STM32F103ZG</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>GenLowLevelInterface</name>
|
<name>GenLowLevelInterface</name>
|
||||||
|
@ -135,15 +125,10 @@
|
||||||
<name>RTConfigPath2</name>
|
<name>RTConfigPath2</name>
|
||||||
<state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
|
<state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
|
||||||
<name>GFPUCoreSlave</name>
|
|
||||||
<version>19</version>
|
|
||||||
<state>37</state>
|
|
||||||
</option>
|
|
||||||
<option>
|
<option>
|
||||||
<name>GBECoreSlave</name>
|
<name>GBECoreSlave</name>
|
||||||
<version>19</version>
|
<version>24</version>
|
||||||
<state>37</state>
|
<state>38</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGUseCmsis</name>
|
<name>OGUseCmsis</name>
|
||||||
|
@ -153,15 +138,51 @@
|
||||||
<name>OGUseCmsisDspLib</name>
|
<name>OGUseCmsisDspLib</name>
|
||||||
<state>0</state>
|
<state>0</state>
|
||||||
</option>
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>GRuntimeLibThreads</name>
|
||||||
|
<state>0</state>
|
||||||
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>CoreVariant</name>
|
||||||
|
<version>24</version>
|
||||||
|
<state>38</state>
|
||||||
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>GFPUDeviceSlave</name>
|
||||||
|
<state>STM32F103ZG ST STM32F103ZG</state>
|
||||||
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>FPU2</name>
|
||||||
|
<version>0</version>
|
||||||
|
<state>0</state>
|
||||||
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>NrRegs</name>
|
||||||
|
<version>0</version>
|
||||||
|
<state>0</state>
|
||||||
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>NEON</name>
|
||||||
|
<state>0</state>
|
||||||
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>GFPUCoreSlave2</name>
|
||||||
|
<version>24</version>
|
||||||
|
<state>38</state>
|
||||||
|
</option>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
<settings>
|
<settings>
|
||||||
<name>ICCARM</name>
|
<name>ICCARM</name>
|
||||||
<archiveVersion>2</archiveVersion>
|
<archiveVersion>2</archiveVersion>
|
||||||
<data>
|
<data>
|
||||||
<version>28</version>
|
<version>31</version>
|
||||||
<wantNonLocal>1</wantNonLocal>
|
<wantNonLocal>1</wantNonLocal>
|
||||||
<debug>1</debug>
|
<debug>1</debug>
|
||||||
|
<option>
|
||||||
|
<name>CCOptimizationNoSizeConstraints</name>
|
||||||
|
<state>0</state>
|
||||||
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>CCDefines</name>
|
<name>CCDefines</name>
|
||||||
<state>VECT_TAB_FLASH</state>
|
<state>VECT_TAB_FLASH</state>
|
||||||
|
@ -226,7 +247,7 @@
|
||||||
<option>
|
<option>
|
||||||
<name>CCAllowList</name>
|
<name>CCAllowList</name>
|
||||||
<version>1</version>
|
<version>1</version>
|
||||||
<state>0000000</state>
|
<state>00000000</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>CCDebugInfo</name>
|
<name>CCDebugInfo</name>
|
||||||
|
@ -390,13 +411,26 @@
|
||||||
<name>IccFloatSemantics</name>
|
<name>IccFloatSemantics</name>
|
||||||
<state>0</state>
|
<state>0</state>
|
||||||
</option>
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>CCNoLiteralPool</name>
|
||||||
|
<state>0</state>
|
||||||
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>CCOptStrategySlave</name>
|
||||||
|
<version>0</version>
|
||||||
|
<state>0</state>
|
||||||
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>CCGuardCalls</name>
|
||||||
|
<state>1</state>
|
||||||
|
</option>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
<settings>
|
<settings>
|
||||||
<name>AARM</name>
|
<name>AARM</name>
|
||||||
<archiveVersion>2</archiveVersion>
|
<archiveVersion>2</archiveVersion>
|
||||||
<data>
|
<data>
|
||||||
<version>8</version>
|
<version>9</version>
|
||||||
<wantNonLocal>1</wantNonLocal>
|
<wantNonLocal>1</wantNonLocal>
|
||||||
<debug>1</debug>
|
<debug>1</debug>
|
||||||
<option>
|
<option>
|
||||||
|
@ -552,6 +586,10 @@
|
||||||
<name>AExtraOptionsV2</name>
|
<name>AExtraOptionsV2</name>
|
||||||
<state></state>
|
<state></state>
|
||||||
</option>
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>AsmNoLiteralPool</name>
|
||||||
|
<state>0</state>
|
||||||
|
</option>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
<settings>
|
<settings>
|
||||||
|
@ -563,7 +601,7 @@
|
||||||
<debug>1</debug>
|
<debug>1</debug>
|
||||||
<option>
|
<option>
|
||||||
<name>OOCOutputFormat</name>
|
<name>OOCOutputFormat</name>
|
||||||
<version>2</version>
|
<version>3</version>
|
||||||
<state>0</state>
|
<state>0</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
|
@ -590,6 +628,7 @@
|
||||||
<data>
|
<data>
|
||||||
<extensions></extensions>
|
<extensions></extensions>
|
||||||
<cmdline></cmdline>
|
<cmdline></cmdline>
|
||||||
|
<hasPrio>0</hasPrio>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
<settings>
|
<settings>
|
||||||
|
@ -609,7 +648,7 @@
|
||||||
<name>ILINK</name>
|
<name>ILINK</name>
|
||||||
<archiveVersion>0</archiveVersion>
|
<archiveVersion>0</archiveVersion>
|
||||||
<data>
|
<data>
|
||||||
<version>15</version>
|
<version>17</version>
|
||||||
<wantNonLocal>1</wantNonLocal>
|
<wantNonLocal>1</wantNonLocal>
|
||||||
<debug>1</debug>
|
<debug>1</debug>
|
||||||
<option>
|
<option>
|
||||||
|
@ -889,6 +928,14 @@
|
||||||
<version>0</version>
|
<version>0</version>
|
||||||
<state>0</state>
|
<state>0</state>
|
||||||
</option>
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>IlinkThreadsSlave</name>
|
||||||
|
<state>1</state>
|
||||||
|
</option>
|
||||||
|
<option>
|
||||||
|
<name>IlinkLogCallGraph</name>
|
||||||
|
<state>0</state>
|
||||||
|
</option>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
<settings>
|
<settings>
|
||||||
|
|
|
@ -5,14 +5,14 @@
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||||
<externalSettings/>
|
<externalSettings/>
|
||||||
<extensions>
|
<extensions>
|
||||||
|
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
</extensions>
|
</extensions>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">
|
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">
|
||||||
<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239." name="/" resourcePath="">
|
<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239." name="/" resourcePath="">
|
||||||
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.1619684599" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">
|
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.1619684599" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">
|
||||||
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.1827277435" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>
|
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.1827277435" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>
|
||||||
|
@ -22,13 +22,13 @@
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.867063893" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
|
<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.867063893" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.1190873987" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug">
|
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.1190873987" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug">
|
||||||
<option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.40398864" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
<option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.40398864" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
||||||
<option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.375002745" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
<option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.375002745" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1285167012" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">
|
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1285167012" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">
|
||||||
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.426701341" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" value="gnu.c.optimization.level.none" valueType="enumerated"/>
|
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.426701341" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.c.optimization.level.none" valueType="enumerated"/>
|
||||||
<option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.514946732" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
|
<option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.514946732" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
|
||||||
<option id="gnu.c.compiler.option.include.paths.1474487302" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
<option id="gnu.c.compiler.option.include.paths.1474487302" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS_Source/include}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS_Source/include}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS+Trace Recorder/Include}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS+Trace Recorder/Include}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Trace_Recorder_Configuration}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Trace_Recorder_Configuration}""/>
|
||||||
|
@ -36,10 +36,10 @@
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Standard_Demo_Tasks/Include}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Standard_Demo_Tasks/Include}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/MSVC-MingW}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/MSVC-MingW}""/>
|
||||||
</option>
|
</option>
|
||||||
<option id="gnu.c.compiler.option.debugging.prof.53374762" name="Generate prof information (-p)" superClass="gnu.c.compiler.option.debugging.prof" value="false" valueType="boolean"/>
|
<option id="gnu.c.compiler.option.debugging.prof.53374762" name="Generate prof information (-p)" superClass="gnu.c.compiler.option.debugging.prof" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||||
<option id="gnu.c.compiler.option.warnings.extrawarn.1804262134" name="Extra warnings (-Wextra)" superClass="gnu.c.compiler.option.warnings.extrawarn" value="true" valueType="boolean"/>
|
<option id="gnu.c.compiler.option.warnings.extrawarn.1804262134" name="Extra warnings (-Wextra)" superClass="gnu.c.compiler.option.warnings.extrawarn" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||||
<option id="gnu.c.compiler.option.misc.other.1931924410" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0" valueType="string"/>
|
<option id="gnu.c.compiler.option.misc.other.1931924410" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -Wcast-qual" valueType="string"/>
|
||||||
<option id="gnu.c.compiler.option.debugging.gprof.444112294" name="Generate gprof information (-pg)" superClass="gnu.c.compiler.option.debugging.gprof" value="false" valueType="boolean"/>
|
<option id="gnu.c.compiler.option.debugging.gprof.444112294" name="Generate gprof information (-pg)" superClass="gnu.c.compiler.option.debugging.gprof" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.974248912" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.974248912" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.2080839343" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">
|
<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.2080839343" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">
|
||||||
|
@ -50,6 +50,9 @@
|
||||||
<option id="gnu.c.link.option.noshared.628613709" name="No shared libraries (-static)" superClass="gnu.c.link.option.noshared" value="false" valueType="boolean"/>
|
<option id="gnu.c.link.option.noshared.628613709" name="No shared libraries (-static)" superClass="gnu.c.link.option.noshared" value="false" valueType="boolean"/>
|
||||||
<option id="gnu.c.link.option.debugging.prof.1514831674" name="Generate prof information (-p)" superClass="gnu.c.link.option.debugging.prof" value="false" valueType="boolean"/>
|
<option id="gnu.c.link.option.debugging.prof.1514831674" name="Generate prof information (-p)" superClass="gnu.c.link.option.debugging.prof" value="false" valueType="boolean"/>
|
||||||
<option id="gnu.c.link.option.debugging.gprof.1432524618" name="Generate gprof information (-pg)" superClass="gnu.c.link.option.debugging.gprof" value="false" valueType="boolean"/>
|
<option id="gnu.c.link.option.debugging.gprof.1432524618" name="Generate gprof information (-pg)" superClass="gnu.c.link.option.debugging.gprof" value="false" valueType="boolean"/>
|
||||||
|
<option id="gnu.c.link.option.other.75811299" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false" valueType="stringList">
|
||||||
|
<listOptionValue builtIn="false" value="-Map=rtosdemo.map"/>
|
||||||
|
</option>
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1912714899" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1912714899" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
|
|
@ -375,4 +375,3 @@ const HeapRegion_t xHeapRegions[] =
|
||||||
vPortDefineHeapRegions( xHeapRegions );
|
vPortDefineHeapRegions( xHeapRegions );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -602,7 +602,7 @@ BaseType_t xMatchFound = pdFALSE;
|
||||||
eventUNBLOCKED_DUE_TO_BIT_SET bit is set so the task knows
|
eventUNBLOCKED_DUE_TO_BIT_SET bit is set so the task knows
|
||||||
that is was unblocked due to its required bits matching, rather
|
that is was unblocked due to its required bits matching, rather
|
||||||
than because it timed out. */
|
than because it timed out. */
|
||||||
( void ) xTaskRemoveFromUnorderedEventList( pxListItem, pxEventBits->uxEventBits | eventUNBLOCKED_DUE_TO_BIT_SET );
|
vTaskRemoveFromUnorderedEventList( pxListItem, pxEventBits->uxEventBits | eventUNBLOCKED_DUE_TO_BIT_SET );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move onto the next list item. Note pxListItem->pxNext is not
|
/* Move onto the next list item. Note pxListItem->pxNext is not
|
||||||
|
@ -634,8 +634,8 @@ const List_t *pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );
|
||||||
{
|
{
|
||||||
/* Unblock the task, returning 0 as the event list is being deleted
|
/* Unblock the task, returning 0 as the event list is being deleted
|
||||||
and cannot therefore have any bits set. */
|
and cannot therefore have any bits set. */
|
||||||
configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
|
configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( const ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
|
||||||
( void ) xTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
|
vTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
|
#if( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
|
||||||
|
|
|
@ -1561,6 +1561,7 @@ QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType, StaticQueue_t
|
||||||
QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
|
QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
|
||||||
QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount, StaticQueue_t *pxStaticQueue ) PRIVILEGED_FUNCTION;
|
QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount, StaticQueue_t *pxStaticQueue ) PRIVILEGED_FUNCTION;
|
||||||
void* xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
|
void* xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
|
||||||
|
void* xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For internal use only. Use xSemaphoreTakeMutexRecursive() or
|
* For internal use only. Use xSemaphoreTakeMutexRecursive() or
|
||||||
|
|
|
@ -1154,6 +1154,17 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
*/
|
*/
|
||||||
#define xSemaphoreGetMutexHolder( xSemaphore ) xQueueGetMutexHolder( ( xSemaphore ) )
|
#define xSemaphoreGetMutexHolder( xSemaphore ) xQueueGetMutexHolder( ( xSemaphore ) )
|
||||||
|
|
||||||
|
/**
|
||||||
|
* semphr.h
|
||||||
|
* <pre>TaskHandle_t xSemaphoreGetMutexHolderFromISR( SemaphoreHandle_t xMutex );</pre>
|
||||||
|
*
|
||||||
|
* If xMutex is indeed a mutex type semaphore, return the current mutex holder.
|
||||||
|
* If xMutex is not a mutex type semaphore, or the mutex is available (not held
|
||||||
|
* by a task), return NULL.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define xSemaphoreGetMutexHolderFromISR( xSemaphore ) xQueueGetMutexHolderFromISR( ( xSemaphore ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr.h
|
* semphr.h
|
||||||
* <pre>UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t xSemaphore );</pre>
|
* <pre>UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t xSemaphore );</pre>
|
||||||
|
|
|
@ -2141,14 +2141,14 @@ void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, TickType_t xTi
|
||||||
* Removes a task from both the specified event list and the list of blocked
|
* Removes a task from both the specified event list and the list of blocked
|
||||||
* tasks, and places it on a ready queue.
|
* tasks, and places it on a ready queue.
|
||||||
*
|
*
|
||||||
* xTaskRemoveFromEventList()/xTaskRemoveFromUnorderedEventList() will be called
|
* xTaskRemoveFromEventList()/vTaskRemoveFromUnorderedEventList() will be called
|
||||||
* if either an event occurs to unblock a task, or the block timeout period
|
* if either an event occurs to unblock a task, or the block timeout period
|
||||||
* expires.
|
* expires.
|
||||||
*
|
*
|
||||||
* xTaskRemoveFromEventList() is used when the event list is in task priority
|
* xTaskRemoveFromEventList() is used when the event list is in task priority
|
||||||
* order. It removes the list item from the head of the event list as that will
|
* order. It removes the list item from the head of the event list as that will
|
||||||
* have the highest priority owning task of all the tasks on the event list.
|
* have the highest priority owning task of all the tasks on the event list.
|
||||||
* xTaskRemoveFromUnorderedEventList() is used when the event list is not
|
* vTaskRemoveFromUnorderedEventList() is used when the event list is not
|
||||||
* ordered and the event list items hold something other than the owning tasks
|
* ordered and the event list items hold something other than the owning tasks
|
||||||
* priority. In this case the event list item value is updated to the value
|
* priority. In this case the event list item value is updated to the value
|
||||||
* passed in the xItemValue parameter.
|
* passed in the xItemValue parameter.
|
||||||
|
@ -2157,7 +2157,7 @@ void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, TickType_t xTi
|
||||||
* making the call, otherwise pdFALSE.
|
* making the call, otherwise pdFALSE.
|
||||||
*/
|
*/
|
||||||
BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList ) PRIVILEGED_FUNCTION;
|
BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList ) PRIVILEGED_FUNCTION;
|
||||||
BaseType_t xTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem, const TickType_t xItemValue ) PRIVILEGED_FUNCTION;
|
void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem, const TickType_t xItemValue ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
|
* THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
|
||||||
|
|
|
@ -299,6 +299,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
|
|
@ -179,6 +179,12 @@ vPortStartFirstTask: .asmfunc
|
||||||
ldr r0, [r0]
|
ldr r0, [r0]
|
||||||
;/* Set the msp back to the start of the stack. */
|
;/* Set the msp back to the start of the stack. */
|
||||||
msr msp, r0
|
msr msp, r0
|
||||||
|
;/* Clear the bit that indicates the FPU is in use in case the FPU was used
|
||||||
|
;before the scheduler was started - which would otherwise result in the
|
||||||
|
;unnecessary leaving of space in the SVC stack for lazy saving of FPU
|
||||||
|
;registers. */
|
||||||
|
mov r0, #0
|
||||||
|
msr control, r0
|
||||||
;/* Call SVC to start the first task. */
|
;/* Call SVC to start the first task. */
|
||||||
cpsie i
|
cpsie i
|
||||||
cpsie f
|
cpsie f
|
||||||
|
|
|
@ -324,6 +324,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
|
|
@ -173,7 +173,7 @@ typedef struct MPU_SETTINGS
|
||||||
|
|
||||||
#define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) )
|
#define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) )
|
||||||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
||||||
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ not necessary for to use this port. They are defined so the common demo files
|
||||||
/* Set the privilege level to user mode if xRunningPrivileged is false. */
|
/* Set the privilege level to user mode if xRunningPrivileged is false. */
|
||||||
portFORCE_INLINE static void vPortResetPrivilege( BaseType_t xRunningPrivileged )
|
portFORCE_INLINE static void vPortResetPrivilege( BaseType_t xRunningPrivileged )
|
||||||
{
|
{
|
||||||
if( xRunningPrivileged != pdTRUE )
|
if( xRunningPrivileged != pdTRUE )
|
||||||
{
|
{
|
||||||
__asm volatile ( " mrs r0, control \n" \
|
__asm volatile ( " mrs r0, control \n" \
|
||||||
" orr r0, #1 \n" \
|
" orr r0, #1 \n" \
|
||||||
|
|
|
@ -291,11 +291,17 @@ void vPortSVCHandler( void )
|
||||||
|
|
||||||
static void prvPortStartFirstTask( void )
|
static void prvPortStartFirstTask( void )
|
||||||
{
|
{
|
||||||
|
/* Start the first task. This also clears the bit that indicates the FPU is
|
||||||
|
in use in case the FPU was used before the scheduler was started - which
|
||||||
|
would otherwise result in the unnecessary leaving of space in the SVC stack
|
||||||
|
for lazy saving of FPU registers. */
|
||||||
__asm volatile(
|
__asm volatile(
|
||||||
" ldr r0, =0xE000ED08 \n" /* Use the NVIC offset register to locate the stack. */
|
" ldr r0, =0xE000ED08 \n" /* Use the NVIC offset register to locate the stack. */
|
||||||
" ldr r0, [r0] \n"
|
" ldr r0, [r0] \n"
|
||||||
" ldr r0, [r0] \n"
|
" ldr r0, [r0] \n"
|
||||||
" msr msp, r0 \n" /* Set the msp back to the start of the stack. */
|
" msr msp, r0 \n" /* Set the msp back to the start of the stack. */
|
||||||
|
" mov r0, #0 \n" /* Clear the bit that indicates the FPU is in use, see comment above. */
|
||||||
|
" msr control, r0 \n"
|
||||||
" cpsie i \n" /* Globally enable interrupts. */
|
" cpsie i \n" /* Globally enable interrupts. */
|
||||||
" cpsie f \n"
|
" cpsie f \n"
|
||||||
" dsb \n"
|
" dsb \n"
|
||||||
|
@ -354,6 +360,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
|
|
@ -374,6 +374,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
@ -407,12 +425,17 @@ BaseType_t xPortStartScheduler( void )
|
||||||
/* Lazy save always. */
|
/* Lazy save always. */
|
||||||
*( portFPCCR ) |= portASPEN_AND_LSPEN_BITS;
|
*( portFPCCR ) |= portASPEN_AND_LSPEN_BITS;
|
||||||
|
|
||||||
/* Start the first task. */
|
/* Start the first task. This also clears the bit that indicates the FPU is
|
||||||
|
in use in case the FPU was used before the scheduler was started - which
|
||||||
|
would otherwise result in the unnecessary leaving of space in the SVC stack
|
||||||
|
for lazy saving of FPU registers. */
|
||||||
__asm volatile(
|
__asm volatile(
|
||||||
" ldr r0, =0xE000ED08 \n" /* Use the NVIC offset register to locate the stack. */
|
" ldr r0, =0xE000ED08 \n" /* Use the NVIC offset register to locate the stack. */
|
||||||
" ldr r0, [r0] \n"
|
" ldr r0, [r0] \n"
|
||||||
" ldr r0, [r0] \n"
|
" ldr r0, [r0] \n"
|
||||||
" msr msp, r0 \n" /* Set the msp back to the start of the stack. */
|
" msr msp, r0 \n" /* Set the msp back to the start of the stack. */
|
||||||
|
" mov r0, #0 \n" /* Clear the bit that indicates the FPU is in use, see comment above. */
|
||||||
|
" msr control, r0 \n"
|
||||||
" cpsie i \n" /* Globally enable interrupts. */
|
" cpsie i \n" /* Globally enable interrupts. */
|
||||||
" cpsie f \n"
|
" cpsie f \n"
|
||||||
" dsb \n"
|
" dsb \n"
|
||||||
|
|
|
@ -173,7 +173,7 @@ typedef struct MPU_SETTINGS
|
||||||
|
|
||||||
#define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) )
|
#define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) )
|
||||||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
||||||
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ not necessary for to use this port. They are defined so the common demo files
|
||||||
/* Set the privilege level to user mode if xRunningPrivileged is false. */
|
/* Set the privilege level to user mode if xRunningPrivileged is false. */
|
||||||
portFORCE_INLINE static void vPortResetPrivilege( BaseType_t xRunningPrivileged )
|
portFORCE_INLINE static void vPortResetPrivilege( BaseType_t xRunningPrivileged )
|
||||||
{
|
{
|
||||||
if( xRunningPrivileged != pdTRUE )
|
if( xRunningPrivileged != pdTRUE )
|
||||||
{
|
{
|
||||||
__asm volatile ( " mrs r0, control \n" \
|
__asm volatile ( " mrs r0, control \n" \
|
||||||
" orr r0, #1 \n" \
|
" orr r0, #1 \n" \
|
||||||
|
|
|
@ -285,11 +285,17 @@ void vPortSVCHandler( void )
|
||||||
|
|
||||||
static void prvPortStartFirstTask( void )
|
static void prvPortStartFirstTask( void )
|
||||||
{
|
{
|
||||||
|
/* Start the first task. This also clears the bit that indicates the FPU is
|
||||||
|
in use in case the FPU was used before the scheduler was started - which
|
||||||
|
would otherwise result in the unnecessary leaving of space in the SVC stack
|
||||||
|
for lazy saving of FPU registers. */
|
||||||
__asm volatile(
|
__asm volatile(
|
||||||
" ldr r0, =0xE000ED08 \n" /* Use the NVIC offset register to locate the stack. */
|
" ldr r0, =0xE000ED08 \n" /* Use the NVIC offset register to locate the stack. */
|
||||||
" ldr r0, [r0] \n"
|
" ldr r0, [r0] \n"
|
||||||
" ldr r0, [r0] \n"
|
" ldr r0, [r0] \n"
|
||||||
" msr msp, r0 \n" /* Set the msp back to the start of the stack. */
|
" msr msp, r0 \n" /* Set the msp back to the start of the stack. */
|
||||||
|
" mov r0, #0 \n" /* Clear the bit that indicates the FPU is in use, see comment above. */
|
||||||
|
" msr control, r0 \n"
|
||||||
" cpsie i \n" /* Globally enable interrupts. */
|
" cpsie i \n" /* Globally enable interrupts. */
|
||||||
" cpsie f \n"
|
" cpsie f \n"
|
||||||
" dsb \n"
|
" dsb \n"
|
||||||
|
@ -342,6 +348,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
|
|
@ -279,6 +279,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
|
|
@ -314,6 +314,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
|
|
@ -160,6 +160,12 @@ vPortStartFirstTask
|
||||||
ldr r0, [r0]
|
ldr r0, [r0]
|
||||||
/* Set the msp back to the start of the stack. */
|
/* Set the msp back to the start of the stack. */
|
||||||
msr msp, r0
|
msr msp, r0
|
||||||
|
/* Clear the bit that indicates the FPU is in use in case the FPU was used
|
||||||
|
before the scheduler was started - which would otherwise result in the
|
||||||
|
unnecessary leaving of space in the SVC stack for lazy saving of FPU
|
||||||
|
registers. */
|
||||||
|
mov r0, #0
|
||||||
|
msr control, r0
|
||||||
/* Call SVC to start the first task. */
|
/* Call SVC to start the first task. */
|
||||||
cpsie i
|
cpsie i
|
||||||
cpsie f
|
cpsie f
|
||||||
|
|
|
@ -298,6 +298,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
|
|
@ -162,6 +162,12 @@ vPortStartFirstTask
|
||||||
ldr r0, [r0]
|
ldr r0, [r0]
|
||||||
/* Set the msp back to the start of the stack. */
|
/* Set the msp back to the start of the stack. */
|
||||||
msr msp, r0
|
msr msp, r0
|
||||||
|
/* Clear the bit that indicates the FPU is in use in case the FPU was used
|
||||||
|
before the scheduler was started - which would otherwise result in the
|
||||||
|
unnecessary leaving of space in the SVC stack for lazy saving of FPU
|
||||||
|
registers. */
|
||||||
|
mov r0, #0
|
||||||
|
msr control, r0
|
||||||
/* Call SVC to start the first task. */
|
/* Call SVC to start the first task. */
|
||||||
cpsie i
|
cpsie i
|
||||||
cpsie f
|
cpsie f
|
||||||
|
|
|
@ -104,6 +104,7 @@ task.h is included from an application file. */
|
||||||
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
|
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
|
||||||
#endif /* configAPPLICATION_ALLOCATED_HEAP */
|
#endif /* configAPPLICATION_ALLOCATED_HEAP */
|
||||||
|
|
||||||
|
/* Index into the ucHeap array. */
|
||||||
static size_t xNextFreeByte = ( size_t ) 0;
|
static size_t xNextFreeByte = ( size_t ) 0;
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -153,6 +153,7 @@ is defined. */
|
||||||
#define basepri 17
|
#define basepri 17
|
||||||
#define msp 8
|
#define msp 8
|
||||||
#define ipsr 5
|
#define ipsr 5
|
||||||
|
#define control 20
|
||||||
|
|
||||||
/* From port.c. */
|
/* From port.c. */
|
||||||
extern void *pxCurrentTCB;
|
extern void *pxCurrentTCB;
|
||||||
|
@ -287,7 +288,7 @@ void vPortSVCHandler( void ) iv IVT_INT_SVCall ics ICS_OFF
|
||||||
ldm r0!, (r4-r11, r14)/* Pop the registers that are not automatically saved on exception entry and the critical nesting count. */
|
ldm r0!, (r4-r11, r14)/* Pop the registers that are not automatically saved on exception entry and the critical nesting count. */
|
||||||
msr psp, r0 /* Restore the task stack pointer. */
|
msr psp, r0 /* Restore the task stack pointer. */
|
||||||
isb
|
isb
|
||||||
mov r0, #0
|
mov r0, #0
|
||||||
msr basepri, r0
|
msr basepri, r0
|
||||||
bx r14
|
bx r14
|
||||||
};
|
};
|
||||||
|
@ -299,8 +300,14 @@ static void prvPortStartFirstTask( void )
|
||||||
__asm {
|
__asm {
|
||||||
ldr r0, =0xE000ED08 /* Use the NVIC offset register to locate the stack. */
|
ldr r0, =0xE000ED08 /* Use the NVIC offset register to locate the stack. */
|
||||||
ldr r0, [r0]
|
ldr r0, [r0]
|
||||||
ldr r0, [r0]
|
ldr r0, [r0]
|
||||||
msr msp, r0 /* Set the msp back to the start of the stack. */
|
msr msp, r0 /* Set the msp back to the start of the stack. */
|
||||||
|
/* Clear the bit that indicates the FPU is in use in case the FPU was used
|
||||||
|
before the scheduler was started - which would otherwise result in the
|
||||||
|
unnecessary leaving of space in the SVC stack for lazy saving of FPU
|
||||||
|
registers. */
|
||||||
|
mov r0, #0
|
||||||
|
msr control, r0
|
||||||
cpsie i /* Globally enable interrupts. */
|
cpsie i /* Globally enable interrupts. */
|
||||||
cpsie f
|
cpsie f
|
||||||
dsb
|
dsb
|
||||||
|
@ -357,6 +364,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
|
|
@ -325,6 +325,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
|
|
@ -302,6 +302,12 @@ __asm void prvStartFirstTask( void )
|
||||||
ldr r0, [r0]
|
ldr r0, [r0]
|
||||||
/* Set the msp back to the start of the stack. */
|
/* Set the msp back to the start of the stack. */
|
||||||
msr msp, r0
|
msr msp, r0
|
||||||
|
/* Clear the bit that indicates the FPU is in use in case the FPU was used
|
||||||
|
before the scheduler was started - which would otherwise result in the
|
||||||
|
unnecessary leaving of space in the SVC stack for lazy saving of FPU
|
||||||
|
registers. */
|
||||||
|
mov r0, #0
|
||||||
|
msr control, r0
|
||||||
/* Globally enable interrupts. */
|
/* Globally enable interrupts. */
|
||||||
cpsie i
|
cpsie i
|
||||||
cpsie f
|
cpsie f
|
||||||
|
@ -382,6 +388,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
|
|
@ -381,6 +381,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
@ -426,11 +444,20 @@ __asm void prvStartFirstTask( void )
|
||||||
{
|
{
|
||||||
PRESERVE8
|
PRESERVE8
|
||||||
|
|
||||||
ldr r0, =0xE000ED08 /* Use the NVIC offset register to locate the stack. */
|
/* Use the NVIC offset register to locate the stack. */
|
||||||
|
ldr r0, =0xE000ED08
|
||||||
ldr r0, [r0]
|
ldr r0, [r0]
|
||||||
ldr r0, [r0]
|
ldr r0, [r0]
|
||||||
msr msp, r0 /* Set the msp back to the start of the stack. */
|
/* Set the msp back to the start of the stack. */
|
||||||
cpsie i /* Globally enable interrupts. */
|
msr msp, r0
|
||||||
|
/* Clear the bit that indicates the FPU is in use in case the FPU was used
|
||||||
|
before the scheduler was started - which would otherwise result in the
|
||||||
|
unnecessary leaving of space in the SVC stack for lazy saving of FPU
|
||||||
|
registers. */
|
||||||
|
mov r0, #0
|
||||||
|
msr control, r0
|
||||||
|
/* Globally enable interrupts. */
|
||||||
|
cpsie i
|
||||||
cpsie f
|
cpsie f
|
||||||
dsb
|
dsb
|
||||||
isb
|
isb
|
||||||
|
|
|
@ -179,7 +179,7 @@ typedef struct MPU_SETTINGS
|
||||||
|
|
||||||
#define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) )
|
#define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) )
|
||||||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
||||||
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ static portFORCE_INLINE void vPortClearBASEPRIFromISR( void )
|
||||||
__asm
|
__asm
|
||||||
{
|
{
|
||||||
/* Set BASEPRI to 0 so no interrupts are masked. This function is only
|
/* Set BASEPRI to 0 so no interrupts are masked. This function is only
|
||||||
used to lower the mask in an interrupt, so memory barriers are not
|
used to lower the mask in an interrupt, so memory barriers are not
|
||||||
used. */
|
used. */
|
||||||
msr basepri, #0
|
msr basepri, #0
|
||||||
}
|
}
|
||||||
|
@ -326,10 +326,10 @@ BaseType_t xReturn;
|
||||||
portFORCE_INLINE static void vPortResetPrivilege( BaseType_t xRunningPrivileged )
|
portFORCE_INLINE static void vPortResetPrivilege( BaseType_t xRunningPrivileged )
|
||||||
{
|
{
|
||||||
uint32_t ulReg;
|
uint32_t ulReg;
|
||||||
|
|
||||||
if( xRunningPrivileged != pdTRUE )
|
if( xRunningPrivileged != pdTRUE )
|
||||||
{
|
{
|
||||||
__asm
|
__asm
|
||||||
{
|
{
|
||||||
mrs ulReg, control
|
mrs ulReg, control
|
||||||
orr ulReg, #1
|
orr ulReg, #1
|
||||||
|
|
|
@ -296,6 +296,12 @@ __asm void prvStartFirstTask( void )
|
||||||
ldr r0, [r0]
|
ldr r0, [r0]
|
||||||
/* Set the msp back to the start of the stack. */
|
/* Set the msp back to the start of the stack. */
|
||||||
msr msp, r0
|
msr msp, r0
|
||||||
|
/* Clear the bit that indicates the FPU is in use in case the FPU was used
|
||||||
|
before the scheduler was started - which would otherwise result in the
|
||||||
|
unnecessary leaving of space in the SVC stack for lazy saving of FPU
|
||||||
|
registers. */
|
||||||
|
mov r0, #0
|
||||||
|
msr control, r0
|
||||||
/* Globally enable interrupts. */
|
/* Globally enable interrupts. */
|
||||||
cpsie i
|
cpsie i
|
||||||
cpsie f
|
cpsie f
|
||||||
|
@ -366,6 +372,24 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
ucMaxPriorityValue <<= ( uint8_t ) 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __NVIC_PRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the CMSIS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == __NVIC_PRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef configPRIO_BITS
|
||||||
|
{
|
||||||
|
/* Check the FreeRTOS configuration that defines the number of
|
||||||
|
priority bits matches the number of priority bits actually queried
|
||||||
|
from the hardware. */
|
||||||
|
configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Shift the priority group value back to its position within the AIRCR
|
/* Shift the priority group value back to its position within the AIRCR
|
||||||
register. */
|
register. */
|
||||||
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;
|
||||||
|
|
|
@ -567,6 +567,32 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength, const UBaseT
|
||||||
#endif
|
#endif
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
|
||||||
|
|
||||||
|
void* xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore )
|
||||||
|
{
|
||||||
|
void *pxReturn;
|
||||||
|
|
||||||
|
configASSERT( xSemaphore );
|
||||||
|
|
||||||
|
/* Mutexes cannot be used in interrupt service routines, so the mutex
|
||||||
|
holder should not change in an ISR, and therefore a critical section is
|
||||||
|
not required here. */
|
||||||
|
if( ( ( Queue_t * ) xSemaphore )->uxQueueType == queueQUEUE_IS_MUTEX )
|
||||||
|
{
|
||||||
|
pxReturn = ( void * ) ( ( Queue_t * ) xSemaphore )->pxMutexHolder;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pxReturn = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pxReturn;
|
||||||
|
} /*lint !e818 xSemaphore cannot be a pointer to const because it is a typedef. */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( configUSE_RECURSIVE_MUTEXES == 1 )
|
#if ( configUSE_RECURSIVE_MUTEXES == 1 )
|
||||||
|
|
||||||
BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex )
|
BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex )
|
||||||
|
|
|
@ -2491,7 +2491,7 @@ implementations require configUSE_TICKLESS_IDLE to be set to a value other than
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xTaskResumeAll();
|
( void ) xTaskResumeAll();
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
@ -2962,10 +2962,9 @@ BaseType_t xReturn;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
BaseType_t xTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem, const TickType_t xItemValue )
|
void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem, const TickType_t xItemValue )
|
||||||
{
|
{
|
||||||
TCB_t *pxUnblockedTCB;
|
TCB_t *pxUnblockedTCB;
|
||||||
BaseType_t xReturn;
|
|
||||||
|
|
||||||
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by
|
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by
|
||||||
the event flags implementation. */
|
the event flags implementation. */
|
||||||
|
@ -2988,22 +2987,12 @@ BaseType_t xReturn;
|
||||||
|
|
||||||
if( pxUnblockedTCB->uxPriority > pxCurrentTCB->uxPriority )
|
if( pxUnblockedTCB->uxPriority > pxCurrentTCB->uxPriority )
|
||||||
{
|
{
|
||||||
/* Return true if the task removed from the event list has
|
/* The unblocked task has a priority above that of the calling task, so
|
||||||
a higher priority than the calling task. This allows
|
a context switch is required. This function is called with the
|
||||||
the calling task to know if it should force a context
|
scheduler suspended so xYieldPending is set so the context switch
|
||||||
switch now. */
|
occurs immediately that the scheduler is resumed (unsuspended). */
|
||||||
xReturn = pdTRUE;
|
|
||||||
|
|
||||||
/* Mark that a yield is pending in case the user is not using the
|
|
||||||
"xHigherPriorityTaskWoken" parameter to an ISR safe FreeRTOS function. */
|
|
||||||
xYieldPending = pdTRUE;
|
xYieldPending = pdTRUE;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
xReturn = pdFALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return xReturn;
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -3438,7 +3427,7 @@ static void prvCheckTasksWaitingTermination( void )
|
||||||
pxTaskStatus->eCurrentState = eBlocked;
|
pxTaskStatus->eCurrentState = eBlocked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xTaskResumeAll();
|
( void ) xTaskResumeAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* INCLUDE_vTaskSuspend */
|
#endif /* INCLUDE_vTaskSuspend */
|
||||||
|
@ -3502,7 +3491,7 @@ static void prvCheckTasksWaitingTermination( void )
|
||||||
|
|
||||||
static UBaseType_t prvListTasksWithinSingleList( TaskStatus_t *pxTaskStatusArray, List_t *pxList, eTaskState eState )
|
static UBaseType_t prvListTasksWithinSingleList( TaskStatus_t *pxTaskStatusArray, List_t *pxList, eTaskState eState )
|
||||||
{
|
{
|
||||||
volatile TCB_t *pxNextTCB, *pxFirstTCB;
|
configLIST_VOLATILE TCB_t *pxNextTCB, *pxFirstTCB;
|
||||||
UBaseType_t uxTask = 0;
|
UBaseType_t uxTask = 0;
|
||||||
|
|
||||||
if( listCURRENT_LIST_LENGTH( pxList ) > ( UBaseType_t ) 0 )
|
if( listCURRENT_LIST_LENGTH( pxList ) > ( UBaseType_t ) 0 )
|
||||||
|
|
Loading…
Reference in a new issue