From 19a67271efa8325e17ffc41ee757cac796c8ee7f Mon Sep 17 00:00:00 2001 From: TianZhongXing Date: Mon, 17 Sep 2018 20:50:08 +0800 Subject: [PATCH] lwip:move lwip bss segment to psram --- components/esp32/ld/esp32.common.ld | 1 + components/lwip/apps/dhcpserver/dhcpserver.c | 18 ++++-------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/components/esp32/ld/esp32.common.ld b/components/esp32/ld/esp32.common.ld index deffd3a2bc..0a36143275 100644 --- a/components/esp32/ld/esp32.common.ld +++ b/components/esp32/ld/esp32.common.ld @@ -60,6 +60,7 @@ SECTIONS *(.ext_ram.bss) *libnet80211.a:(.dynsbss .sbss .sbss.* .gnu.linkonce.sb.* .scommon .sbss2.* .gnu.linkonce.sb2.* .dynbss .bss .bss.* .share.mem .gnu.linkonce.b.* COMMON) *libpp.a:(.dynsbss .sbss .sbss.* .gnu.linkonce.sb.* .scommon .sbss2.* .gnu.linkonce.sb2.* .dynbss .bss .bss.* .share.mem .gnu.linkonce.b.* COMMON) + *liblwip.a:(.dynsbss .sbss .sbss.* .gnu.linkonce.sb.* .scommon .sbss2.* .gnu.linkonce.sb2.* .dynbss .bss .bss.* .share.mem .gnu.linkonce.b.* COMMON) *libbt.a:(EXCLUDE_FILE (libbtdm_app.a) .dynsbss .sbss .sbss.* .gnu.linkonce.sb.* .scommon .sbss2.* .gnu.linkonce.sb2.* .dynbss .bss .bss.* .share.mem .gnu.linkonce.b.* COMMON) _ext_ram_bss_end = ABSOLUTE(.); } > extern_ram_seg diff --git a/components/lwip/apps/dhcpserver/dhcpserver.c b/components/lwip/apps/dhcpserver/dhcpserver.c index 7812f7425a..63f01a6854 100644 --- a/components/lwip/apps/dhcpserver/dhcpserver.c +++ b/components/lwip/apps/dhcpserver/dhcpserver.c @@ -81,31 +81,21 @@ typedef struct _list_node { static const u32_t magic_cookie = 0x63538263; -#if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY -static struct udp_pcb EXT_RAM_ATTR *pcb_dhcps; -static ip4_addr_t EXT_RAM_ATTR broadcast_dhcps; -static ip4_addr_t EXT_RAM_ATTR server_address; -static ip4_addr_t EXT_RAM_ATTR dns_server; -static ip4_addr_t EXT_RAM_ATTR client_address; //added -static ip4_addr_t EXT_RAM_ATTR client_address_plus; -static dhcps_lease_t EXT_RAM_ATTR dhcps_poll; -static dhcps_offer_t EXT_RAM_ATTR dhcps_dns; -#else static struct udp_pcb *pcb_dhcps = NULL; static ip4_addr_t broadcast_dhcps; static ip4_addr_t server_address; static ip4_addr_t dns_server = {0}; static ip4_addr_t client_address; //added static ip4_addr_t client_address_plus; -static dhcps_lease_t dhcps_poll; -static dhcps_offer_t dhcps_dns = 0x00; -#endif -static dhcps_cb_t dhcps_cb; + static list_node *plist = NULL; static bool renew = false; +static dhcps_lease_t dhcps_poll; static dhcps_time_t dhcps_lease_time = DHCPS_LEASE_TIME_DEF; //minute static dhcps_offer_t dhcps_offer = 0xFF; +static dhcps_offer_t dhcps_dns = 0x00; +static dhcps_cb_t dhcps_cb; /****************************************************************************** * FunctionName : dhcps_option_info