3 * Copyright (c) 2020 Nest Labs, Inc.
6 * This document is the property of Nest. It is considered
7 * confidential and proprietary information.
9 * This document may not be reproduced or transmitted in any form,
10 * in whole or in part, without the express written permission of
14 * This file defines processor-architecture- and toolchain-
15 * specific constants and types required for building
16 * LwIP against FreeRTOS.
20 #ifndef NL_LWIP_FREERTOS_ARCH_CC_H
21 #define NL_LWIP_FREERTOS_ARCH_CC_H
31 #if CHIP_CONFIG_MEMORY_MGMT_MALLOC
41 #define LWIP_PLATFORM_ASSERT(MSG) assert(MSG);
43 #define LWIP_PLATFORM_ASSERT(MSG)
46 #define LWIP_PLATFORM_ASSERT(message)
50 #if defined(__LITTLE_ENDIAN__)
51 #define BYTE_ORDER LITTLE_ENDIAN
52 #elif defined(__BIG_ENDIAN__)
53 #define BYTE_ORDER BIG_ENDIAN
54 #elif defined(__BYTE_ORDER__)
55 #define BYTE_ORDER __BYTE_ORDER__
59 #define PACK_STRUCT_STRUCT __attribute__((__packed__))
60 #define PACK_STRUCT_FIELD(x) x
62 extern void LwIPLog(const char * fmt, ...);
63 #define LWIP_PLATFORM_DIAG(x) \
69 // Place LwIP pools into their own subsections of .bss to make it easier to see
70 // their sizes in the linker map file.
71 extern uint8_t __attribute__((section(".bss.lwip_ND6_QUEUE"))) memp_memory_ND6_QUEUE_base[];
72 extern uint8_t __attribute__((section(".bss.lwip_IP6_REASSDATA"))) memp_memory_IP6_REASSDATA_base[];
73 extern uint8_t __attribute__((section(".bss.lwip_RAW_PCB"))) memp_memory_RAW_PCB_base[];
74 extern uint8_t __attribute__((section(".bss.lwip_TCP_SEG"))) memp_memory_TCP_SEG_base[];
75 extern uint8_t __attribute__((section(".bss.lwip_PBUF_POOL"))) memp_memory_PBUF_POOL_base[];
76 extern uint8_t __attribute__((section(".bss.lwip_FRAG_PBUF"))) memp_memory_FRAG_PBUF_base[];
77 extern uint8_t __attribute__((section(".bss.lwip_PBUF"))) memp_memory_PBUF_base[];
78 extern uint8_t __attribute__((section(".bss.lwip_TCP_PCB_LISTEN"))) memp_memory_TCP_PCB_LISTEN_base[];
79 extern uint8_t __attribute__((section(".bss.lwip_REASSDATA"))) memp_memory_REASSDATA_base[];
80 extern uint8_t __attribute__((section(".bss.lwip_UDP_PCB"))) memp_memory_UDP_PCB_base[];
81 extern uint8_t __attribute__((section(".bss.lwip_MLD6_GROUP"))) memp_memory_MLD6_GROUP_base[];
82 extern uint8_t __attribute__((section(".bss.lwip_IGMP_GROUP"))) memp_memory_IGMP_GROUP_base[];
83 extern uint8_t __attribute__((section(".bss.lwip_TCP_PCB"))) memp_memory_TCP_PCB_base[];
84 extern uint8_t __attribute__((section(".bss.lwip_SYS_TIMEOUT"))) memp_memory_SYS_TIMEOUT_base[];
90 #endif /* NL_LWIP_FREERTOS_ARCH_CC_H */