Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
memp_std.h
00001 /** 00002 * @file 00003 * lwIP internal memory pools (do not use in application code) 00004 * This file is deliberately included multiple times: once with empty 00005 * definition of LWIP_MEMPOOL() to handle all includes and multiple times 00006 * to build up various lists of mem pools. 00007 */ 00008 00009 /* 00010 * SETUP: Make sure we define everything we will need. 00011 * 00012 * We have create three types of pools: 00013 * 1) MEMPOOL - standard pools 00014 * 2) MALLOC_MEMPOOL - to be used by mem_malloc in mem.c 00015 * 3) PBUF_MEMPOOL - a mempool of pbuf's, so include space for the pbuf struct 00016 * 00017 * If the include'r doesn't require any special treatment of each of the types 00018 * above, then will declare #2 & #3 to be just standard mempools. 00019 */ 00020 #ifndef LWIP_MALLOC_MEMPOOL 00021 /* This treats "malloc pools" just like any other pool. 00022 The pools are a little bigger to provide 'size' as the amount of user data. */ 00023 #define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + LWIP_MEM_ALIGN_SIZE(sizeof(struct memp_malloc_helper))), "MALLOC_"#size) 00024 #define LWIP_MALLOC_MEMPOOL_START 00025 #define LWIP_MALLOC_MEMPOOL_END 00026 #endif /* LWIP_MALLOC_MEMPOOL */ 00027 00028 #ifndef LWIP_PBUF_MEMPOOL 00029 /* This treats "pbuf pools" just like any other pool. 00030 * Allocates buffers for a pbuf struct AND a payload size */ 00031 #define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num, (LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf)) + LWIP_MEM_ALIGN_SIZE(payload)), desc) 00032 #endif /* LWIP_PBUF_MEMPOOL */ 00033 00034 00035 /* 00036 * A list of internal pools used by LWIP. 00037 * 00038 * LWIP_MEMPOOL(pool_name, number_elements, element_size, pool_description) 00039 * creates a pool name MEMP_pool_name. description is used in stats.c 00040 */ 00041 #if LWIP_RAW 00042 LWIP_MEMPOOL(RAW_PCB, MEMP_NUM_RAW_PCB, sizeof(struct raw_pcb), "RAW_PCB") 00043 #endif /* LWIP_RAW */ 00044 00045 #if LWIP_UDP 00046 LWIP_MEMPOOL(UDP_PCB, MEMP_NUM_UDP_PCB, sizeof(struct udp_pcb), "UDP_PCB") 00047 #endif /* LWIP_UDP */ 00048 00049 #if LWIP_TCP 00050 LWIP_MEMPOOL(TCP_PCB, MEMP_NUM_TCP_PCB, sizeof(struct tcp_pcb), "TCP_PCB") 00051 LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN, sizeof(struct tcp_pcb_listen), "TCP_PCB_LISTEN") 00052 LWIP_MEMPOOL(TCP_SEG, MEMP_NUM_TCP_SEG, sizeof(struct tcp_seg), "TCP_SEG") 00053 #endif /* LWIP_TCP */ 00054 00055 #if LWIP_ALTCP && LWIP_TCP 00056 LWIP_MEMPOOL(ALTCP_PCB, MEMP_NUM_ALTCP_PCB, sizeof(struct altcp_pcb), "ALTCP_PCB") 00057 #endif /* LWIP_ALTCP && LWIP_TCP */ 00058 00059 #if LWIP_IPV4 && IP_REASSEMBLY 00060 LWIP_MEMPOOL(REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip_reassdata), "REASSDATA") 00061 #endif /* LWIP_IPV4 && IP_REASSEMBLY */ 00062 #if (IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG) 00063 LWIP_MEMPOOL(FRAG_PBUF, MEMP_NUM_FRAG_PBUF, sizeof(struct pbuf_custom_ref),"FRAG_PBUF") 00064 #endif /* IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF || (LWIP_IPV6 && LWIP_IPV6_FRAG) */ 00065 00066 #if LWIP_NETCONN || LWIP_SOCKET 00067 LWIP_MEMPOOL(NETBUF, MEMP_NUM_NETBUF, sizeof(struct netbuf), "NETBUF") 00068 LWIP_MEMPOOL(NETCONN, MEMP_NUM_NETCONN, sizeof(struct netconn), "NETCONN") 00069 #endif /* LWIP_NETCONN || LWIP_SOCKET */ 00070 00071 #if NO_SYS==0 00072 LWIP_MEMPOOL(TCPIP_MSG_API, MEMP_NUM_TCPIP_MSG_API, sizeof(struct tcpip_msg), "TCPIP_MSG_API") 00073 #if LWIP_MPU_COMPATIBLE 00074 LWIP_MEMPOOL(API_MSG, MEMP_NUM_API_MSG, sizeof(struct api_msg), "API_MSG") 00075 #if LWIP_DNS 00076 LWIP_MEMPOOL(DNS_API_MSG, MEMP_NUM_DNS_API_MSG, sizeof(struct dns_api_msg), "DNS_API_MSG") 00077 #endif 00078 #if LWIP_SOCKET && !LWIP_TCPIP_CORE_LOCKING 00079 LWIP_MEMPOOL(SOCKET_SETGETSOCKOPT_DATA, MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA, sizeof(struct lwip_setgetsockopt_data), "SOCKET_SETGETSOCKOPT_DATA") 00080 #endif 00081 #if LWIP_SOCKET && (LWIP_SOCKET_SELECT || LWIP_SOCKET_POLL) 00082 LWIP_MEMPOOL(SELECT_CB, MEMP_NUM_SELECT_CB, sizeof(struct lwip_select_cb), "SELECT_CB") 00083 #endif /* LWIP_SOCKET && (LWIP_SOCKET_SELECT || LWIP_SOCKET_POLL) */ 00084 #if LWIP_NETIF_API 00085 LWIP_MEMPOOL(NETIFAPI_MSG, MEMP_NUM_NETIFAPI_MSG, sizeof(struct netifapi_msg), "NETIFAPI_MSG") 00086 #endif 00087 #endif /* LWIP_MPU_COMPATIBLE */ 00088 #if !LWIP_TCPIP_CORE_LOCKING_INPUT 00089 LWIP_MEMPOOL(TCPIP_MSG_INPKT,MEMP_NUM_TCPIP_MSG_INPKT, sizeof(struct tcpip_msg), "TCPIP_MSG_INPKT") 00090 #endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */ 00091 #endif /* NO_SYS==0 */ 00092 00093 #if LWIP_IPV4 && LWIP_ARP && ARP_QUEUEING 00094 LWIP_MEMPOOL(ARP_QUEUE, MEMP_NUM_ARP_QUEUE, sizeof(struct etharp_q_entry), "ARP_QUEUE") 00095 #endif /* LWIP_IPV4 && LWIP_ARP && ARP_QUEUEING */ 00096 00097 #if LWIP_IGMP 00098 LWIP_MEMPOOL(IGMP_GROUP, MEMP_NUM_IGMP_GROUP, sizeof(struct igmp_group), "IGMP_GROUP") 00099 #endif /* LWIP_IGMP */ 00100 00101 #if LWIP_TIMERS && !LWIP_TIMERS_CUSTOM 00102 LWIP_MEMPOOL(SYS_TIMEOUT, MEMP_NUM_SYS_TIMEOUT, sizeof(struct sys_timeo), "SYS_TIMEOUT") 00103 #endif /* LWIP_TIMERS && !LWIP_TIMERS_CUSTOM */ 00104 00105 #if LWIP_DNS && LWIP_SOCKET 00106 LWIP_MEMPOOL(NETDB, MEMP_NUM_NETDB, NETDB_ELEM_SIZE, "NETDB") 00107 #endif /* LWIP_DNS && LWIP_SOCKET */ 00108 #if LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC 00109 LWIP_MEMPOOL(LOCALHOSTLIST, MEMP_NUM_LOCALHOSTLIST, LOCALHOSTLIST_ELEM_SIZE, "LOCALHOSTLIST") 00110 #endif /* LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ 00111 00112 #if LWIP_IPV6 && LWIP_ND6_QUEUEING 00113 LWIP_MEMPOOL(ND6_QUEUE, MEMP_NUM_ND6_QUEUE, sizeof(struct nd6_q_entry), "ND6_QUEUE") 00114 #endif /* LWIP_IPV6 && LWIP_ND6_QUEUEING */ 00115 00116 #if LWIP_IPV6 && LWIP_IPV6_REASS 00117 LWIP_MEMPOOL(IP6_REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip6_reassdata), "IP6_REASSDATA") 00118 #endif /* LWIP_IPV6 && LWIP_IPV6_REASS */ 00119 00120 #if LWIP_IPV6 && LWIP_IPV6_MLD 00121 LWIP_MEMPOOL(MLD6_GROUP, MEMP_NUM_MLD6_GROUP, sizeof(struct mld_group), "MLD6_GROUP") 00122 #endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ 00123 00124 00125 /* 00126 * A list of pools of pbuf's used by LWIP. 00127 * 00128 * LWIP_PBUF_MEMPOOL(pool_name, number_elements, pbuf_payload_size, pool_description) 00129 * creates a pool name MEMP_pool_name. description is used in stats.c 00130 * This allocates enough space for the pbuf struct and a payload. 00131 * (Example: pbuf_payload_size=0 allocates only size for the struct) 00132 */ 00133 LWIP_MEMPOOL(PBUF, MEMP_NUM_PBUF, sizeof(struct pbuf), "PBUF_REF/ROM") 00134 LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE, PBUF_POOL_BUFSIZE, "PBUF_POOL") 00135 00136 00137 /* 00138 * Allow for user-defined pools; this must be explicitly set in lwipopts.h 00139 * since the default is to NOT look for lwippools.h 00140 */ 00141 #if MEMP_USE_CUSTOM_POOLS 00142 #include "lwippools.h" 00143 #endif /* MEMP_USE_CUSTOM_POOLS */ 00144 00145 /* 00146 * REQUIRED CLEANUP: Clear up so we don't get "multiply defined" error later 00147 * (#undef is ignored for something that is not defined) 00148 */ 00149 #undef LWIP_MEMPOOL 00150 #undef LWIP_MALLOC_MEMPOOL 00151 #undef LWIP_MALLOC_MEMPOOL_START 00152 #undef LWIP_MALLOC_MEMPOOL_END 00153 #undef LWIP_PBUF_MEMPOOL
Generated on Tue Jul 12 2022 13:54:35 by
