ESP8266
cc.h
1 /*
2  * Copyright (c) 2001, Swedish Institute of Computer Science.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * This file is part of the lwIP TCP/IP stack.
30  *
31  * Author: Adam Dunkels <adam@sics.se>
32  *
33  */
34 #ifndef __ARCH_CC_H__
35 #define __ARCH_CC_H__
36 
37 //#include <string.h>
38 #include "c_types.h"
39 #include "ets_sys.h"
40 #include "osapi.h"
41 #define EFAULT 14
42 
43 //#define LWIP_PROVIDE_ERRNO
44 
45 #if (1)
46 #define BYTE_ORDER LITTLE_ENDIAN
47 #else
48 #define BYTE_ORDER BIG_ENDIAN
49 #endif
50 
51 
52 typedef unsigned char u8_t;
53 typedef signed char s8_t;
54 typedef unsigned short u16_t;
55 typedef signed short s16_t;
56 typedef unsigned long u32_t;
57 typedef signed long s32_t;
58 typedef unsigned long mem_ptr_t;
59 
60 #define S16_F "d"
61 #define U16_F "d"
62 #define X16_F "x"
63 
64 #define S32_F "d"
65 #define U32_F "d"
66 #define X32_F "x"
67 
68 
69 
70 //#define PACK_STRUCT_FIELD(x) x __attribute__((packed))
71 #define PACK_STRUCT_FIELD(x) x
72 #define PACK_STRUCT_STRUCT __attribute__((packed))
73 #define PACK_STRUCT_BEGIN
74 #define PACK_STRUCT_END
75 
76 //#define LWIP_DEBUG
77 
78 #ifdef LWIP_DEBUG
79 #define LWIP_PLATFORM_DIAG(x) os_printf x
80 #define LWIP_PLATFORM_ASSERT(x) ETS_ASSERT(x)
81 #else
82 #define LWIP_PLATFORM_DIAG(x)
83 #define LWIP_PLATFORM_ASSERT(x)
84 #endif
85 
86 #define SYS_ARCH_DECL_PROTECT(x)
87 #define SYS_ARCH_PROTECT(x)
88 #define SYS_ARCH_UNPROTECT(x)
89 
90 #define LWIP_PLATFORM_BYTESWAP 1
91 #define LWIP_PLATFORM_HTONS(_n) ((u16_t)((((_n) & 0xff) << 8) | (((_n) >> 8) & 0xff)))
92 #define LWIP_PLATFORM_HTONL(_n) ((u32_t)( (((_n) & 0xff) << 24) | (((_n) & 0xff00) << 8) | (((_n) >> 8) & 0xff00) | (((_n) >> 24) & 0xff) ))
93 
94 #if LWIP_RAW
95 extern u8_t memp_memory_RAW_PCB_base[];
96 #endif /* LWIP_RAW */
97 
98 #if LWIP_UDP
99 extern u8_t memp_memory_UDP_PCB_base[];
100 #endif /* LWIP_UDP */
101 
102 #if LWIP_TCP
103 extern u8_t memp_memory_TCP_PCB_base[];
104 extern u8_t memp_memory_TCP_PCB_LISTEN_base[];
105 extern u8_t memp_memory_TCP_SEG_base[] SHMEM_ATTR;
106 #endif /* LWIP_TCP */
107 
108 #if (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) /* LWIP_TIMERS */
109 extern u8_t memp_memory_SYS_TIMEOUT_base[];
110 #endif /* LWIP_TIMERS */
111 
112 extern u8_t memp_memory_PBUF_base[];
113 extern u8_t memp_memory_PBUF_POOL_base[];
114 
115 
116 
117 #endif /* __ARCH_CC_H__ */