The Pedigree Project  0.1
cc.h
1 /*
2  * Copyright (c) 2008-2014, Pedigree Developers
3  *
4  * Please see the CONTRIB file in the root of the source tree for a full
5  * list of contributors.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 
21 #ifndef LWIP_ARCH_CC_H
22 #define LWIP_ARCH_CC_H
23 
24 #include <pedigree/kernel/compiler.h>
25 #include <pedigree/kernel/processor/types.h>
26 #ifdef UTILITY_LINUX
27 #include <assert.h>
28 #include <sys/time.h>
29 
30 typedef uint16_t sa_family_t;
31 
32 #define LWIP_TIMEVAL_PRIVATE 0
33 #else
34 #include <pedigree/kernel/utilities/assert.h>
35 #include <pedigree/kernel/utilities/utility.h>
36 #endif
37 
38 typedef uint8_t u8_t;
39 typedef uint16_t u16_t;
40 typedef uint32_t u32_t;
41 
42 typedef int8_t s8_t;
43 typedef int16_t s16_t;
44 typedef int32_t s32_t;
45 
46 typedef intptr_t mem_ptr_t;
47 
48 // 0/1 - interrupt state before protecting
49 typedef int sys_prot_t;
50 
51 #define U16_F "u"
52 #define S16_F "d"
53 #define X16_F "x"
54 
55 #define U32_F "u"
56 #define S32_F "d"
57 #define X32_F "x"
58 
59 #define SZT_F "zu"
60 
61 #define LWIP_CHKSUM_ALGORITHM 2
62 
63 #ifdef UTILITY_LINUX
64 #include <stdio.h>
65 
66 #define LWIP_PLATFORM_DIAG(msg) printf msg ; fflush(stdout);
67 #define LWIP_PLATFORM_ASSERT(msg) fprintf(stderr, "Assertion failed; %s:%d %s\n", __FILE__, __LINE__, msg); assert(0)
68 #else
69 #define LWIP_PLATFORM_DIAG(msg) Noticef msg ;
70 #define LWIP_PLATFORM_ASSERT(msg) Errorf("Assertion failed; %s:%d %s", __FILE__, __LINE__, msg); assert(0)
71 #endif
72 
73 #define PACK_STRUCT_STRUCT PACKED
74 
75 #define LWIP_NO_STDINT_H 1
76 
77 #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
78 
79 #define LWIP_DEBUG 1
80 
81 #if 0
82 #define ETHARP_DEBUG LWIP_DBG_ON
83 #define NETIF_DEBUG LWIP_DBG_ON
84 #define PBUF_DEBUG LWIP_DBG_ON
85 #define MEM_DEBUG LWIP_DBG_ON
86 #define MEMP_DEBUG LWIP_DBG_ON
87 #define IP_DEBUG LWIP_DBG_ON
88 #define INET_DEBUG LWIP_DBG_ON
89 #define TCP_DEBUG LWIP_DBG_ON
90 #define TCPIP_DEBUG LWIP_DBG_ON
91 #endif
92 
93 #endif // LWIP_ARCH_CC_H