Skip to content

Commit 129754a

Browse files
fjtrujyclaude
andcommitted
cleanup: [tcpip] prune ee lwipopts.h entries that restate lwIP 2.0.3 defaults
Symmetric with the earlier iop lwipopts.h prune. Remove seven defines from ee/network/tcpip/src/include/lwipopts.h that either match lwIP 2.0.3's defaults in opt.h or configure dead subsystems, and drop the no-op #ifndef guard: - NO_SYS=0 (default 0) - SYS_LIGHTWEIGHT_PROT=1 (default 1) - SLIPIF_THREAD_STACKSIZE/PRIO (slipif.c not compiled) - PPP_THREAD_STACKSIZE/PRIO (symbols not referenced anywhere in lwIP 2.0.3) - #ifndef LWIP_TCPIP_CORE_LOCKING_INPUT guard around MEMP_NUM_TCPIP_MSG_INPKT (LWIP_TCPIP_CORE_LOCKING_INPUT is defined later in the same file, so the guard never activates) Keep MEM_LIBC_MALLOC=1 (EE deliberately overrides the default 0 to reuse newlib's malloc) and MEMP_NUM_TCPIP_MSG_API=50 (differs from default 8). Proof of no-op: 31/35 object files are byte-identical; the 4 that differ (ps2ip.o, sys_arch.o, ps2ip_ps2sdk.o, erl-support.o) only diverge in LTO-specific sections (.gnu.lto_*, .gnu.debuglto_*), while their .text, .data and .rodata are byte-identical. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 58b60ec commit 129754a

1 file changed

Lines changed: 7 additions & 48 deletions

File tree

ee/network/tcpip/src/include/lwipopts.h

Lines changed: 7 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
#ifndef __LWIPOPTS_H__
55
#define __LWIPOPTS_H__
66

7-
/**
8-
* NO_SYS==1: Provides VERY minimal functionality. Otherwise,
9-
* use lwIP facilities.
10-
*/
11-
#define NO_SYS 0
12-
137
#define LWIP_TIMEVAL_PRIVATE 0
148

159
/* ---------- Thread options ---------- */
@@ -41,43 +35,16 @@
4135
*/
4236
#define TCPIP_THREAD_PRIO DEFAULT_THREAD_PRIO
4337

44-
/**
45-
* SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread.
46-
* The stack size value itself is platform-dependent, but is passed to
47-
* sys_thread_new() when the thread is created.
48-
*/
49-
#define SLIPIF_THREAD_STACKSIZE DEFAULT_THREAD_STACKSIZE
50-
51-
/**
52-
* SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread.
53-
* The priority value itself is platform-dependent, but is passed to
54-
* sys_thread_new() when the thread is created.
55-
*/
56-
#define SLIPIF_THREAD_PRIO DEFAULT_THREAD_PRIO
57-
58-
/**
59-
* PPP_THREAD_STACKSIZE: The stack size used by the pppInputThread.
60-
* The stack size value itself is platform-dependent, but is passed to
61-
* sys_thread_new() when the thread is created.
62-
*/
63-
#define PPP_THREAD_STACKSIZE DEFAULT_THREAD_STACKSIZE
64-
65-
/**
66-
* PPP_THREAD_PRIO: The priority assigned to the pppInputThread.
67-
* The priority value itself is platform-dependent, but is passed to
68-
* sys_thread_new() when the thread is created.
69-
*/
70-
#define PPP_THREAD_PRIO DEFAULT_THREAD_PRIO
71-
7238
/*
7339
------------------------------------
7440
---------- Memory options ----------
7541
------------------------------------
7642
*/
7743
/**
78-
* MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library
79-
* instead of the lwip internal allocator. Can save code size if you
80-
* already use it.
44+
* MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by the C-library
45+
* instead of lwIP's internal allocator. Default is 0; enabled on EE
46+
* because newlib's malloc is already linked in and the heap pool is
47+
* cheaper than a duplicate lwIP heap.
8148
*/
8249
#define MEM_LIBC_MALLOC 1
8350

@@ -115,12 +82,11 @@
11582
/**
11683
* MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
11784
* for incoming packets.
118-
* (only needed if you use tcpip.c)
85+
* SP193: this should be around the size of the TCP window because the
86+
* TCPIP thread may take a while to execute (non-preemptive multitasking),
87+
* otherwise incoming frames may get dropped.
11988
*/
120-
//SP193: this should be around the size of the TCP window because the TCPIP thread may take a while to execute (non-preemptive multitasking), otherwise incoming frames may get dropped.
121-
#ifndef LWIP_TCPIP_CORE_LOCKING_INPUT
12289
#define MEMP_NUM_TCPIP_MSG_INPKT 50
123-
#endif
12490

12591
/**
12692
* MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
@@ -146,13 +112,6 @@
146112
*/
147113
#define LWIP_TCPIP_CORE_LOCKING_INPUT 1
148114

149-
/** SYS_LIGHTWEIGHT_PROT
150-
* define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection
151-
* for certain critical regions during buffer allocation, deallocation and
152-
* memory allocation and deallocation.
153-
*/
154-
#define SYS_LIGHTWEIGHT_PROT 1
155-
156115
/*
157116
---------------------------------
158117
---------- TCP options ----------

0 commit comments

Comments
 (0)