From c3b892c57a2e72f0177acd5ede8e4d9a7cc04d33 Mon Sep 17 00:00:00 2001 From: Anirudha Sarangi Date: Fri, 11 Sep 2015 04:29:14 +0530 Subject: [PATCH] lwip: Fix FreeRTOS related issues in lwip Fix various issues related to new FreeRTOS port in lwip. Signed-off-by: Anirudha Sarangi Acked-by: Harini Katakam --- .../sw_services/lwip141/data/lwip141.tcl | 10 +++++----- .../src/contrib/ports/xilinx/sys_arch.c | 20 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ThirdParty/sw_services/lwip141/data/lwip141.tcl b/ThirdParty/sw_services/lwip141/data/lwip141.tcl index 7cea80c0..7c5d5ef6 100755 --- a/ThirdParty/sw_services/lwip141/data/lwip141.tcl +++ b/ThirdParty/sw_services/lwip141/data/lwip141.tcl @@ -446,13 +446,13 @@ proc generate_lwip_opts {libhandle} { if { [string compare -nocase "freertos821_xilinx" $os_name] == 0} { puts $lwipopts_fd "\#define OS_IS_FREERTOS" puts $lwipopts_fd "\#define DEFAULT_THREAD_PRIO $thread_prio" - puts $lwipopts_fd "\#define TCPIP_THREAD_PRIO (DEFAULT_THREAD_PRIO+1)" - puts $lwipopts_fd "\#define TCPIP_THREAD_STACKSIZE 32768" - puts $lwipopts_fd "\#define DEFAULT_TCP_RECVMBOX_SIZE 300" + puts $lwipopts_fd "\#define TCPIP_THREAD_PRIO ($thread_prio + 1)" + puts $lwipopts_fd "\#define TCPIP_THREAD_STACKSIZE 4096" + puts $lwipopts_fd "\#define DEFAULT_TCP_RECVMBOX_SIZE 200" puts $lwipopts_fd "\#define DEFAULT_ACCEPTMBOX_SIZE 5" - puts $lwipopts_fd "\#define TCPIP_MBOX_SIZE 30" + puts $lwipopts_fd "\#define TCPIP_MBOX_SIZE 200" puts $lwipopts_fd "\#define DEFAULT_UDP_RECVMBOX_SIZE 100" - puts $lwipopts_fd "\#define DEFAULT_RAW_RECVMBOX_SIZE 100" + puts $lwipopts_fd "\#define DEFAULT_RAW_RECVMBOX_SIZE 30" puts $lwipopts_fd "" } } diff --git a/ThirdParty/sw_services/lwip141/src/contrib/ports/xilinx/sys_arch.c b/ThirdParty/sw_services/lwip141/src/contrib/ports/xilinx/sys_arch.c index bcc36839..56897a75 100644 --- a/ThirdParty/sw_services/lwip141/src/contrib/ports/xilinx/sys_arch.c +++ b/ThirdParty/sw_services/lwip141/src/contrib/ports/xilinx/sys_arch.c @@ -551,7 +551,7 @@ void sys_mbox_post( sys_mbox_t *pxMailBox, void *pxMessageToPost ) if( xInsideISR != pdFALSE ) { xQueueSendToBackFromISR( *pxMailBox, &pxMessageToPost, &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - taskYIELD_FROM_ISR(); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } else @@ -580,7 +580,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; { xReturn = xQueueSendFromISR( *pxMailBox, &pxMessageToPost, &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - taskYIELD_FROM_ISR(); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } else @@ -653,7 +653,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS; ulReturn = xElapsed; if (xHigherPriorityTaskWoken == pdTRUE) { - taskYIELD_FROM_ISR(); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } else @@ -682,7 +682,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; if( xInsideISR != pdFALSE ) { xQueueReceiveFromISR( *pxMailBox, &( *ppvBuffer ), &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - taskYIELD_FROM_ISR(); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } else @@ -731,7 +731,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; { lResult = xQueueReceiveFromISR( *pxMailBox, &( *ppvBuffer ), &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - taskYIELD_FROM_ISR(); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } else @@ -824,7 +824,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; xElapsed = (xEndTime - xStartTime) * portTICK_RATE_MS; ulReturn = xElapsed; if (xHigherPriorityTaskWoken == pdTRUE) { - taskYIELD_FROM_ISR(); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } else @@ -849,7 +849,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; if( xInsideISR != pdFALSE ) { xSemaphoreTakeFromISR( *pxSemaphore, &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - taskYIELD_FROM_ISR(); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } else @@ -899,7 +899,7 @@ void sys_mutex_lock( sys_mutex_t *pxMutex ) if( xInsideISR != pdFALSE ) { xSemaphoreTakeFromISR( *pxMutex, &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - taskYIELD_FROM_ISR(); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } else @@ -914,7 +914,7 @@ void sys_mutex_unlock(sys_mutex_t *pxMutex ) if( xInsideISR != pdFALSE ) { xSemaphoreGiveFromISR( *pxMutex, &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) - taskYIELD_FROM_ISR(); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } else xSemaphoreGive( *pxMutex ); @@ -946,7 +946,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; { xSemaphoreGiveFromISR( *pxSemaphore, &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - taskYIELD_FROM_ISR(); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } else