| /* |
| * |
| * Copyright (c) 2012-2013 Nest Labs, Inc. |
| * All rights reserved. |
| * |
| * This document is the property of Nest. It is considered |
| * confidential and proprietary information. |
| * |
| * This document may not be reproduced or transmitted in any form, |
| * in whole or in part, without the express written permission of |
| * Nest. |
| * |
| * Description: |
| * This file defines processor-architecture- and toolchain- |
| * specific constants and types required for building |
| * LwIP against Linux. |
| * |
| */ |
| |
| #ifndef NL_LWIP_LINUX_ARCH_CC_H |
| #define NL_LWIP_LINUX_ARCH_CC_H |
| |
| #include <errno.h> |
| #include <malloc.h> |
| #include <stddef.h> |
| #include <stdint.h> |
| #include <stdio.h> |
| |
| #include <sys/time.h> |
| |
| typedef int8_t s8_t; |
| typedef uint8_t u8_t; |
| typedef int16_t s16_t; |
| typedef uint16_t u16_t; |
| typedef int32_t s32_t; |
| typedef uint32_t u32_t; |
| |
| typedef ptrdiff_t mem_ptr_t; |
| |
| typedef u32_t sys_prot_t; |
| |
| #ifndef LWIP_NOASSERT |
| #define LWIP_PLATFORM_ASSERT(message) do { puts(message); } while (0) |
| #else |
| #define LWIP_PLATFORM_ASSERT(message) |
| #endif |
| |
| #ifndef BYTE_ORDER |
| #if defined(__LITTLE_ENDIAN__) || defined(__ORDER_LITTLE_ENDIAN__) |
| #define BYTE_ORDER LITTLE_ENDIAN |
| #elif defined(__BIG_ENDIAN__) || defined (__ORDER_BIG_ENDIAN__) |
| #define BYTE_ORDER BIG_ENDIAN |
| #elif defined(__BYTE_ORDER__) |
| #define BYTE_ORDER __BYTE_ORDER__ |
| #endif |
| #endif |
| |
| /* LwIP Debug Output Formatting and Function Calls */ |
| |
| #define U16_F "hu" |
| #define S16_F "hd" |
| #define X16_F "hx" |
| #define U32_F "u" |
| #define S32_F "d" |
| #define X32_F "x" |
| #define SZT_F "zu" |
| |
| #define PACK_STRUCT_STRUCT __attribute__ ((__packed__)) |
| #define PACK_STRUCT_FIELD(x) x |
| |
| #define LWIP_PLATFORM_DIAG(x) \ |
| do { \ |
| printf x; \ |
| } while (0) |
| |
| #endif /* NL_LWIP_LINUX_ARCH_CC_H */ |