Ver código fonte

lwip: add linker fragment

Add linker fragment file for lwip component.
morris 7 anos atrás
pai
commit
302ca0022f

+ 2 - 0
components/lwip/CMakeLists.txt

@@ -124,6 +124,8 @@ endif()
 set(COMPONENT_REQUIRES vfs)
 set(COMPONENT_PRIV_REQUIRES ethernet tcpip_adapter nvs_flash)
 
+set(COMPONENT_ADD_LDFRAGMENTS linker.lf)
+
 register_component()
 
 # lots of LWIP source files evaluate macros that check address of stack variables

+ 2 - 0
components/lwip/component.mk

@@ -34,3 +34,5 @@ ifeq ($(GCC_NOT_5_2_0), 1)
 lwip/src/netif/ppp/ppp.o: CFLAGS += -Wno-uninitialized
 lwip/src/netif/ppp/pppos.o: CFLAGS += -Wno-implicit-fallthrough
 endif
+
+COMPONENT_ADD_LDFRAGMENTS += linker.lf

+ 57 - 0
components/lwip/linker.lf

@@ -0,0 +1,57 @@
+[mapping]
+archive: liblwip.a
+entries:
+    :LWIP_IRAM_OPTIMIZATION = y
+    ethernetif:ethernet_low_level_output (noflash_text)
+    ethernetif:ethernetif_input (noflash_text)
+    wlanif:low_level_output (noflash_text)
+    wlanif:wlanif_input (noflash_text)
+    sys_arch:sys_mutex_lock (noflash_text)
+    sys_arch:sys_mutex_unlock (noflash_text)
+    sys_arch:sys_sem_signal (noflash_text)
+    sys_arch:sys_arch_sem_wait (noflash_text)
+    sys_arch:sys_mbox_post (noflash_text)
+    sys_arch:sys_mbox_trypost (noflash_text)
+    sys_arch:sys_arch_mbox_fetch (noflash_text)
+    sockets:get_socket (noflash_text)
+    sockets:lwip_recvfrom (noflash_text)
+    sockets:lwip_sendto (noflash_text)
+    sockets:event_callback (noflash_text)
+    sockets:lwip_sendto_r (noflash_text)
+    sockets:lwip_recvfrom_r (noflash_text)
+    sockets:lwip_recv_r (noflash_text)
+    api_lib:netconn_apimsg (noflash_text)
+    api_lib:netconn_recv_data (noflash_text)
+    api_lib:netconn_recv_tcp_pbuf (noflash_text)
+    api_lib:netconn_recv (noflash_text)
+    api_lib:netconn_send (noflash_text)
+    api_lib:netconn_write_partly (noflash_text)
+    tcpip:tcpip_thread (noflash_text)
+    tcpip:tcpip_inpkt (noflash_text)
+    tcpip:tcpip_input (noflash_text)
+    tcpip:tcpip_send_msg_wait_sem (noflash_text)
+    netbuf:netbuf_alloc (noflash_text)
+    netbuf:netbuf_free (noflash_text)
+    timeouts:sys_timeouts_mbox_fetch (noflash_text)
+    inet_chksum:inet_cksum_pseudo_base (noflash_text)
+    inet_chksum:inet_chksum_pseudo (noflash_text)
+    inet_chksum:ip_chksum_pseudo (noflash_text)
+    etharp:etharp_output_to_arp_index (noflash_text)
+    etharp:etharp_output (noflash_text)
+    ip4_addr:ip4_addr_isbroadcast_u32 (noflash_text)
+    ip4:ip4_route_src (noflash_text)
+    ip4:ip4_route_src_hook (noflash_text)
+    ip4:ip4_route (noflash_text)
+    ip4:ip4_input (noflash_text)
+    ip4:ip4_output_if_src (noflash_text)
+    ip4:ip4_output_if_opt_src (noflash_text)
+    udp:udp_input_local_match (noflash_text)
+    udp:udp_input (noflash_text)
+    udp:udp_send (noflash_text)
+    udp:udp_sendto (noflash_text)
+    udp:udp_sendto_if (noflash_text)
+    udp:udp_sendto_if_src (noflash_text)
+    pbuf:pbuf_alloc (noflash_text)
+    pbuf:pbuf_header_impl (noflash_text)
+    pbuf:pbuf_header (noflash_text)
+    ethernet:ethernet_input (noflash_text)

+ 3 - 4
components/lwip/port/esp32/include/lwipopts.h

@@ -761,11 +761,10 @@
 #define ESP_AUTO_RECV                   1
 #define ESP_GRATUITOUS_ARP              CONFIG_ESP_GRATUITOUS_ARP
 
-#if CONFIG_LWIP_IRAM_OPTIMIZATION
-#define ESP_IRAM_ATTR                   IRAM_ATTR
-#else
-#define ESP_IRAM_ATTR
+#ifdef ESP_IRAM_ATTR
+#undef ESP_IRAM_ATTR
 #endif
+#define ESP_IRAM_ATTR
 
 #if ESP_PERF
 #define DBG_PERF_PATH_SET(dir, point)