Skip to content

Commit 7d23620

Browse files
committed
extmod: Place lwIP memory in a dedicated section.
Place lwIP memory in its own section to allow to relocating it via the linker script. If this section is not defined this falls through to .bss. This macro also aligns the memory without adding trailing padding bytes. See comments in src/include/lwip/arch.h Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
1 parent cd4fb3a commit 7d23620

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

extmod/lwip-include/lwipopts_common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@
109109
// Needed for PPP.
110110
#define sys_jiffies sys_now
111111

112+
// Place lwIP memory in a dedicated section to allow relocating it.
113+
// Note: alignment is enforced without adding trailing padding bytes.
114+
#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) \
115+
__attribute__((section(".lwip"), aligned(MEM_ALIGNMENT))) u8_t variable_name[size]
116+
112117
typedef uint32_t sys_prot_t;
113118

114119
#endif // MICROPY_INCLUDED_LWIPOPTS_COMMON_H

0 commit comments

Comments
 (0)