source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/hardware/arduino/avr/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/include/lwip/memp_std.h @ 46

Last change on this file since 46 was 46, checked in by jrpelegrina, 4 years ago

First release to Xenial

File size: 4.0 KB
Line 
1/* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */
2
3/*
4 * SETUP: Make sure we define everything we will need.
5 *
6 * We have create three types of pools:
7 *   1) MEMPOOL - standard pools
8 *   2) MALLOC_MEMPOOL - to be used by mem_malloc in mem.c
9 *   3) PBUF_MEMPOOL - a mempool of pbuf's, so include space for the pbuf struct
10 *
11 * If the include'r doesn't require any special treatment of each of the types
12 * above, then will declare #2 & #3 to be just standard mempools.
13 */
14#ifndef LWIP_MALLOC_MEMPOOL
15/* This treats "malloc pools" just like any other pool.
16   The pools are a little bigger to provide 'size' as the amount of user data. */
17#define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + sizeof(struct memp_malloc_helper)), "MALLOC_"#size)
18#define LWIP_MALLOC_MEMPOOL_START
19#define LWIP_MALLOC_MEMPOOL_END
20#endif /* LWIP_MALLOC_MEMPOOL */ 
21
22#ifndef LWIP_PBUF_MEMPOOL
23/* This treats "pbuf pools" just like any other pool.
24 * Allocates buffers for a pbuf struct AND a payload size */
25#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num, (MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc)
26#endif /* LWIP_PBUF_MEMPOOL */
27
28
29/*
30 * A list of internal pools used by LWIP.
31 *
32 * LWIP_MEMPOOL(pool_name, number_elements, element_size, pool_description)
33 *     creates a pool name MEMP_pool_name. description is used in stats.c
34 */
35#if LWIP_RAW
36LWIP_MEMPOOL(RAW_PCB,        MEMP_NUM_RAW_PCB,         sizeof(struct raw_pcb),        "RAW_PCB")
37#endif /* LWIP_RAW */
38
39#if LWIP_UDP
40LWIP_MEMPOOL(UDP_PCB,        MEMP_NUM_UDP_PCB,         sizeof(struct udp_pcb),        "UDP_PCB")
41#endif /* LWIP_UDP */
42
43#if LWIP_TCP
44LWIP_MEMPOOL(TCP_PCB,        MEMP_NUM_TCP_PCB,         sizeof(struct tcp_pcb),        "TCP_PCB")
45LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN,  sizeof(struct tcp_pcb_listen), "TCP_PCB_LISTEN")
46LWIP_MEMPOOL(TCP_SEG,        MEMP_NUM_TCP_SEG,         sizeof(struct tcp_seg),        "TCP_SEG")
47#endif /* LWIP_TCP */
48
49#if IP_REASSEMBLY
50LWIP_MEMPOOL(REASSDATA,      MEMP_NUM_REASSDATA,       sizeof(struct ip_reassdata),   "REASSDATA")
51#endif /* IP_REASSEMBLY */
52
53#if LWIP_NETCONN
54LWIP_MEMPOOL(NETBUF,         MEMP_NUM_NETBUF,          sizeof(struct netbuf),         "NETBUF")
55LWIP_MEMPOOL(NETCONN,        MEMP_NUM_NETCONN,         sizeof(struct netconn),        "NETCONN")
56#endif /* LWIP_NETCONN */
57
58#if NO_SYS==0
59LWIP_MEMPOOL(TCPIP_MSG_API,  MEMP_NUM_TCPIP_MSG_API,   sizeof(struct tcpip_msg),      "TCPIP_MSG_API")
60LWIP_MEMPOOL(TCPIP_MSG_INPKT,MEMP_NUM_TCPIP_MSG_INPKT, sizeof(struct tcpip_msg),      "TCPIP_MSG_INPKT")
61#endif /* NO_SYS==0 */
62
63#if ARP_QUEUEING
64LWIP_MEMPOOL(ARP_QUEUE,      MEMP_NUM_ARP_QUEUE,       sizeof(struct etharp_q_entry), "ARP_QUEUE")
65#endif /* ARP_QUEUEING */
66
67#if LWIP_IGMP
68LWIP_MEMPOOL(IGMP_GROUP,     MEMP_NUM_IGMP_GROUP,      sizeof(struct igmp_group),     "IGMP_GROUP")
69#endif /* LWIP_IGMP */
70
71#if NO_SYS==0
72LWIP_MEMPOOL(SYS_TIMEOUT,    MEMP_NUM_SYS_TIMEOUT,     sizeof(struct sys_timeo),      "SYS_TIMEOUT")
73#endif /* NO_SYS==0 */
74
75
76/*
77 * A list of pools of pbuf's used by LWIP.
78 *
79 * LWIP_PBUF_MEMPOOL(pool_name, number_elements, pbuf_payload_size, pool_description)
80 *     creates a pool name MEMP_pool_name. description is used in stats.c
81 *     This allocates enough space for the pbuf struct and a payload.
82 *     (Example: pbuf_payload_size=0 allocates only size for the struct)
83 */
84LWIP_PBUF_MEMPOOL(PBUF,      MEMP_NUM_PBUF,            0,                             "PBUF_REF/ROM")
85LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE,           PBUF_POOL_BUFSIZE,             "PBUF_POOL")
86
87
88/*
89 * Allow for user-defined pools; this must be explicitly set in lwipopts.h
90 * since the default is to NOT look for lwippools.h
91 */
92#if MEMP_USE_CUSTOM_POOLS
93#include "lwippools.h"
94#endif /* MEMP_USE_CUSTOM_POOLS */
95
96/*
97 * REQUIRED CLEANUP: Clear up so we don't get "multiply defined" error later
98 * (#undef is ignored for something that is not defined)
99 */
100#undef LWIP_MEMPOOL
101#undef LWIP_MALLOC_MEMPOOL
102#undef LWIP_MALLOC_MEMPOOL_START
103#undef LWIP_MALLOC_MEMPOOL_END
104#undef LWIP_PBUF_MEMPOOL
Note: See TracBrowser for help on using the repository browser.