Contiki 3.x
6502def.h
1 /*
2  * Copyright (c) 2007, 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 Contiki operating system.
30  *
31  * Author: Oliver Schmidt <ol.sc@web.de>
32  *
33  */
34 
35 #ifndef S502DEF_H_
36 #define S502DEF_H_
37 
38 #include <ctype.h>
39 #include <conio.h>
40 #include <fcntl.h>
41 #include <stdio.h>
42 #include <stdint.h>
43 #include <unistd.h>
44 
45 #include "pfs.h"
46 
47 /* These names are deprecated, use C99 names. */
48 typedef uint8_t u8_t;
49 typedef uint16_t u16_t;
50 typedef uint32_t u32_t;
51 typedef int32_t s32_t;
52 
53 #define CC_CONF_REGISTER_ARGS 1
54 #define CC_CONF_FASTCALL __fastcall__
55 
56 #define ARCH_DOESNT_NEED_ALIGNED_STRUCTS 1
57 
58 #define CCIF
59 #define CLIF
60 
61 #define HAVE_SNPRINTF
62 #define snprintf(buf, len, ...) sprintf(buf, __VA_ARGS__)
63 
64 #define CLOCK_CONF_SECOND 2
65 typedef unsigned short clock_time_t;
66 
67 typedef unsigned short uip_stats_t;
68 
69 #define UIP_ARCH_ADD32 1
70 #define UIP_ARCH_CHKSUM 1
71 
72 #define UIP_CONF_LLH_LEN 14
73 #define RESOLV_CONF_SUPPORTS_MDNS 0
74 #define RESOLV_CONF_SUPPORTS_RECORD_EXPIRATION 0
75 #define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 1
76 
77 #define LOADER_CONF_ARCH "lib/unload.h"
78 
79 #if MTU_SIZE
80 #define UIP_CONF_BUFFER_SIZE (UIP_LLH_LEN + MTU_SIZE)
81 #else /* MTU_SIZE */
82 #define UIP_CONF_BUFFER_SIZE (UIP_LLH_LEN + 1500)
83 #endif /* MTU_SIZE */
84 
85 #if CONNECTIONS
86 #define UIP_CONF_MAX_CONNECTIONS CONNECTIONS
87 #else /* CONNECTIONS */
88 #define UIP_CONF_MAX_CONNECTIONS 10
89 #endif /* CONNECTIONS */
90 
91 #if WITH_LOGGING
92 #define LOG_CONF_ENABLED 1
93 #define UIP_CONF_LOGGING 1
94 #else /* WITH_LOGGING */
95 #define LOG_CONF_ENABLED 0
96 #define UIP_CONF_LOGGING 0
97 #endif /* WITH_LOGGING */
98 
99 #if WITH_BOOST
100 #define UIP_CONF_TCP_SPLIT 1
101 #else /* WITH_BOOST */
102 #define UIP_CONF_TCP_SPLIT 0
103 #endif /* WITH_BOOST */
104 
105 #if WITH_FORWARDING
106 #define UIP_CONF_IP_FORWARD 1
107 #else /* WITH_FORWARDING */
108 #define UIP_CONF_IP_FORWARD 0
109 #endif /* WITH_FORWARDING */
110 
111 #if WITH_CLIENT
112 #define UIP_CONF_ACTIVE_OPEN 1
113 #else /* WITH_CLIENT */
114 #define UIP_CONF_ACTIVE_OPEN 0
115 #endif /* WITH_CLIENT */
116 
117 #if WITH_DNS
118 #define UIP_CONF_UDP 1
119 #else /* WITH_DNS */
120 #define UIP_CONF_UDP 0
121 #endif /* WITH_DNS */
122 
123 #define CTK_CONF_WIDGET_FLAGS 0
124 #define CTK_CONF_WINDOWS 0
125 #define CTK_CONF_WINDOWMOVE 0
126 #define CTK_CONF_WINDOWCLOSE 0
127 #define CTK_CONF_ICONS 0
128 #define CTK_CONF_MENUS 0
129 #define CTK_CONF_SCREENSAVER 0
130 
131 #if WITH_MOUSE
132 #define CTK_CONF_MOUSE_SUPPORT 1
133 #else /* WITH_MOUSE */
134 #define CTK_CONF_MOUSE_SUPPORT 0
135 #endif /* WITH_MOUSE */
136 
137 #define ctk_arch_keyavail kbhit
138 #define ctk_arch_getkey cgetc
139 #define ctk_arch_isprint isprint
140 
141 #define CFS_CONF_OFFSET_TYPE off_t
142 
143 #if WITH_PFS
144 #define cfs_open pfs_open
145 #define cfs_close pfs_close
146 #define cfs_read pfs_read
147 #define cfs_write pfs_write
148 #define cfs_seek pfs_seek
149 #define cfs_remove pfs_remove
150 #else /* WITH_PFS */
151 #define CFS_READ (O_RDONLY)
152 #define CFS_WRITE (O_WRONLY | O_CREAT | O_TRUNC)
153 #define CFS_SEEK_SET (SEEK_SET)
154 #define CFS_SEEK_CUR (SEEK_CUR)
155 #define CFS_SEEK_END (SEEK_END)
156 #define cfs_open open
157 #define cfs_close close
158 #define cfs_read read
159 #define cfs_write write
160 #define cfs_seek lseek
161 #define cfs_remove remove
162 #endif /* WITH_PFS */
163 
164 #endif /* S502DEF_H_ */