Free (GPLv2) TCP/IP stack developed by TASS Belgium
Dependents: lpc1768-picotcp-demo ZeroMQ_PicoTCP_Publisher_demo TCPSocket_HelloWorld_PicoTCP Pico_TCP_UDP_Test ... more
PicoTCP. Copyright (c) 2013 TASS Belgium NV.
Released under the GNU General Public License, version 2.
Different licensing models may exist, at the sole discretion of the Copyright holders.
Official homepage: http://www.picotcp.com
Bug tracker: https://github.com/tass-belgium/picotcp/issues
Development steps:
initial integration with mbed RTOSgeneric mbed Ethernet driverhigh performance NXP LPC1768 specific Ethernet driverMulti-threading support for mbed RTOSBerkeley sockets and integration with the New Socket APIFork of the apps running on top of the New Socket APIScheduling optimizations- Debugging/benchmarking/testing
Demo application (measuring TCP sender performance):
Import programlpc1768-picotcp-demo
A PicoTCP demo app testing the ethernet throughput on the lpc1768 mbed board.
Diff: include/pico_queue.h
- Revision:
- 152:a3d286bf94e5
- Parent:
- 149:5f4cb161cec3
--- a/include/pico_queue.h Wed Apr 09 17:32:25 2014 +0200 +++ b/include/pico_queue.h Mon Sep 28 13:16:18 2015 +0200 @@ -1,11 +1,10 @@ /********************************************************************* - PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved. + PicoTCP. Copyright (c) 2012-2015 Altran Intelligent Systems. Some rights reserved. See LICENSE and COPYING for usage. *********************************************************************/ #ifndef INCLUDE_PICO_QUEUE #define INCLUDE_PICO_QUEUE -#include <stdint.h> #include "pico_config.h" #include "pico_frame.h" @@ -15,6 +14,13 @@ #define NULL ((void *)0) #endif +void *pico_mutex_init(void); +void pico_mutex_deinit(void *mutex); +void pico_mutex_lock(void *mutex); +int pico_mutex_lock_timeout(void *mutex, int timeout); +void pico_mutex_unlock(void *mutex); +void pico_mutex_unlock_ISR(void *mutex); + struct pico_queue { uint32_t frames; uint32_t size; @@ -36,10 +42,12 @@ pico_mutex_lock(x); \ } #define PICOTCP_MUTEX_UNLOCK(x) pico_mutex_unlock(x) +#define PICOTCP_MUTEX_DEL(x) pico_mutex_deinit(x) #else #define PICOTCP_MUTEX_LOCK(x) do {} while(0) #define PICOTCP_MUTEX_UNLOCK(x) do {} while(0) +#define PICOTCP_MUTEX_DEL(x) do {} while(0) #endif #ifdef PICO_SUPPORT_DEBUG_TOOLS @@ -64,9 +72,12 @@ if ((q->max_frames) && (q->max_frames <= q->frames)) return -1; - if ((Q_LIMIT) && (Q_LIMIT < p->buffer_len + q->size)) +#if (Q_LIMIT != 0) + if ((Q_LIMIT < p->buffer_len + q->size)) return -1; +#endif + if ((q->max_size) && (q->max_size < (p->buffer_len + q->size))) return -1; @@ -131,11 +142,18 @@ return p; } +static inline void pico_queue_deinit(struct pico_queue *q) +{ + if (q->shared) { + PICOTCP_MUTEX_DEL(q->mutex); + } +} + static inline void pico_queue_empty(struct pico_queue *q) { struct pico_frame *p = pico_dequeue(q); while(p) { - PICO_FREE(p); + pico_frame_discard(p); p = pico_dequeue(q); } }