2 * Copyright (c) 2020 Project CHIP Authors
3 * Copyright (c) 2018-2019 Google LLC.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 * This file defines processor-architecture- and toolchain-
22 * specific constants and types required for building
23 * LwIP against FreeRTOS.
27 #ifndef CHIP_LWIP_FREERTOS_ARCH_CC_H
28 #define CHIP_LWIP_FREERTOS_ARCH_CC_H
39 //#include "app_error.h"
47 #define LWIP_PLATFORM_ASSERT(MSG) assert(0)
49 #define LWIP_PLATFORM_ASSERT(MSG) assert(0)
52 #define LWIP_PLATFORM_ASSERT(message)
56 #if defined(__LITTLE_ENDIAN__)
57 #define BYTE_ORDER LITTLE_ENDIAN
58 #elif defined(__BIG_ENDIAN__)
59 #define BYTE_ORDER BIG_ENDIAN
60 #elif defined(__BYTE_ORDER__)
61 #define BYTE_ORDER __BYTE_ORDER__
65 #define PACK_STRUCT_STRUCT __attribute__((__packed__))
66 #define PACK_STRUCT_FIELD(x) x
68 extern void LwIPLog(const char * fmt, ...);
69 #define LWIP_PLATFORM_DIAG(x) \
75 // Place LwIP pools into their own subsections of .bss to make it easier to see
76 // their sizes in the linker map file.
77 extern uint8_t __attribute__((section(".bss.lwip_ND6_QUEUE"))) memp_memory_ND6_QUEUE_base[];
78 extern uint8_t __attribute__((section(".bss.lwip_IP6_REASSDATA"))) memp_memory_IP6_REASSDATA_base[];
79 extern uint8_t __attribute__((section(".bss.lwip_RAW_PCB"))) memp_memory_RAW_PCB_base[];
80 extern uint8_t __attribute__((section(".bss.lwip_TCP_SEG"))) memp_memory_TCP_SEG_base[];
81 extern uint8_t __attribute__((section(".bss.lwip_PBUF_POOL"))) memp_memory_PBUF_POOL_base[];
82 extern uint8_t __attribute__((section(".bss.lwip_FRAG_PBUF"))) memp_memory_FRAG_PBUF_base[];
83 extern uint8_t __attribute__((section(".bss.lwip_PBUF"))) memp_memory_PBUF_base[];
84 extern uint8_t __attribute__((section(".bss.lwip_TCP_PCB_LISTEN"))) memp_memory_TCP_PCB_LISTEN_base[];
85 extern uint8_t __attribute__((section(".bss.lwip_REASSDATA"))) memp_memory_REASSDATA_base[];
86 extern uint8_t __attribute__((section(".bss.lwip_UDP_PCB"))) memp_memory_UDP_PCB_base[];
87 extern uint8_t __attribute__((section(".bss.lwip_MLD6_GROUP"))) memp_memory_MLD6_GROUP_base[];
88 extern uint8_t __attribute__((section(".bss.lwip_IGMP_GROUP"))) memp_memory_IGMP_GROUP_base[];
89 extern uint8_t __attribute__((section(".bss.lwip_TCP_PCB"))) memp_memory_TCP_PCB_base[];
90 extern uint8_t __attribute__((section(".bss.lwip_SYS_TIMEOUT"))) memp_memory_SYS_TIMEOUT_base[];
96 #endif /* CHIP_LWIP_FREERTOS_ARCH_CC_H */