Contiki 2.5
8051def.h
1 /*
2  * \file
3  * This file contains a set of configuration for using SDCC as a compiler.
4  * Modified from z80 port for cc2430 port.
5  *
6  * \author
7  * Takahide Matsutsuka <markn@markn.org>
8  */
9 
10 #ifndef __8051_DEF_H__
11 #define __8051_DEF_H__
12 
13 #define CC_CONF_FUNCTION_POINTER_ARGS 1
14 #define CC_CONF_FASTCALL
15 #define CC_CONF_VA_ARGS 1
16 #define CC_CONF_UNSIGNED_CHAR_BUGS 0
17 #define CC_CONF_REGISTER_ARGS 0
18 #define CC_CONF_FUNCTION_POINTER_KEYWORD __reentrant
19 
20 /* Generic types. */
21 typedef signed char int8_t;
22 typedef unsigned char uint8_t;
23 typedef signed short int16_t;
24 typedef unsigned short uint16_t;
25 typedef unsigned long uint32_t;
26 typedef unsigned char u8_t; /* 8 bit type */
27 typedef unsigned short u16_t; /* 16 bit type */
28 typedef unsigned long u32_t; /* 32 bit type */
29 typedef signed long s32_t; /* 32 bit type */
30 typedef unsigned short uip_stats_t;
31 typedef signed long int32_t; /* 32 bit type */
32 #ifndef _SIZE_T_DEFINED
33 #define _SIZE_T_DEFINED
34 typedef unsigned int size_t;
35 #endif
36 
37 /* Compiler configurations */
38 #define CCIF
39 #define CLIF
40 #define CC_CONF_CONST_FUNCTION_BUG
41 
42 /* Critical section management */
43 #define DISABLE_INTERRUPTS() EA = 0;
44 #define ENABLE_INTERRUPTS() EA = 1;
45 
46 #define ENTER_CRITICAL() \
47 { \
48  __asm \
49  push ACC \
50  push IE \
51  __endasm; \
52 } \
53  EA = 0;
54 
55 #define EXIT_CRITICAL() \
56 { \
57  __asm \
58  pop ACC \
59  __endasm; \
60  ACC &= 0x80; \
61  IE |= ACC; \
62  __asm \
63  pop ACC \
64  __endasm; \
65 }
66 
67 /*
68  * Enable architecture-depend checksum calculation
69  * for uIP configuration.
70  * @see uip_arch.h
71  * @see uip_arch-asm.S
72  */
73 /*
74  * DO NOT USE UIP_ARCH flags!
75  * uip_arch code was copied from z80 directory but NOT ported
76  */
77 
78 #define UIP_ARCH_ADD32 0
79 #define UIP_ARCH_CHKSUM 0
80 #define UIP_ARCH_IPCHKSUM
81 
82 #define CC_CONF_ASSIGN_AGGREGATE(dest, src) \
83  memcpy(dest, src, sizeof(*dest))
84 
85 #define uip_ipaddr_copy(dest, src) \
86  memcpy(dest, src, sizeof(*dest))
87 
88 #endif /* __8051_DEF_H__ */