tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8830 / sci_types.h
1 /******************************************************************************
2  ** File Name:      sci_types.h                                               *
3  ** Author:         jakle zhu                                                 *
4  ** DATE:           10/22/2001                                                *
5  ** Copyright:      2001 Spreatrum, Incoporated. All Rights Reserved.         *
6  ** Description:    This header file contains general types and macros that   *
7  **                     are of use to all modules.The values or definitions are   *
8  **                             dependent on the specified target.  T_WINNT specifies     *
9  **                                     Windows NT based targets, otherwise the default is for    *
10  **                                     ARM targets.                                              *
11  ******************************************************************************
12
13  ******************************************************************************
14  **                        Edit History                                       *
15  ** ------------------------------------------------------------------------- *
16  ** DATE           NAME             DESCRIPTION                               *
17  ** 10/22/2001     Jakle zhu     Create.                                      *
18  ******************************************************************************/
19 #ifndef SCI_TYPES_H
20 #define SCI_TYPES_H
21
22 /**---------------------------------------------------------------------------*
23  **                         Compiler Flag                                     *
24  **---------------------------------------------------------------------------*/
25 #ifdef __cplusplus
26     extern   "C"
27     {
28 #endif
29
30 #include "migrate.h"
31 /* ------------------------------------------------------------------------
32 ** Constants
33 ** ------------------------------------------------------------------------ */
34
35 #ifdef TRUE
36 #undef TRUE
37 #endif
38
39 #ifdef FALSE
40 #undef FALSE
41 #endif
42
43 #define TRUE   1   /* Boolean true value. */
44 #define FALSE  0   /* Boolean false value. */
45
46 #define SCI_TRUE                    TRUE       // Boolean true value
47 #define SCI_FALSE                   FALSE       // Boolean false value
48
49 #ifndef NULL
50   #define NULL  0
51 #endif
52
53 /* -----------------------------------------------------------------------
54 ** Standard Types
55 ** ----------------------------------------------------------------------- */
56 typedef unsigned char                   BOOLEAN;
57 typedef unsigned char                   uint8;
58 typedef unsigned short                  uint16;
59 typedef unsigned long int               uint32;
60 #ifndef _X_64
61 typedef unsigned __int64                uint64;
62 #else
63 typedef struct _X_UN_64_T {
64         uint32 hiDWORD;
65         uint32 loDWORD;
66 }X_UN_64_T;
67 typedef X_UN_64_T uint64;
68 typedef uint64 __uint64;
69 #endif
70
71 typedef signed char                             int8;
72 typedef signed short                    int16;
73 typedef signed long int                 int32;
74
75 #ifndef _X_64
76 typedef __int64                                 int64;
77 #else
78 typedef struct _X_64_T {
79         int32 hiDWORD;
80         int32 loDWORD;
81 }X_64_T;
82 typedef X_64_T int64;
83 typedef int64 __int64;
84 #endif
85
86
87 #ifdef WIN_UNIT_TEST
88 #define LOCAL
89 #define CONST
90 #else
91 #define LOCAL           static
92 #define CONST           const
93 #endif  //WIN_UNIT_TEST
94
95 #define VOLATILE        volatile
96
97
98 #define PNULL           0
99
100 //Added by Xueliang.Wang on 28/03/2002
101 #define PUBLIC 
102 //#define       PRIVATE         static
103 #define SCI_CALLBACK 
104
105 // @Xueliang.Wang moved it from os_api.h(2002-12-30)
106 // Thread block ID.
107 typedef uint32          BLOCK_ID;
108
109 /*
110         Bit define
111 */
112 #ifndef BIT_0
113 #define BIT_0               0x00000001
114 #define BIT_1               0x00000002
115 #define BIT_2               0x00000004
116 #define BIT_3               0x00000008
117 #define BIT_4               0x00000010
118 #define BIT_5               0x00000020
119 #define BIT_6               0x00000040
120 #define BIT_7               0x00000080
121 #define BIT_8               0x00000100
122 #define BIT_9               0x00000200
123 #define BIT_10              0x00000400
124 #define BIT_11              0x00000800
125 #define BIT_12              0x00001000
126 #define BIT_13              0x00002000
127 #define BIT_14              0x00004000
128 #define BIT_15              0x00008000
129 #define BIT_16              0x00010000
130 #define BIT_17              0x00020000
131 #define BIT_18              0x00040000
132 #define BIT_19              0x00080000
133 #define BIT_20              0x00100000
134 #define BIT_21              0x00200000
135 #define BIT_22              0x00400000
136 #define BIT_23              0x00800000
137 #define BIT_24              0x01000000
138 #define BIT_25              0x02000000
139 #define BIT_26              0x04000000
140 #define BIT_27              0x08000000
141 #define BIT_28              0x10000000
142 #define BIT_29              0x20000000
143 #define BIT_30              0x40000000 
144 #define BIT_31              0x80000000
145 #endif
146
147 #ifdef WIN32
148     #define PACK
149 #else
150     #define PACK __packed    /* Byte alignment for communication structures.*/
151 #endif
152           
153 /* some usefule marcos */
154 #define Bit(_i)              ((u32) 1<<(_i))
155
156 #define  MAX( _x, _y ) ( ((_x) > (_y)) ? (_x) : (_y) )
157
158 #define  MIN( _x, _y ) ( ((_x) < (_y)) ? (_x) : (_y) )
159 #define  WORD_LO(_xxx)  ((uint8) ((int16)(_xxx)))
160 #define  WORD_HI(_xxx)  ((uint8) ((int16)(_xxx) >> 8)) 
161
162 #define RND8( _x )       ((((_x) + 7) / 8 ) * 8 ) /*rounds a number up to the nearest multiple of 8 */
163
164
165 #define  UPCASE( _c ) ( ((_c) >= 'a' && (_c) <= 'z') ? ((_c) - 0x20) : (_c) )
166
167 #define  DECCHK( _c ) ((_c) >= '0' && (_c) <= '9')
168
169 #define  DTMFCHK( _c ) ( ((_c) >= '0' && (_c) <= '9') ||\
170                        ((_c) >= 'A' && (_c) <= 'D') ||\
171                        ((_c) >= 'a' && (_c) <= 'd') ||\
172                                            ((_c) == '*') ||\
173                                            ((_c) == '#'))
174
175 #define  HEXCHK( _c ) ( ((_c) >= '0' && (_c) <= '9') ||\
176                        ((_c) >= 'A' && (_c) <= 'F') ||\
177                        ((_c) >= 'a' && (_c) <= 'f') )
178
179 #define  ARR_SIZE( _a )  ( sizeof( (_a) ) / sizeof( (_a[0]) ) )
180
181 /*
182     @Lin.liu Added.(2002-11-19)
183 */
184 #define  BCD_EXT    uint8
185
186
187 /**---------------------------------------------------------------------------*
188  **                         Compiler Flag                                     *
189  **---------------------------------------------------------------------------*/
190 #ifdef __cplusplus
191     }
192 #endif
193
194 #endif  /* SCI_TYPES_H */
195