From 931b7746a4237abc6f4460a7b6b5cb12f6dac28b Mon Sep 17 00:00:00 2001 From: Anirudha Sarangi Date: Fri, 4 Sep 2015 00:17:49 +0530 Subject: [PATCH] lwip: Add support for the latest freertos821 This patch makes changes to add support for the latest freertos821 by making changes in mld, tcl and sys_arch.c files. Signed-off-by: Anirudha Sarangi Reviewed-by: Punnaiah Choudary Kalluri --- .../sw_services/lwip141/data/lwip141.mld | 2 +- .../sw_services/lwip141/data/lwip141.tcl | 6 ++--- .../src/contrib/ports/xilinx/sys_arch.c | 27 ++++++++----------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/ThirdParty/sw_services/lwip141/data/lwip141.mld b/ThirdParty/sw_services/lwip141/data/lwip141.mld index 72a1a3d8..77781734 100755 --- a/ThirdParty/sw_services/lwip141/data/lwip141.mld +++ b/ThirdParty/sw_services/lwip141/data/lwip141.mld @@ -6,7 +6,7 @@ BEGIN LIBRARY lwip141 OPTION copyfiles = all; OPTION desc = "lwIP TCP/IP Stack library: lwIP v1.4.1"; OPTION app_linker_flags = "-Wl,--start-group,-lxil,-llwip4,-lgcc,-lc,--end-group"; - OPTION requires_os = (standalone xilkernel freertos_zynq); + OPTION requires_os = (standalone xilkernel freertos821_xilinx); OPTION VERSION = 1.2; OPTION NAME = lwip141; diff --git a/ThirdParty/sw_services/lwip141/data/lwip141.tcl b/ThirdParty/sw_services/lwip141/data/lwip141.tcl index 65888e19..a0d812ae 100755 --- a/ThirdParty/sw_services/lwip141/data/lwip141.tcl +++ b/ThirdParty/sw_services/lwip141/data/lwip141.tcl @@ -226,7 +226,7 @@ proc lwip_sw_drc {libhandle emacs_list} { set os_handle [hsi::get_os] set os_name [common::get_property NAME $os_handle] if { [string compare -nocase "xilkernel" $os_name] != 0} { - if { [string compare -nocase "freertos_zynq" $os_name] != 0} { + if { [string compare -nocase "freertos821_xilinx" $os_name] != 0} { error "ERROR: lwIP with Sockets requires \"xilkernel or freertos\" OS" "" "mdt_error" } } @@ -421,10 +421,10 @@ proc generate_lwip_opts {libhandle} { puts $lwipopts_fd "\#define OS_IS_XILKERNEL" puts $lwipopts_fd "\#define TCPIP_THREAD_PRIO $thread_prio" puts $lwipopts_fd "\#define DEFAULT_THREAD_PRIO $thread_prio" - puts $lwipopts_fd "\#define TCPIP_THREAD_STACKSIZE 32768" + puts $lwipopts_fd "\#define TCPIP_THREAD_STACKSIZE 4096" puts $lwipopts_fd "" } - if { [string compare -nocase "freertos_zynq" $os_name] == 0} { + 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)" 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 235f148f..bcc36839 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) { - portYIELD_FROM_ISR(); + taskYIELD_FROM_ISR(); } } else @@ -580,7 +580,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; { xReturn = xQueueSendFromISR( *pxMailBox, &pxMessageToPost, &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - portYIELD_FROM_ISR(); + taskYIELD_FROM_ISR(); } } else @@ -653,7 +653,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS; ulReturn = xElapsed; if (xHigherPriorityTaskWoken == pdTRUE) { - portYIELD_FROM_ISR(); + taskYIELD_FROM_ISR(); } } else @@ -682,7 +682,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; if( xInsideISR != pdFALSE ) { xQueueReceiveFromISR( *pxMailBox, &( *ppvBuffer ), &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - portYIELD_FROM_ISR(); + taskYIELD_FROM_ISR(); } } else @@ -731,7 +731,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; { lResult = xQueueReceiveFromISR( *pxMailBox, &( *ppvBuffer ), &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - portYIELD_FROM_ISR(); + taskYIELD_FROM_ISR(); } } else @@ -768,15 +768,10 @@ err_t sys_sem_new( sys_sem_t *pxSemaphore, u8_t ucCount ) { err_t xReturn = ERR_MEM; - vSemaphoreCreateBinary( ( *pxSemaphore ) ); + *pxSemaphore = xSemaphoreCreateBinary(); if( *pxSemaphore != NULL ) { - if( ucCount == 0U ) - { - xSemaphoreTake( *pxSemaphore, 1UL ); - } - xReturn = ERR_OK; SYS_STATS_INC_USED( sem ); } @@ -829,7 +824,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; xElapsed = (xEndTime - xStartTime) * portTICK_RATE_MS; ulReturn = xElapsed; if (xHigherPriorityTaskWoken == pdTRUE) { - portYIELD_FROM_ISR(); + taskYIELD_FROM_ISR(); } } else @@ -854,7 +849,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; if( xInsideISR != pdFALSE ) { xSemaphoreTakeFromISR( *pxSemaphore, &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - portYIELD_FROM_ISR(); + taskYIELD_FROM_ISR(); } } else @@ -904,7 +899,7 @@ void sys_mutex_lock( sys_mutex_t *pxMutex ) if( xInsideISR != pdFALSE ) { xSemaphoreTakeFromISR( *pxMutex, &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - portYIELD_FROM_ISR(); + taskYIELD_FROM_ISR(); } } else @@ -919,7 +914,7 @@ void sys_mutex_unlock(sys_mutex_t *pxMutex ) if( xInsideISR != pdFALSE ) { xSemaphoreGiveFromISR( *pxMutex, &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) - portYIELD_FROM_ISR(); + taskYIELD_FROM_ISR(); } else xSemaphoreGive( *pxMutex ); @@ -951,7 +946,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; { xSemaphoreGiveFromISR( *pxSemaphore, &xHigherPriorityTaskWoken ); if (xHigherPriorityTaskWoken == pdTRUE) { - portYIELD_FROM_ISR(); + taskYIELD_FROM_ISR(); } } else