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