From: rtel Date: Sun, 21 Dec 2014 10:26:36 +0000 (+0000) Subject: Kernel changes: X-Git-Tag: V8.2.0rc1~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0d859af17f26a3be89530391d736793fc7e25a34;p=freertos Kernel changes: + Made xTaskNotifyGiveFromISR() its own function, rather than a macro that calls xTaskNotifyFromISR() (minor performance improvement). + GCC and Keil Cortex-M4F ports now use vPortRaiseBASEPRI() in place of ulPortRaiseBASEPRI() where the return value is not required (minor performance improvement). Demo changes: Change the [very basic] FreeRTOS+UDP SAM4E driver to use task notifications rather than a semaphore (execution time now 55% what it was in FreeRTOS V8.1.2!). Robustness improvements to IntQueue.c standard demo task.h. Added the latest standard demo tasks, reg test tasks and int q tasks to the SAM4E demo. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2317 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/CLICommands/UDPCommandServer.c b/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/CLICommands/UDPCommandServer.c index e1211c18e..bcc805bb1 100644 --- a/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/CLICommands/UDPCommandServer.c +++ b/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/CLICommands/UDPCommandServer.c @@ -85,7 +85,7 @@ #define cmdMAX_INPUT_SIZE 60 /* Dimensions the buffer into which string outputs can be placed. */ -#define cmdMAX_OUTPUT_SIZE 1024 +#define cmdMAX_OUTPUT_SIZE 1250 /* Dimensions the buffer passed to the recvfrom() call. */ #define cmdSOCKET_INPUT_BUFFER_SIZE 60 diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_UDP_IP.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_UDP_IP.c index e9006adf7..a4d204b58 100644 --- a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_UDP_IP.c +++ b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_UDP_IP.c @@ -392,7 +392,7 @@ xIPStackEvent_t xReceivedEvent; /* Create the ARP timer, but don't start it until the network has connected. */ - xARPTimer = xTimerCreate( "ARPTimer", ( ipARP_TIMER_PERIOD_MS / portTICK_RATE_MS ), pdTRUE, ( void * ) eARPTimerEvent, vIPFunctionsTimerCallback ); + xARPTimer = xTimerCreate( "ARPTimer", ( ipARP_TIMER_PERIOD_MS / portTICK_RATE_MS ), pdTRUE, ( void * ) eARPTimerEvent, vIPFunctionsTimerCallback ); configASSERT( xARPTimer ); /* Generate a dummy message to say that the network connection has gone diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/SAM4E/NetworkInterface.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/SAM4E/NetworkInterface.c index 619bdee3a..0d262194a 100644 --- a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/SAM4E/NetworkInterface.c +++ b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/SAM4E/NetworkInterface.c @@ -81,13 +81,12 @@ static void prvGMACRxCallback( uint32_t ulStatus ); /* The queue used to communicate Ethernet events to the IP task. */ extern xQueueHandle xNetworkEventQueue; -/* The semaphore used to wake the deferred interrupt handler task when an Rx -interrupt is received. */ -static xSemaphoreHandle xGMACRxEventSemaphore = NULL; - /* The GMAC driver instance. */ static gmac_device_t xGMACStruct; +/* Handle of the task used to process MAC events. */ +static TaskHandle_t xMACEventHandlingTask = NULL; + /*-----------------------------------------------------------*/ BaseType_t xNetworkInterfaceInitialise( void ) @@ -123,20 +122,6 @@ BaseType_t xReturn = pdFALSE; vTaskDelay( xPHYDelay_400ms * 2UL ); if( ethernet_phy_set_link( GMAC, BOARD_GMAC_PHY_ADDR, 1 ) == GMAC_OK ) { - /* Create the event semaphore if it has not already been - created. */ - if( xGMACRxEventSemaphore == NULL ) - { - xGMACRxEventSemaphore = xSemaphoreCreateCounting( ULONG_MAX, 0 ); - #if ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 - { - /* If the trace recorder code is included name the semaphore for - viewing in FreeRTOS+Trace. */ - vTraceSetQueueName( xGMACRxEventSemaphore, "MAC_RX" ); - } - #endif /* ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 */ - } - /* Register the callbacks. */ gmac_dev_set_rx_callback( &xGMACStruct, prvGMACRxCallback ); @@ -149,7 +134,7 @@ BaseType_t xReturn = pdFALSE; configMINIMAL_STACK_SIZE, /* Stack allocated to the task (defined in words, not bytes). */ NULL, /* The task parameter is not used. */ configMAX_PRIORITIES - 1, /* The priority assigned to the task. */ - NULL ); /* The handle is not required, so NULL is passed. */ + &xMACEventHandlingTask ); /* The handle is stored so the ISR knows which task to notify. */ /* Enable the interrupt and set its priority as configured. THIS DRIVER REQUIRES configMAC_INTERRUPT_PRIORITY TO BE DEFINED, @@ -169,10 +154,12 @@ static void prvGMACRxCallback( uint32_t ulStatus ) { BaseType_t xHigherPriorityTaskWoken = pdFALSE; + configASSERT( xMACEventHandlingTask ); + /* Unblock the deferred interrupt handler task if the event was an Rx. */ if( ulStatus == GMAC_RSR_REC ) { - xSemaphoreGiveFromISR( xGMACRxEventSemaphore, &xHigherPriorityTaskWoken ); + xTaskNotifyGiveFromISR( xMACEventHandlingTask, &xHigherPriorityTaskWoken ); } portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); @@ -220,8 +207,9 @@ xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL }; static const TickType_t xBufferWaitDelay = 1500UL / portTICK_RATE_MS; uint32_t ulReturned; + /* This is a very simply but also inefficient implementation. */ + ( void ) pvParameters; - configASSERT( xGMACRxEventSemaphore ); for( ;; ) { @@ -229,9 +217,9 @@ uint32_t ulReturned; received. The while() loop is only needed if INCLUDE_vTaskSuspend is set to 0 in FreeRTOSConfig.h. If INCLUDE_vTaskSuspend is set to 1 then portMAX_DELAY would be an indefinite block time and - xSemaphoreTake() would only return when the semaphore was actually - obtained. */ - while( xSemaphoreTake( xGMACRxEventSemaphore, portMAX_DELAY ) == pdFALSE ); + xTaskNotifyTake() would only return when the task was actually + notified. */ + while( ulTaskNotifyTake( pdFALSE, portMAX_DELAY ) == 0 ); /* Allocate a buffer to hold the data. */ pxNetworkBuffer = pxNetworkBufferGet( ipTOTAL_ETHERNET_FRAME_SIZE, xBufferWaitDelay ); diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RTOSDemo.uvopt b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RTOSDemo.uvopt index 4d3070ec6..40c44a1b1 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RTOSDemo.uvopt +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RTOSDemo.uvopt @@ -73,7 +73,7 @@ 1 0 - 1 + 0 255 @@ -98,16 +98,6 @@ datashts\arm\cortex_m4\r0p1\DUI0553A_CORTEX_M4_DGUG.PDF - - SARMCM3.DLL - -MPU -REMAP - DCM.DLL - -pCM4 - SARMCM3.DLL - -MPU - TCM.DLL - -pCM4 - 0 1 @@ -126,9 +116,11 @@ 0 1 0 + 1 + 1 0 0 - 7 + 6 @@ -191,6 +183,7 @@ 1 5 0x0C000000 + 0 @@ -280,7 +273,7 @@ 1 0 - 0 + 1 255 @@ -305,16 +298,6 @@ datashts\arm\cortex_m4\r0p1\DUI0553A_CORTEX_M4_DGUG.PDF - - SARMCM3.DLL - -MPU -REMAP - DCM.DLL - -pCM4 - SARMCM3.DLL - -MPU - TCM.DLL - -pCM4 - 0 1 @@ -333,9 +316,11 @@ 0 1 0 + 1 + 1 0 0 - 7 + 6 @@ -391,6 +376,7 @@ 1 2 0x20005f90 + 0 @@ -399,7 +385,7 @@ 0 1 - 1 + 0 0 0 0 @@ -505,16 +491,6 @@ datashts\arm\cortex_m4\r0p1\DUI0553A_CORTEX_M4_DGUG.PDF - - SARMCM3.DLL - -MPU -REMAP - DCM.DLL - -pCM4 - SARMCM3.DLL - -MPU - TCM.DLL - -pCM4 - 0 1 @@ -533,6 +509,8 @@ 0 1 0 + 1 + 1 0 0 7 @@ -591,6 +569,7 @@ 1 5 0x0C000000 + 0 @@ -639,10 +618,7 @@ 2 0 0 - 0 0 - 277 - 289 0 .\startup_XMC4500.s startup_XMC4500.s @@ -655,10 +631,7 @@ 1 0 0 - 0 0 - 0 - 0 0 .\System_XMC4500.c System_XMC4500.c @@ -671,10 +644,7 @@ 2 0 0 - 0 0 - 276 - 288 0 .\startup_XMC4200.s startup_XMC4200.s @@ -687,10 +657,7 @@ 1 0 0 - 0 0 - 0 - 0 0 .\system_XMC4200.c system_XMC4200.c @@ -703,10 +670,7 @@ 1 0 0 - 7 0 - 0 - 0 0 .\system_XMC4400.c system_XMC4400.c @@ -719,10 +683,7 @@ 2 0 0 - 0 0 - 276 - 288 0 .\startup_XMC4400.s startup_XMC4400.s @@ -743,10 +704,7 @@ 1 0 0 - 45 0 - 63 - 97 0 .\main.c main.c @@ -759,10 +717,7 @@ 5 0 0 - 0 0 - 1 - 1 0 .\FreeRTOSConfig.h FreeRTOSConfig.h @@ -775,10 +730,7 @@ 1 0 0 - 0 0 - 0 - 0 0 .\RegTest.c RegTest.c @@ -791,10 +743,7 @@ 1 0 0 - 0 0 - 0 - 0 0 .\main_full.c main_full.c @@ -807,10 +756,7 @@ 1 0 0 - 0 0 - 0 - 0 0 .\main_blinky.c main_blinky.c @@ -831,10 +777,7 @@ 1 0 0 - 0 0 - 0 - 0 0 ..\..\Source\timers.c timers.c @@ -847,10 +790,7 @@ 1 0 0 - 0 0 - 0 - 0 0 ..\..\Source\list.c list.c @@ -863,10 +803,7 @@ 1 0 0 - 0 0 - 552 - 560 0 ..\..\Source\queue.c queue.c @@ -879,10 +816,7 @@ 1 0 0 - 0 0 - 0 - 0 0 ..\..\Source\tasks.c tasks.c @@ -895,10 +829,7 @@ 1 0 0 - 0 0 - 420 - 428 0 ..\..\Source\portable\RVDS\ARM_CM4F\port.c port.c @@ -911,10 +842,7 @@ 1 0 0 - 0 0 - 0 - 0 0 ..\..\Source\portable\MemMang\heap_4.c heap_4.c @@ -935,10 +863,7 @@ 1 0 0 - 0 0 - 0 - 0 0 ..\Common\Minimal\semtest.c semtest.c @@ -951,10 +876,7 @@ 1 0 0 - 0 0 - 254 - 262 0 ..\Common\Minimal\sp_flop.c sp_flop.c @@ -967,10 +889,7 @@ 1 0 0 - 0 0 - 0 - 0 0 ..\Common\Minimal\blocktim.c blocktim.c @@ -983,10 +902,7 @@ 1 0 0 - 0 0 - 0 - 0 0 ..\Common\Minimal\countsem.c countsem.c @@ -999,10 +915,7 @@ 1 0 0 - 0 0 - 0 - 0 0 ..\Common\Minimal\dynamic.c dynamic.c @@ -1015,10 +928,7 @@ 1 0 0 - 0 0 - 0 - 0 0 ..\Common\Minimal\GenQTest.c GenQTest.c @@ -1031,10 +941,7 @@ 1 0 0 - 0 0 - 0 - 0 0 ..\Common\Minimal\recmutex.c recmutex.c diff --git a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RTOSDemo.uvproj b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RTOSDemo.uvproj index eed7550aa..54126d504 100644 --- a/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RTOSDemo.uvproj +++ b/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4000_Keil/RTOSDemo.uvproj @@ -30,6 +30,7 @@ SFD\Infineon\XMC4500\xmc4500.sfr + 0 0 @@ -71,6 +72,8 @@ 0 0 + 0 + 0 0 @@ -97,6 +100,7 @@ 3 + 1 SARMCM3.DLL @@ -126,6 +130,7 @@ 1 1 0 + 1 1 @@ -137,9 +142,10 @@ 0 1 0 + 1 0 - 7 + 6 @@ -169,6 +175,10 @@ BIN\UL2CM3.DLL "" () + + + + 0 @@ -347,6 +357,8 @@ 0 0 0 + 0 + 0 --cpu Cortex-M4.fp --no_allow_fpreg_for_nonfpdata rvkdm PART_XMC4500 @@ -363,6 +375,7 @@ 0 0 0 + 0 @@ -379,6 +392,7 @@ 0 0x0C000000 0x10000000 + @@ -421,6 +435,7 @@ 11 + 1 @@ -432,6 +447,7 @@ 2 2 2 + 2 @@ -461,6 +477,7 @@ 11 + 1 @@ -477,6 +494,8 @@ 0 2 2 + 2 + 2 @@ -506,6 +525,7 @@ 11 + 1 @@ -522,6 +542,8 @@ 0 2 2 + 2 + 2 @@ -551,6 +573,7 @@ 11 + 1 @@ -562,6 +585,7 @@ 2 2 2 + 2 @@ -705,6 +729,7 @@ SFD\Infineon\XMC4400\xmc4400.SFR + 0 0 @@ -746,6 +771,8 @@ 0 0 + 0 + 0 0 @@ -772,6 +799,7 @@ 3 + 1 SARMCM3.DLL @@ -801,6 +829,7 @@ 1 1 0 + 1 1 @@ -812,9 +841,10 @@ 0 1 0 + 1 0 - 7 + 6 @@ -844,6 +874,10 @@ BIN\UL2CM3.DLL + + + + 0 @@ -1010,7 +1044,7 @@ 1 - 2 + 1 0 0 0 @@ -1022,6 +1056,8 @@ 0 0 0 + 0 + 0 --cpu Cortex-M4.fp --no_allow_fpreg_for_nonfpdata rvkdm PART_XMC4400 @@ -1038,6 +1074,7 @@ 0 0 0 + 0 @@ -1054,6 +1091,7 @@ 0 0x0C000000 0x10000000 + @@ -1086,6 +1124,7 @@ 11 + 1 @@ -1097,6 +1136,7 @@ 2 2 2 + 2 @@ -1126,6 +1166,7 @@ 11 + 1 @@ -1142,6 +1183,8 @@ 0 2 2 + 2 + 2 @@ -1171,6 +1214,7 @@ 11 + 1 @@ -1182,6 +1226,7 @@ 2 2 2 + 2 @@ -1211,6 +1256,7 @@ 11 + 1 @@ -1227,6 +1273,8 @@ 0 2 2 + 2 + 2 @@ -1380,6 +1428,7 @@ SFD\Infineon\XMC4200-4100\xmc4200.SFR + 0 0 @@ -1421,6 +1470,8 @@ 0 0 + 0 + 0 0 @@ -1447,6 +1498,7 @@ 3 + 1 SARMCM3.DLL @@ -1476,6 +1528,7 @@ 1 1 0 + 1 1 @@ -1487,6 +1540,7 @@ 0 1 0 + 1 0 7 @@ -1519,6 +1573,10 @@ BIN\UL2CM3.DLL "" () + + + + 0 @@ -1697,6 +1755,8 @@ 0 0 0 + 0 + 0 --cpu Cortex-M4.fp --no_allow_fpreg_for_nonfpdata rvkdm PART_XMC4200 @@ -1713,6 +1773,7 @@ 0 0 0 + 0 @@ -1729,6 +1790,7 @@ 0 0x0C000000 0x10000000 + @@ -1761,6 +1823,7 @@ 11 + 1 @@ -1772,6 +1835,7 @@ 2 2 2 + 2 @@ -1801,6 +1865,7 @@ 11 + 1 @@ -1817,6 +1882,8 @@ 0 2 2 + 2 + 2 @@ -1856,6 +1923,7 @@ 11 + 1 @@ -1872,6 +1940,8 @@ 0 2 2 + 2 + 2 @@ -1901,6 +1971,7 @@ 11 + 1 @@ -1912,6 +1983,7 @@ 2 2 2 + 2 diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.atsuo b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.atsuo index 4cebd7529..08cf7bfc1 100644 Binary files a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.atsuo and b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.atsuo differ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.cproj b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.cproj index b917a2836..e3941f3a6 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.cproj +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.cproj @@ -15,8 +15,9 @@