Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / lwip / cc13x2_26x2 / arch / cc.h
1 /*
2  *    Copyright (c) 2020 Project CHIP Authors
3  *    Copyright (c) 2018-2019 Google LLC.
4  *
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
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17
18 /*
19  *
20  *    Description:
21  *      This file defines processor-architecture- and toolchain-
22  *      specific constants and types required for building
23  *      LwIP against FreeRTOS.
24  *
25  */
26
27 #ifndef CHIP_LWIP_FREERTOS_ARCH_CC_H
28 #define CHIP_LWIP_FREERTOS_ARCH_CC_H
29
30 #include <errno.h>
31 #include <malloc.h>
32 #include <stddef.h>
33 #include <stdint.h>
34 #include <stdio.h>
35 #include <stdlib.h>
36
37 #include <sys/time.h>
38
39 //#include "app_error.h"
40
41 #if __cplusplus
42 extern "C" {
43 #endif
44
45 #ifndef LWIP_NOASSERT
46 #ifdef DEBUG
47 #define LWIP_PLATFORM_ASSERT(MSG) assert(0)
48 #else
49 #define LWIP_PLATFORM_ASSERT(MSG) assert(0)
50 #endif
51 #else
52 #define LWIP_PLATFORM_ASSERT(message)
53 #endif
54
55 #ifndef BYTE_ORDER
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__
62 #endif
63 #endif // BYTE_ORDER
64
65 #define PACK_STRUCT_STRUCT __attribute__((__packed__))
66 #define PACK_STRUCT_FIELD(x) x
67
68 extern void LwIPLog(const char * fmt, ...);
69 #define LWIP_PLATFORM_DIAG(x)                                                                                                      \
70     do                                                                                                                             \
71     {                                                                                                                              \
72         LwIPLog x;                                                                                                                 \
73     } while (0)
74
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[];
91
92 #if __cplusplus
93 }
94 #endif
95
96 #endif /* CHIP_LWIP_FREERTOS_ARCH_CC_H */