From 10659200fba2843014eeb16adb483fbc63c3d9f8 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Mon, 24 Sep 2012 11:01:17 +0000 Subject: [PATCH] Added Cortex-M optimised code to the IAR, GCC and Keil Cortex-M port layers. Tested and updated a few Cortex-M projects to use configUSE_PORT_OPTIMISED_TASK_SELECTION set to 1. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1782 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../CORTEX_LM3Sxxxx_IAR_Keil/FreeRTOSConfig.h | 22 +-- .../CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.Opt | 30 ++--- .../CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.ewd | 125 ++++++++++++++++-- .../CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.ewp | 32 ++++- FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/main.c | 14 +- .../settings/RTOSDemo.cspy.bat | 13 +- .../settings/RTOSDemo.dbgdt | 18 +-- .../settings/RTOSDemo.dni | 38 ++++-- .../settings/RTOSDemo.wsdt | 6 +- .../CORTEX_LM3Sxxxx_Rowley/FreeRTOSConfig.h | 24 ++-- .../Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzp | 4 +- .../Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzs | 24 ++-- FreeRTOS/Demo/WIN32-MSVC/WIN32.suo | Bin 54784 -> 54784 bytes .../Source/portable/GCC/ARM_CM3/portmacro.h | 63 ++++++--- .../Source/portable/GCC/ARM_CM4F/portmacro.h | 27 ++++ .../Source/portable/IAR/ARM_CM3/portmacro.h | 34 +++-- .../Source/portable/IAR/ARM_CM4F/portmacro.h | 18 +++ .../Source/portable/RVDS/ARM_CM3/portmacro.h | 19 +++ .../Source/portable/RVDS/ARM_CM4F/portmacro.h | 19 +++ 19 files changed, 411 insertions(+), 119 deletions(-) diff --git a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/FreeRTOSConfig.h index 764f78def..7d8f0ae72 100644 --- a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/FreeRTOSConfig.h @@ -40,7 +40,7 @@ FreeRTOS WEB site. 1 tab == 4 spaces! - + *************************************************************************** * * * Having a problem? Start by reading the FAQ "My application does * @@ -50,17 +50,17 @@ * * *************************************************************************** - - http://www.FreeRTOS.org - Documentation, training, latest information, + + http://www.FreeRTOS.org - Documentation, training, latest information, license and contact details. - + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool. - Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell - the code with commercial support, indemnification, and middleware, under + Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell + the code with commercial support, indemnification, and middleware, under the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also - provide a safety engineered and independently SIL3 certified version under + provide a safety engineered and independently SIL3 certified version under the SafeRTOS brand: http://www.SafeRTOS.com. */ @@ -74,7 +74,7 @@ * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html. *----------------------------------------------------------*/ @@ -95,7 +95,7 @@ #define configUSE_RECURSIVE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 2 -#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 ) +#define configMAX_PRIORITIES ( 5UL ) #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configQUEUE_REGISTRY_SIZE 10 @@ -118,5 +118,9 @@ to exclude the API function. */ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( 5 << 5 ) /* Priority 5, or 160 as only the top three bits are implemented. */ +/* Use the Cortex-M3 optimised task selection rather than the generic C code +version. */ +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 + #endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.Opt b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.Opt index 6a29b7a5c..89e6a0a82 100644 --- a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.Opt +++ b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.Opt @@ -13,24 +13,24 @@ Target (FreeRTOS_Demo), 0x0004 // Tools: 'ARM-ADS' GRPOPT 1,(Demo_Source),1,0,0 GRPOPT 2,(Libraries),0,0,0 -GRPOPT 3,(RTOS_Source),1,0,0 +GRPOPT 3,(RTOS_Source),0,0,0 GRPOPT 4,(uIP_Source),0,0,0 OPTFFF 1,1,1,0,0,0,0,0,<..\Common\Minimal\BlockQ.c> OPTFFF 1,2,1,0,0,0,0,0,<..\Common\Minimal\blocktim.c> OPTFFF 1,3,1,0,0,0,0,0,<..\Common\Minimal\death.c> OPTFFF 1,4,1,0,0,0,0,0,<..\Common\Minimal\integer.c> -OPTFFF 1,5,1,0,0,216,228,0,<.\main.c> { 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,232,255,255,255,110,0,0,0,115,0,0,0,248,3,0,0,22,2,0,0 } +OPTFFF 1,5,1,553648128,0,67,67,0,<.\main.c> OPTFFF 1,6,1,0,0,0,0,0,<.\ParTest\ParTest.c> OPTFFF 1,7,1,0,0,0,0,0,<..\Common\Minimal\PollQ.c> OPTFFF 1,8,1,0,0,0,0,0,<..\Common\Minimal\semtest.c> OPTFFF 1,9,2,0,0,0,0,0,<.\startup_rvmdk.S> OPTFFF 1,10,1,0,0,0,0,0,<.\timertest.c> -OPTFFF 1,11,5,922746880,0,0,0,0,<.\FreeRTOSConfig.h> +OPTFFF 1,11,5,822083584,0,0,0,0,<.\FreeRTOSConfig.h> OPTFFF 1,12,1,0,0,0,0,0,<..\Common\Minimal\GenQTest.c> -OPTFFF 1,13,1,0,0,0,0,0,<..\Common\Minimal\QPeek.c> -OPTFFF 1,14,1,721420288,0,83,83,0,<.\IntQueueTimer.c> { 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,232,255,255,255,44,0,0,0,46,0,0,0,171,3,0,0,193,1,0,0 } -OPTFFF 1,15,1,33554434,0,628,653,0,<..\Common\Minimal\IntQueue.c> { 44,0,0,0,2,0,0,0,3,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,232,255,255,255,66,0,0,0,69,0,0,0,193,3,0,0,216,1,0,0 } +OPTFFF 1,13,1,1,0,0,0,0,<..\Common\Minimal\QPeek.c> +OPTFFF 1,14,1,0,0,0,0,0,<.\IntQueueTimer.c> +OPTFFF 1,15,1,0,0,0,0,0,<..\Common\Minimal\IntQueue.c> OPTFFF 1,16,1,0,0,0,0,0,<..\Common\Minimal\recmutex.c> OPTFFF 2,17,1,0,0,0,0,0,<.\rit128x96x4.c> OPTFFF 2,18,1,0,0,0,0,0,<.\osram128x64x4.c> @@ -40,9 +40,9 @@ OPTFFF 2,21,4,0,0,0,0,0,<..\Common\drivers\LuminaryMicro\Keil\grlib.lib> OPTFFF 3,23,1,0,0,0,0,0,<..\..\Source\list.c> OPTFFF 3,24,1,0,0,0,0,0,<..\..\Source\queue.c> -OPTFFF 3,25,1,0,0,122,122,0,<..\..\Source\portable\RVDS\ARM_CM3\port.c> { 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,232,255,255,255,22,0,0,0,23,0,0,0,173,4,0,0,170,1,0,0 } +OPTFFF 3,25,1,0,0,0,0,0,<..\..\Source\portable\RVDS\ARM_CM3\port.c> OPTFFF 3,26,1,0,0,0,0,0,<..\..\Source\portable\MemMang\heap_2.c> -OPTFFF 4,27,1,822083584,0,0,0,0,<.\webserver\uIP_Task.c> +OPTFFF 4,27,1,0,0,0,0,0,<.\webserver\uIP_Task.c> OPTFFF 4,28,1,0,0,0,0,0,<.\webserver\emac.c> OPTFFF 4,29,1,0,0,0,0,0,<.\webserver\httpd.c> OPTFFF 4,30,1,0,0,0,0,0,<.\webserver\httpd-cgi.c> @@ -56,23 +56,21 @@ OPTFFF 4,36,1,0,0,0,0,0,<..\Common\ethernet\uIP\uip-1.0\uip\uip.c> TARGOPT 1, (FreeRTOS_Demo) ADSCLK=8000000 - OPTTT 1,1,1,0 + OPTTT 0,1,1,0 OPTHX 1,65535,0,0,0 OPTLX 79,66,8,<.\rvmdk\> OPTOX 16 OPTLT 1,1,1,0,1,1,0,1,0,0,0,0 OPTXL 1,1,1,1,1,1,1,0,0 OPTFL 1,0,1 - OPTAX 255 - OPTBL 0,(Data Sheet) + OPTAX 0 OPTDL (SARMCM3.DLL)()(DLM.DLL)(-pLM3S8962)(SARMCM3.DLL)()(TLM.DLL)(-pLM3S8962) OPTDBG 48126,4,()()()()()()()()()() (BIN\lmidk-agdi.dll)()()() - OPTKEY 0,(UL2CM3)(-UU0101L5E -O14 -S0 -C0 -N00("ARM Cortex-M3") -D00(1BA00477) -L00(4) -FO7 -FD20000000 -FC800 -FN1 -FF0LM3S_256 -FS00 -FL040000) - OPTKEY 0,(DLGTARM)((1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(101=-1,-1,-1,-1,0)(102=-1,-1,-1,-1,0)(103=-1,-1,-1,-1,0)(104=-1,-1,-1,-1,0)(105=-1,-1,-1,-1,0)(106=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0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ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÈp¶{Öäö) + OPTDF 0x80 OPTLE <> OPTLC <> EndOpt diff --git a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.ewd b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.ewd index 07de60338..1f046f824 100644 --- a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.ewd +++ b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.ewd @@ -12,7 +12,7 @@ C-SPY 2 - 22 + 23 1 1 + @@ -313,7 +317,7 @@ JLINK_ID 2 - 13 + 14 1 1 + + @@ -740,6 +752,63 @@ + + RDIJTAGJET_ID + 0 + + 1 + 1 + 1 + + + + + + + + + + + + + + STLINK_ID 2 @@ -803,7 +872,45 @@ + + XDS100_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin 0 @@ -849,16 +956,12 @@ 0 - $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\FreeRTOS\FreeRTOSPlugin.ewplugin + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin 0 - $EW_DIR$\common\plugins\OpenRTOS\OpenRTOSPlugin.ewplugin - 0 + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin diff --git a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.ewp b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.ewp index 32edafc2a..79013b234 100644 --- a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.ewp +++ b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/RTOSDemo.ewp @@ -87,7 +87,7 @@