Skip to content

Commit 4cac267

Browse files
committed
[lwip] implement RT_USING_ASM_MEMCPY
1 parent 3cb13b4 commit 4cac267

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

components/net/lwip-1.4.1/src/lwipopts.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@
222222
#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT)
223223

224224
/* ---------- Memory options ---------- */
225+
#ifdef RT_USING_ASM_MEMCPY
226+
#define MEMCPY(dst,src,len) rt_memcpy(dst,src,len)
227+
#else
228+
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
229+
#endif /* RT_USING_ASM_MEMCPY */
230+
#define SMEMCPY(dst,src,len) MEMCPY(dst,src,len)
231+
225232
#define MEM_ALIGNMENT 4
226233

227234
#define MEM_LIBC_MALLOC 1

components/net/lwip-2.0.2/src/lwipopts.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,21 @@
230230
#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT)
231231

232232
/* ---------- Memory options ---------- */
233+
#ifdef RT_USING_ASM_MEMCPY
234+
#define MEMCPY(dst,src,len) rt_memcpy(dst,src,len)
235+
#else
236+
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
237+
#endif /* RT_USING_ASM_MEMCPY */
238+
#define SMEMCPY(dst,src,len) MEMCPY(dst,src,len)
239+
233240
#ifdef RT_LWIP_MEM_ALIGNMENT
234241
#define MEM_ALIGNMENT RT_LWIP_MEM_ALIGNMENT
235242
#else
236243
#define MEM_ALIGNMENT 4
237244
#endif
238245

239-
#define MEMP_OVERFLOW_CHECK 1 ////
240-
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1 ////
246+
#define MEMP_OVERFLOW_CHECK 1
247+
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1
241248
//#define MEM_LIBC_MALLOC 1
242249
//#define MEM_USE_POOLS 1
243250
//#define MEMP_USE_CUSTOM_POOLS 1

components/net/lwip-2.0.3/src/lwipopts.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,21 @@
230230
#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT)
231231

232232
/* ---------- Memory options ---------- */
233+
#ifdef RT_USING_ASM_MEMCPY
234+
#define MEMCPY(dst,src,len) rt_memcpy(dst,src,len)
235+
#else
236+
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
237+
#endif /* RT_USING_ASM_MEMCPY */
238+
#define SMEMCPY(dst,src,len) MEMCPY(dst,src,len)
239+
233240
#ifdef RT_LWIP_MEM_ALIGNMENT
234241
#define MEM_ALIGNMENT RT_LWIP_MEM_ALIGNMENT
235242
#else
236243
#define MEM_ALIGNMENT 4
237244
#endif
238245

239-
#define MEMP_OVERFLOW_CHECK 1 ////
240-
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1 ////
246+
#define MEMP_OVERFLOW_CHECK 1
247+
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1
241248
//#define MEM_LIBC_MALLOC 1
242249
//#define MEM_USE_POOLS 1
243250
//#define MEMP_USE_CUSTOM_POOLS 1

components/net/lwip-2.1.2/src/lwipopts.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,16 @@
242242
#endif
243243

244244
/* ---------- Memory options ---------- */
245+
#ifdef RT_USING_ASM_MEMCPY
246+
#define MEMCPY(dst,src,len) rt_memcpy(dst,src,len)
247+
#else
248+
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
249+
#endif /* RT_USING_ASM_MEMCPY */
250+
#define SMEMCPY(dst,src,len) MEMCPY(dst,src,len)
251+
245252
#define MEM_ALIGNMENT 4
246-
#define MEMP_OVERFLOW_CHECK 1 ////
247-
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1 ////
253+
#define MEMP_OVERFLOW_CHECK 1
254+
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1
248255
//#define MEM_LIBC_MALLOC 1
249256
//#define MEM_USE_POOLS 1
250257
//#define MEMP_USE_CUSTOM_POOLS 1

0 commit comments

Comments
 (0)