Skip to content

Commit 0d5ac6e

Browse files
author
Mika Leppänen
committed
Relocated lwip memory pool on memory restricted platforms
1 parent 942aec5 commit 0d5ac6e

File tree

1 file changed

+51
-0
lines changed
  • features/FEATURE_LWIP/lwip-interface/lwip-sys/arch

1 file changed

+51
-0
lines changed

features/FEATURE_LWIP/lwip-interface/lwip-sys/arch/cc.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,55 @@ void trace_to_ascii_hex_dump(char* prefix, int len, char *data);
128128
#define LWIP_PLATFORM_HTONS(x) __REV16(x)
129129
#define LWIP_PLATFORM_HTONL(x) __REV(x)
130130

131+
/* Define the memory area for the lwip's memory pools */
132+
#ifndef MEMP_SECTION
133+
#if defined(TARGET_LPC4088) || defined(TARGET_LPC4088_DM)
134+
# if defined (__ICCARM__)
135+
# define MEMP_SECTION
136+
# elif defined(TOOLCHAIN_GCC_CR)
137+
# define MEMP_SECTION __attribute__((section(".data.$RamPeriph32")))
138+
# else
139+
# define MEMP_SECTION __attribute__((section("AHBSRAM0"),aligned))
140+
# endif
141+
#elif defined(TARGET_LPC1768)
142+
# if defined (__ICCARM__)
143+
# define MEMP_SECTION
144+
# elif defined(TOOLCHAIN_GCC_CR)
145+
# define MEMP_SECTION __attribute__((section(".data.$RamPeriph32")))
146+
# else
147+
# define MEMP_SECTION __attribute__((section("AHBSRAM1"),aligned))
148+
# endif
149+
#endif
150+
#endif
151+
152+
#ifdef MEMP_SECTION
153+
#define SET_MEMP_SECTION(name) extern uint8_t MEMP_SECTION name[]
154+
155+
#if defined (__ICCARM__)
156+
#pragma default_variable_attributes = @ ".ethusbram"
157+
#endif
158+
SET_MEMP_SECTION(memp_memory_REASSDATA_base);
159+
SET_MEMP_SECTION(memp_memory_TCP_PCB_LISTEN_base);
160+
SET_MEMP_SECTION(memp_memory_PBUF_POOL_base);
161+
SET_MEMP_SECTION(memp_memory_NETCONN_base);
162+
SET_MEMP_SECTION(memp_memory_IGMP_GROUP_base);
163+
SET_MEMP_SECTION(memp_memory_UDP_PCB_base);
164+
SET_MEMP_SECTION(memp_memory_TCP_PCB_base);
165+
SET_MEMP_SECTION(memp_memory_FRAG_PBUF_base);
166+
SET_MEMP_SECTION(memp_memory_PBUF_base);
167+
SET_MEMP_SECTION(memp_memory_MLD6_GROUP_base);
168+
SET_MEMP_SECTION(memp_memory_IP6_REASSDATA_base);
169+
SET_MEMP_SECTION(memp_memory_NETBUF_base);
170+
SET_MEMP_SECTION(memp_memory_TCPIP_MSG_INPKT_base);
171+
SET_MEMP_SECTION(memp_memory_SYS_TIMEOUT_base);
172+
SET_MEMP_SECTION(memp_memory_TCP_SEG_base);
173+
SET_MEMP_SECTION(memp_memory_TCPIP_MSG_API_base);
174+
SET_MEMP_SECTION(memp_memory_PPP_PCB_base);
175+
SET_MEMP_SECTION(memp_memory_PPPOS_PCB_base);
176+
SET_MEMP_SECTION(memp_memory_PPP_PCB_base);
177+
#if defined (__ICCARM__)
178+
#pragma default_variable_attributes =
179+
#endif
180+
#endif
181+
131182
#endif /* __CC_H__ */

0 commit comments

Comments
 (0)