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#include <config.h>
24
25#include <pedigree/kernel/compiler.h>
26#include <pedigree/kernel/processor/types.h>
27#if UTILITY_LINUX
28#include <assert.h>
29#include <sys/time.h>
30
31typedef uint16_t sa_family_t;
32
33#define LWIP_TIMEVAL_PRIVATE 0
34#else
35#include <pedigree/kernel/utilities/assert.h>
36#include <pedigree/kernel/utilities/utility.h>
37#endif
38
39typedef uint8_t u8_t;
40typedef uint16_t u16_t;
41typedef uint32_t u32_t;
42
43typedef int8_t s8_t;
44typedef int16_t s16_t;
45typedef int32_t s32_t;
46
47typedef intptr_t mem_ptr_t;
48
49// 0/1 - interrupt state before protecting
50typedef int sys_prot_t;
51
52#define U16_F "u"
53#define S16_F "d"
54#define X16_F "x"
55
56#define U32_F "u"
57#define S32_F "d"
58#define X32_F "x"
59
60#define SZT_F "zu"
61
62#define LWIP_CHKSUM_ALGORITHM 2
63
64#if UTILITY_LINUX
65#include <stdio.h>
66
67#define LWIP_PLATFORM_DIAG(msg) printf msg ; fflush(stdout);
68#define LWIP_PLATFORM_ASSERT(msg) fprintf(stderr, "Assertion failed; %s:%d %s\n", __FILE__, __LINE__, msg); assert(0)
69#else
70#define LWIP_PLATFORM_DIAG(msg) Noticef msg ;
71#define LWIP_PLATFORM_ASSERT(msg) Errorf("Assertion failed; %s:%d %s", __FILE__, __LINE__, msg); assert(0)
72#endif
73
74#define PACK_STRUCT_STRUCT PACKED
75
76#define LWIP_NO_STDINT_H 1
77
78#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
79
80#define LWIP_DEBUG 1
81
82#if 0
83#define ETHARP_DEBUG LWIP_DBG_ON
84#define NETIF_DEBUG LWIP_DBG_ON
85#define PBUF_DEBUG LWIP_DBG_ON
86#define MEM_DEBUG LWIP_DBG_ON
87#define MEMP_DEBUG LWIP_DBG_ON
88#define IP_DEBUG LWIP_DBG_ON
89#define INET_DEBUG LWIP_DBG_ON
90#define TCP_DEBUG LWIP_DBG_ON
91#define TCPIP_DEBUG LWIP_DBG_ON
92#endif
93
94#endif // LWIP_ARCH_CC_H