Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/include/lwip/memp_std.h need to be fixed.

0001 /*
0002  * SETUP: Make sure we define everything we will need.
0003  *
0004  * We have create three types of pools:
0005  *   1) MEMPOOL - standard pools
0006  *   2) MALLOC_MEMPOOL - to be used by mem_malloc in mem.c
0007  *   3) PBUF_MEMPOOL - a mempool of pbuf's, so include space for the pbuf struct
0008  *
0009  * If the include'r doesn't require any special treatment of each of the types
0010  * above, then will declare #2 & #3 to be just standard mempools.
0011  */
0012 #ifndef LWIP_MALLOC_MEMPOOL
0013 /* This treats "malloc pools" just like any other pool.
0014    The pools are a little bigger to provide 'size' as the amount of user data. */
0015 #define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + sizeof(struct memp_malloc_helper)), "MALLOC_"#size)
0016 #define LWIP_MALLOC_MEMPOOL_START
0017 #define LWIP_MALLOC_MEMPOOL_END
0018 #endif /* LWIP_MALLOC_MEMPOOL */ 
0019 
0020 #ifndef LWIP_PBUF_MEMPOOL
0021 /* This treats "pbuf pools" just like any other pool.
0022  * Allocates buffers for a pbuf struct AND a payload size */
0023 #define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num, (MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc)
0024 #endif /* LWIP_PBUF_MEMPOOL */
0025 
0026 
0027 /*
0028  * A list of internal pools used by LWIP.
0029  *
0030  * LWIP_MEMPOOL(pool_name, number_elements, element_size, pool_description)
0031  *     creates a pool name MEMP_pool_name. description is used in stats.c
0032  */
0033 #if LWIP_RAW
0034 LWIP_MEMPOOL(RAW_PCB,        MEMP_NUM_RAW_PCB,         sizeof(struct raw_pcb),        "RAW_PCB")
0035 #endif /* LWIP_RAW */
0036 
0037 #if LWIP_UDP
0038 LWIP_MEMPOOL(UDP_PCB,        MEMP_NUM_UDP_PCB,         sizeof(struct udp_pcb),        "UDP_PCB")
0039 #endif /* LWIP_UDP */
0040 
0041 #if LWIP_TCP
0042 LWIP_MEMPOOL(TCP_PCB,        MEMP_NUM_TCP_PCB,         sizeof(struct tcp_pcb),        "TCP_PCB")
0043 LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN,  sizeof(struct tcp_pcb_listen), "TCP_PCB_LISTEN")
0044 LWIP_MEMPOOL(TCP_SEG,        MEMP_NUM_TCP_SEG,         sizeof(struct tcp_seg),        "TCP_SEG")
0045 #endif /* LWIP_TCP */
0046 
0047 #if IP_REASSEMBLY
0048 LWIP_MEMPOOL(REASSDATA,      MEMP_NUM_REASSDATA,       sizeof(struct ip_reassdata),   "REASSDATA")
0049 #endif /* IP_REASSEMBLY */
0050 
0051 #if LWIP_NETCONN
0052 LWIP_MEMPOOL(NETBUF,         MEMP_NUM_NETBUF,          sizeof(struct netbuf),         "NETBUF")
0053 LWIP_MEMPOOL(NETCONN,        MEMP_NUM_NETCONN,         sizeof(struct netconn),        "NETCONN")
0054 #endif /* LWIP_NETCONN */
0055 
0056 #if NO_SYS==0
0057 LWIP_MEMPOOL(TCPIP_MSG_API,  MEMP_NUM_TCPIP_MSG_API,   sizeof(struct tcpip_msg),      "TCPIP_MSG_API")
0058 LWIP_MEMPOOL(TCPIP_MSG_INPKT,MEMP_NUM_TCPIP_MSG_INPKT, sizeof(struct tcpip_msg),      "TCPIP_MSG_INPKT")
0059 #endif /* NO_SYS==0 */
0060 
0061 #if ARP_QUEUEING
0062 LWIP_MEMPOOL(ARP_QUEUE,      MEMP_NUM_ARP_QUEUE,       sizeof(struct etharp_q_entry), "ARP_QUEUE")
0063 #endif /* ARP_QUEUEING */
0064 
0065 #if LWIP_IGMP
0066 LWIP_MEMPOOL(IGMP_GROUP,     MEMP_NUM_IGMP_GROUP,      sizeof(struct igmp_group),     "IGMP_GROUP")
0067 #endif /* LWIP_IGMP */
0068 
0069 #if NO_SYS==0
0070 LWIP_MEMPOOL(SYS_TIMEOUT,    MEMP_NUM_SYS_TIMEOUT,     sizeof(struct sys_timeo),      "SYS_TIMEOUT")
0071 #endif /* NO_SYS==0 */
0072 
0073 
0074 /*
0075  * A list of pools of pbuf's used by LWIP.
0076  *
0077  * LWIP_PBUF_MEMPOOL(pool_name, number_elements, pbuf_payload_size, pool_description)
0078  *     creates a pool name MEMP_pool_name. description is used in stats.c
0079  *     This allocates enough space for the pbuf struct and a payload.
0080  *     (Example: pbuf_payload_size=0 allocates only size for the struct)
0081  */
0082 LWIP_PBUF_MEMPOOL(PBUF,      MEMP_NUM_PBUF,            0,                             "PBUF_REF/ROM")
0083 LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE,           PBUF_POOL_BUFSIZE,             "PBUF_POOL")
0084 
0085 
0086 /*
0087  * Allow for user-defined pools; this must be explicitly set in lwipopts.h
0088  * since the default is to NOT look for lwippools.h
0089  */
0090 #if MEMP_USE_CUSTOM_POOLS
0091 #include "lwippools.h"
0092 #endif /* MEMP_USE_CUSTOM_POOLS */
0093 
0094 /*
0095  * REQUIRED CLEANUP: Clear up so we don't get "multiply defined" error later
0096  * (#undef is ignored for something that is not defined)
0097  */
0098 #undef LWIP_MEMPOOL
0099 #undef LWIP_MALLOC_MEMPOOL
0100 #undef LWIP_MALLOC_MEMPOOL_START
0101 #undef LWIP_MALLOC_MEMPOOL_END
0102 #undef LWIP_PBUF_MEMPOOL