Home | History | Annotate | Download | only in arch
      1 #ifndef __LWIP_ARCH_CC_H__
      2 #define __LWIP_ARCH_CC_H__
      3 
      4 #include <klibc/compiler.h>
      5 #include <inttypes.h>
      6 #include <errno.h>
      7 #include <stdlib.h>
      8 #include <kaboom.h>
      9 #include <stdio.h>
     10 
     11 #define BYTE_ORDER LITTLE_ENDIAN
     12 
     13 typedef uint8_t  u8_t;
     14 typedef int8_t   s8_t;
     15 typedef uint16_t u16_t;
     16 typedef int16_t  s16_t;
     17 typedef uint32_t u32_t;
     18 typedef int32_t  s32_t;
     19 
     20 typedef uintptr_t mem_ptr_t;
     21 
     22 #define PACK_STRUCT_STRUCT	__packed
     23 
     24 #define LWIP_PLATFORM_USE_DPRINTF
     25 
     26 #ifdef LWIP_PLATFORM_USE_DPRINTF
     27 #  include <dprintf.h>
     28 #  define LWIP_PLATFORM_PRINTF dprintf
     29 #else
     30 #  define LWIP_PLATFORM_PRINTF printf
     31 #endif
     32 
     33 
     34 #if 1
     35 #define LWIP_PLATFORM_DIAG(x)	do { LWIP_PLATFORM_PRINTF x; } while(0)
     36 #define LWIP_PLATFORM_ASSERT(x)	do { LWIP_PLATFORM_PRINTF("LWIP(%s,%d,%p): %s", __FILE__, __LINE__, __builtin_return_address(0), (x)); kaboom(); } while(0)
     37 #else
     38 #define LWIP_PLATFORM_DIAG(x)	((void)0) /* For now... */
     39 #define LWIP_PLATFORM_ASSERT(x)	kaboom()
     40 #endif
     41 
     42 #define U16_F	PRIu16
     43 #define S16_F	PRId16
     44 #define X16_F	PRIx16
     45 #define U32_F	PRIu16
     46 #define S32_F	PRId16
     47 #define X32_F	PRIx16
     48 #define SZT_F	"zu"
     49 
     50 #endif /* __LWIP_ARCH_CC_H__ */
     51