8051def.h

00001 /*
00002  * \file
00003  *      This file contains a set of configuration for using SDCC as a compiler.
00004  *      Modified from z80 port for cc2430 port.
00005  *
00006  * \author
00007  *      Takahide Matsutsuka <markn@markn.org>
00008  */
00009 
00010 #ifndef __8051_DEF_H__
00011 #define __8051_DEF_H__
00012 
00013 #define CC_CONF_FUNCTION_POINTER_ARGS   1
00014 #define CC_CONF_FASTCALL
00015 #define CC_CONF_VA_ARGS         1
00016 #define CC_CONF_UNSIGNED_CHAR_BUGS      0
00017 #define CC_CONF_REGISTER_ARGS           0
00018 #define CC_CONF_FUNCTION_POINTER_KEYWORD __reentrant
00019 
00020 /* Generic types. */
00021 typedef   signed char    int8_t;
00022 typedef unsigned char   uint8_t;
00023 typedef   signed short  int16_t;
00024 typedef unsigned short uint16_t;
00025 typedef unsigned long  uint32_t;
00026 typedef unsigned char   u8_t;      /* 8 bit type */
00027 typedef unsigned short u16_t;      /* 16 bit type */
00028 typedef unsigned long  u32_t;      /* 32 bit type */
00029 typedef   signed long  s32_t;      /* 32 bit type */
00030 typedef unsigned short uip_stats_t;
00031 typedef   signed long  int32_t;    /* 32 bit type */
00032 #ifndef _SIZE_T_DEFINED
00033 #define _SIZE_T_DEFINED
00034 typedef unsigned int size_t;
00035 #endif
00036 
00037 /* Compiler configurations */
00038 #define CCIF
00039 #define CLIF
00040 #define CC_CONF_CONST_FUNCTION_BUG
00041 
00042 /* Critical section management */
00043 #define DISABLE_INTERRUPTS()    EA = 0;
00044 #define ENABLE_INTERRUPTS()             EA = 1;
00045 
00046 #define ENTER_CRITICAL()        \
00047 {       \
00048         __asm           \
00049         push    ACC     \
00050         push    IE      \
00051         __endasm;       \
00052 }       \
00053         EA = 0;
00054 
00055 #define EXIT_CRITICAL() \
00056 {       \
00057         __asm                   \
00058         pop             ACC     \
00059         __endasm;               \
00060         ACC &= 0x80;            \
00061         IE |= ACC;              \
00062         __asm                   \
00063         pop             ACC     \
00064         __endasm;               \
00065 }
00066 
00067 /*
00068  * Enable architecture-depend checksum calculation
00069  * for uIP configuration.
00070  * @see uip_arch.h
00071  * @see uip_arch-asm.S
00072  */
00073 /*
00074  * DO NOT USE UIP_ARCH flags!
00075  * uip_arch code was copied from z80 directory but NOT ported
00076  */
00077 
00078 #define UIP_ARCH_ADD32          0
00079 #define UIP_ARCH_CHKSUM 0
00080 #define UIP_ARCH_IPCHKSUM
00081 
00082 #define CC_CONF_ASSIGN_AGGREGATE(dest, src)     \
00083     memcpy(dest, src, sizeof(*dest))
00084 
00085 #define uip_ipaddr_copy(dest, src)              \
00086     memcpy(dest, src, sizeof(*dest))
00087 
00088 #endif /* __8051_DEF_H__ */

Generated on Mon Apr 11 14:23:37 2011 for Contiki 2.5 by  doxygen 1.6.1