| /* |
| * |
| * Copyright (c) 2012 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 FreeRTOS. |
| * |
| */ |
| |
| #ifndef NL_LWIP_FREERTOS_ARCH_CC_H |
| #define NL_LWIP_FREERTOS_ARCH_CC_H |
| |
| #include <errno.h> |
| #include <stddef.h> |
| #include <stdint.h> |
| #include <stdio.h> |
| |
| #include <sys/time.h> |
| |
| // TODO: We really shouldn't be including a Nesty file in a product/platform agnostic file like this. |
| // What we really need is a lwipopts.h like file that allows us to shim away platform specific information. |
| #include <nlerlog.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 int 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__) |
| #define BYTE_ORDER LITTLE_ENDIAN |
| #elif defined(__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 "u" |
| #define S16_F "d" |
| #define X16_F "x" |
| #define U32_F "lu" |
| #define S32_F "ld" |
| #define X32_F "lx" |
| #define SZT_F "u" |
| |
| #define PACK_STRUCT_STRUCT __attribute__ ((__packed__)) |
| #define PACK_STRUCT_FIELD(x) x |
| |
| #define _LWIP_PLATFORM_DIAG(...) NL_LOG_DEBUG(lrLWIP, __VA_ARGS__); |
| |
| #define LWIP_PLATFORM_DIAG(x) \ |
| do { \ |
| _LWIP_PLATFORM_DIAG x \ |
| } while (0); |
| |
| #endif /* NL_LWIP_FREERTOS_ARCH_CC_H */ |