mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-17 21:56:45 +08:00
Speed up LWIP_TCPIP_CORE_LOCKING by directly calling functions in api_msg.c instead of calling via function pointer.
This commit is contained in:
@@ -59,14 +59,25 @@ extern "C" {
|
||||
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)
|
||||
#define TCPIP_APIMSG(m) tcpip_apimsg_lock(m)
|
||||
#ifdef LWIP_DEBUG
|
||||
#define TCIP_APIMSG_SET_ERR(m, e) (m)->msg.err = e /* catch functions that don't set err */
|
||||
#else
|
||||
#define TCIP_APIMSG_SET_ERR(m, e)
|
||||
#endif
|
||||
#define TCPIP_APIMSG(m,f,e) do { \
|
||||
TCIP_APIMSG_SET_ERR(m, ERR_VAL); \
|
||||
LOCK_TCPIP_CORE(); \
|
||||
f(&((m)->msg)); \
|
||||
UNLOCK_TCPIP_CORE(); \
|
||||
(e) = (m)->msg.err; \
|
||||
} while(0)
|
||||
#define TCPIP_APIMSG_ACK(m)
|
||||
#define TCPIP_NETIFAPI(m) tcpip_netifapi_lock(m)
|
||||
#define TCPIP_NETIFAPI_ACK(m)
|
||||
#else /* LWIP_TCPIP_CORE_LOCKING */
|
||||
#define LOCK_TCPIP_CORE()
|
||||
#define UNLOCK_TCPIP_CORE()
|
||||
#define TCPIP_APIMSG(m) tcpip_apimsg(m)
|
||||
#define TCPIP_APIMSG(m,f,e) do { (m)->function = f; (e) = tcpip_apimsg(m); } while(0)
|
||||
#define TCPIP_APIMSG_ACK(m) sys_sem_signal(&m->conn->op_completed)
|
||||
#define TCPIP_NETIFAPI(m) tcpip_netifapi(m)
|
||||
#define TCPIP_NETIFAPI_ACK(m) sys_sem_signal(&m->sem)
|
||||
@@ -84,9 +95,6 @@ void tcpip_init(tcpip_init_done_fn tcpip_init_done, void *arg);
|
||||
|
||||
#if LWIP_NETCONN
|
||||
err_t tcpip_apimsg(struct api_msg *apimsg);
|
||||
#if LWIP_TCPIP_CORE_LOCKING
|
||||
err_t tcpip_apimsg_lock(struct api_msg *apimsg);
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING */
|
||||
#endif /* LWIP_NETCONN */
|
||||
|
||||
err_t tcpip_input(struct pbuf *p, struct netif *inp);
|
||||
|
||||
Reference in New Issue
Block a user