lwip-sys with changes

Fork of lwip-sys by mbed official

Committer:
emilmont
Date:
Fri Mar 01 15:31:22 2013 +0000
Revision:
8:742ae4a0ca3f
Parent:
6:2ace1ff71ae6
Child:
9:d7ad3f3ee934
editor whitespaces

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 8:742ae4a0ca3f 1 /*
emilmont 8:742ae4a0ca3f 2 * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
emilmont 8:742ae4a0ca3f 3 * All rights reserved.
emilmont 8:742ae4a0ca3f 4 *
emilmont 8:742ae4a0ca3f 5 * Redistribution and use in source and binary forms, with or without modification,
emilmont 8:742ae4a0ca3f 6 * are permitted provided that the following conditions are met:
emilmont 8:742ae4a0ca3f 7 *
emilmont 8:742ae4a0ca3f 8 * 1. Redistributions of source code must retain the above copyright notice,
emilmont 8:742ae4a0ca3f 9 * this list of conditions and the following disclaimer.
emilmont 8:742ae4a0ca3f 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
emilmont 8:742ae4a0ca3f 11 * this list of conditions and the following disclaimer in the documentation
emilmont 8:742ae4a0ca3f 12 * and/or other materials provided with the distribution.
emilmont 8:742ae4a0ca3f 13 * 3. The name of the author may not be used to endorse or promote products
emilmont 8:742ae4a0ca3f 14 * derived from this software without specific prior written permission.
emilmont 8:742ae4a0ca3f 15 *
emilmont 8:742ae4a0ca3f 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
emilmont 8:742ae4a0ca3f 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
emilmont 8:742ae4a0ca3f 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
emilmont 8:742ae4a0ca3f 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
emilmont 8:742ae4a0ca3f 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
emilmont 8:742ae4a0ca3f 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
emilmont 8:742ae4a0ca3f 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
emilmont 8:742ae4a0ca3f 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
emilmont 8:742ae4a0ca3f 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
emilmont 8:742ae4a0ca3f 25 * OF SUCH DAMAGE.
emilmont 8:742ae4a0ca3f 26 *
emilmont 8:742ae4a0ca3f 27 * This file is part of the lwIP TCP/IP stack.
emilmont 8:742ae4a0ca3f 28 *
emilmont 8:742ae4a0ca3f 29 * Author: Adam Dunkels <adam@sics.se>
emilmont 8:742ae4a0ca3f 30 *
emilmont 8:742ae4a0ca3f 31 */
emilmont 8:742ae4a0ca3f 32 #ifndef __CC_H__
emilmont 8:742ae4a0ca3f 33 #define __CC_H__
emilmont 8:742ae4a0ca3f 34
emilmont 8:742ae4a0ca3f 35 #include <stdint.h>
emilmont 8:742ae4a0ca3f 36
emilmont 8:742ae4a0ca3f 37 /* Types based on stdint.h */
emilmont 8:742ae4a0ca3f 38 typedef uint8_t u8_t;
emilmont 8:742ae4a0ca3f 39 typedef int8_t s8_t;
emilmont 8:742ae4a0ca3f 40 typedef uint16_t u16_t;
emilmont 8:742ae4a0ca3f 41 typedef int16_t s16_t;
emilmont 8:742ae4a0ca3f 42 typedef uint32_t u32_t;
emilmont 8:742ae4a0ca3f 43 typedef int32_t s32_t;
emilmont 8:742ae4a0ca3f 44 typedef uintptr_t mem_ptr_t;
emilmont 8:742ae4a0ca3f 45
emilmont 8:742ae4a0ca3f 46 /* Define (sn)printf formatters for these lwIP types */
emilmont 8:742ae4a0ca3f 47 #define U16_F "hu"
emilmont 8:742ae4a0ca3f 48 #define S16_F "hd"
emilmont 8:742ae4a0ca3f 49 #define X16_F "hx"
emilmont 8:742ae4a0ca3f 50 #define U32_F "lu"
emilmont 8:742ae4a0ca3f 51 #define S32_F "ld"
emilmont 8:742ae4a0ca3f 52 #define X32_F "lx"
emilmont 8:742ae4a0ca3f 53 #define SZT_F "uz"
emilmont 8:742ae4a0ca3f 54
emilmont 8:742ae4a0ca3f 55 /* ARM/LPC17xx is little endian only */
emilmont 8:742ae4a0ca3f 56 #define BYTE_ORDER LITTLE_ENDIAN
emilmont 8:742ae4a0ca3f 57
emilmont 8:742ae4a0ca3f 58 /* Use LWIP error codes */
emilmont 8:742ae4a0ca3f 59 #define LWIP_PROVIDE_ERRNO
emilmont 8:742ae4a0ca3f 60
emilmont 8:742ae4a0ca3f 61 #if defined(__arm__) && defined(__ARMCC_VERSION)
emilmont 8:742ae4a0ca3f 62 /* Keil uVision4 tools */
emilmont 8:742ae4a0ca3f 63 #define PACK_STRUCT_BEGIN __packed
emilmont 8:742ae4a0ca3f 64 #define PACK_STRUCT_STRUCT
emilmont 8:742ae4a0ca3f 65 #define PACK_STRUCT_END
emilmont 8:742ae4a0ca3f 66 #define PACK_STRUCT_FIELD(fld) fld
emilmont 8:742ae4a0ca3f 67 #define ALIGNED(n) __align(n)
emilmont 8:742ae4a0ca3f 68 #elif defined (__IAR_SYSTEMS_ICC__)
emilmont 8:742ae4a0ca3f 69 /* IAR Embedded Workbench tools */
emilmont 8:742ae4a0ca3f 70 #define PACK_STRUCT_BEGIN __packed
emilmont 8:742ae4a0ca3f 71 #define PACK_STRUCT_STRUCT
emilmont 8:742ae4a0ca3f 72 #define PACK_STRUCT_END
emilmont 8:742ae4a0ca3f 73 #define PACK_STRUCT_FIELD(fld) fld
emilmont 8:742ae4a0ca3f 74 // #define PACK_STRUCT_USE_INCLUDES
emilmont 8:742ae4a0ca3f 75 #error NEEDS ALIGNED // FIXME TBD
emilmont 8:742ae4a0ca3f 76 #else
emilmont 8:742ae4a0ca3f 77 /* GCC tools (CodeSourcery) */
emilmont 8:742ae4a0ca3f 78 #define PACK_STRUCT_BEGIN
emilmont 8:742ae4a0ca3f 79 #define PACK_STRUCT_STRUCT __attribute__ ((__packed__))
emilmont 8:742ae4a0ca3f 80 #define PACK_STRUCT_END
emilmont 8:742ae4a0ca3f 81 #define PACK_STRUCT_FIELD(fld) fld
emilmont 8:742ae4a0ca3f 82 #define ALIGNED(n) __attribute__((aligned (n)))
emilmont 8:742ae4a0ca3f 83 #define ALIGNED(n) __align(n)
emilmont 8:742ae4a0ca3f 84 #endif
emilmont 8:742ae4a0ca3f 85
emilmont 8:742ae4a0ca3f 86 /* Used with IP headers only */
emilmont 8:742ae4a0ca3f 87 #define LWIP_CHKSUM_ALGORITHM 1
emilmont 8:742ae4a0ca3f 88
emilmont 8:742ae4a0ca3f 89 #ifdef LWIP_DEBUG
emilmont 8:742ae4a0ca3f 90
emilmont 8:742ae4a0ca3f 91 #include "stdio.h"
emilmont 8:742ae4a0ca3f 92
emilmont 8:742ae4a0ca3f 93 void assert_printf(char *msg, int line, char *file);
emilmont 8:742ae4a0ca3f 94
emilmont 8:742ae4a0ca3f 95 /* Plaform specific diagnostic output */
emilmont 8:742ae4a0ca3f 96 #define LWIP_PLATFORM_DIAG(vars) printf vars
emilmont 8:742ae4a0ca3f 97 #define LWIP_PLATFORM_ASSERT(flag) { assert_printf((flag), __LINE__, __FILE__); }
emilmont 8:742ae4a0ca3f 98 #else
emilmont 8:742ae4a0ca3f 99 #define LWIP_PLATFORM_DIAG(msg) { ; }
emilmont 8:742ae4a0ca3f 100 #define LWIP_PLATFORM_ASSERT(flag) { ; }
emilmont 8:742ae4a0ca3f 101 #endif
emilmont 8:742ae4a0ca3f 102
emilmont 8:742ae4a0ca3f 103 #include "cmsis.h"
emilmont 8:742ae4a0ca3f 104 #define LWIP_PLATFORM_HTONS(x) __REV16(x)
emilmont 8:742ae4a0ca3f 105 #define LWIP_PLATFORM_HTONL(x) __REV(x)
emilmont 8:742ae4a0ca3f 106
emilmont 8:742ae4a0ca3f 107 #endif /* __CC_H__ */