From b8b83c29944cd6fa65cee83cb0aa717e2c294bc7 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Sat, 23 Apr 2016 10:24:17 +0200 Subject: [PATCH] Move some definitions from tcpip_priv.h to better places since they are of "public interest" (LWIP core locking mode, watchdog trigger) --- src/include/lwip/opt.h | 8 ++++++++ src/include/lwip/priv/tcpip_priv.h | 16 ---------------- src/include/lwip/tcpip.h | 10 ++++++++++ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 90cbe472..53260f9c 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -1371,6 +1371,14 @@ #define TCPIP_MBOX_SIZE 0 #endif +/** + * Define this to something that triggers a watchdog. This is called from + * tcpip_thread after processing a message. + */ +#ifndef LWIP_TCPIP_THREAD_ALIVE +#define LWIP_TCPIP_THREAD_ALIVE() +#endif + /** * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. */ diff --git a/src/include/lwip/priv/tcpip_priv.h b/src/include/lwip/priv/tcpip_priv.h index 51f9bcd3..f4ddd576 100644 --- a/src/include/lwip/priv/tcpip_priv.h +++ b/src/include/lwip/priv/tcpip_priv.h @@ -47,22 +47,6 @@ extern "C" { struct pbuf; struct netif; -/** Define this to something that triggers a watchdog. This is called from - * tcpip_thread after processing a message. */ -#ifndef LWIP_TCPIP_THREAD_ALIVE -#define LWIP_TCPIP_THREAD_ALIVE() -#endif - -#if LWIP_TCPIP_CORE_LOCKING -/** The global semaphore to lock the stack. */ -extern sys_mutex_t lock_tcpip_core; -#define LOCK_TCPIP_CORE() sys_mutex_lock(&lock_tcpip_core) -#define UNLOCK_TCPIP_CORE() sys_mutex_unlock(&lock_tcpip_core) -#else /* LWIP_TCPIP_CORE_LOCKING */ -#define LOCK_TCPIP_CORE() -#define UNLOCK_TCPIP_CORE() -#endif /* LWIP_TCPIP_CORE_LOCKING */ - #if LWIP_MPU_COMPATIBLE #define API_VAR_REF(name) (*(name)) #define API_VAR_DECLARE(type, name) type * name diff --git a/src/include/lwip/tcpip.h b/src/include/lwip/tcpip.h index c1235865..adaadb99 100644 --- a/src/include/lwip/tcpip.h +++ b/src/include/lwip/tcpip.h @@ -44,6 +44,16 @@ extern "C" { #endif +#if LWIP_TCPIP_CORE_LOCKING +/** The global semaphore to lock the stack. */ +extern sys_mutex_t lock_tcpip_core; +#define LOCK_TCPIP_CORE() sys_mutex_lock(&lock_tcpip_core) +#define UNLOCK_TCPIP_CORE() sys_mutex_unlock(&lock_tcpip_core) +#else /* LWIP_TCPIP_CORE_LOCKING */ +#define LOCK_TCPIP_CORE() +#define UNLOCK_TCPIP_CORE() +#endif /* LWIP_TCPIP_CORE_LOCKING */ + struct pbuf; struct netif;