1 /*
2  * Copyright (c) 2020, The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #ifndef COM_DTYPES_H
18 #define COM_DTYPES_H
19 
20 /**
21   @file com_dtypes.h
22   @brief This header file contains general data types that are of use to all
23   modules.
24 
25 */
26 /*===========================================================================
27 NOTE: The @brief description and any detailed descriptions above do not appear
28       in the PDF.
29 
30       The Utility_Services_API_mainpage.dox file contains all file/group
31       descriptions that are in the output PDF generated using Doxygen and
32       Latex. To edit or update any of the file/group text in the PDF, edit
33       the Utility_Services_API_mainpage.dox file or contact Tech Pubs.
34 
35       The above description for this file is part of the "utils_services"
36 	  group description in the Utility_Services_API_mainpage.dox file.
37 ===========================================================================*/
38 /*===========================================================================
39 
40                    S T A N D A R D    D E C L A R A T I O N S
41 
42 DESCRIPTION
43   This header file contains general data types that are of use to all modules.
44   The values or definitions are dependent on the specified
45   target.  T_WINNT specifies Windows NT based targets, otherwise the
46   default is for ARM targets.
47 
48   T_WINNT  Software is hosted on an NT platforn, triggers macro and
49            type definitions, unlike definition above which triggers
50            actual OS calls
51 ===========================================================================*/
52 
53 
54 /*===========================================================================
55 
56                       EDIT HISTORY FOR FILE
57 
58 This section contains comments describing changes made to this file.
59 Notice that changes are listed in reverse chronological order.
60 
61 $Header: //depot/prj/qca/lithium3/wcss/spruce_verif/native/register/include/com_dtypes.h#1 $
62 
63 when       who     what, where, why
64 --------   ---     ----------------------------------------------------------
65 03/21/11   llg     (Tech Pubs) Edited/added Doxygen comments and markup.
66 11/09/10   EBR     Doxygenated file.
67 09/15/09   pc      Created file.
68 ===========================================================================*/
69 
70 
71 /*===========================================================================
72 
73                             Data Declarations
74 
75 ===========================================================================*/
76 
77 #ifdef __cplusplus
78 extern "C" {
79 #endif
80 
81 /* For NT apps we want to use the Win32 definitions and/or those
82  supplied by the Win32 compiler for things like NULL, MAX, MIN
83  abs, labs, etc.
84 */
85 #ifdef T_WINNT
86    #ifndef WIN32
87       #define WIN32
88    #endif
89    #include <stdlib.h>
90 #endif
91 
92 /* ------------------------------------------------------------------------
93 ** Constants
94 ** ------------------------------------------------------------------------ */
95 
96 #ifdef TRUE
97 #undef TRUE
98 #endif
99 
100 #ifdef FALSE
101 #undef FALSE
102 #endif
103 
104 /** @addtogroup utils_services
105 @{ */
106 
107 /** @name Macros for Common Data Types
108 @{ */
109 #define TRUE   1   /**< Boolean TRUE value. */
110 #define FALSE  0   /**< Boolean FALSE value. */
111 
112 #define  ON   1    /**< ON value. */
113 #define  OFF  0    /**< OFF value. */
114 
115 #ifndef NULL
116   #define NULL  0  /**< NULL value. */
117 #endif
118 /** @} */ /* end_name_group Macros for Common Data Types */
119 
120 /* -----------------------------------------------------------------------
121 ** Standard Types
122 ** ----------------------------------------------------------------------- */
123 
124 /** @} */ /* end_addtogroup utils_services */
125 
126 /* The following definitions are the same across platforms.  This first
127  group are the sanctioned types.
128 */
129 #ifndef _ARM_ASM_
130 #ifndef _BOOLEAN_DEFINED
131 
132 /** @addtogroup utils_services
133 @{ */
134 /** Boolean value type.
135 */
136 typedef  unsigned char      boolean;
137 #define _BOOLEAN_DEFINED
138 #endif
139 
140 /** @cond
141 */
142 #if defined(DALSTDDEF_H) /* guards against a known re-definer */
143 #define _BOOLEAN_DEFINED
144 #define _UINT32_DEFINED
145 #define _UINT16_DEFINED
146 #define _UINT8_DEFINED
147 #define _INT32_DEFINED
148 #define _INT16_DEFINED
149 #define _INT8_DEFINED
150 #define _UINT64_DEFINED
151 #define _INT64_DEFINED
152 #define _BYTE_DEFINED
153 #endif /* #if !defined(DALSTDDEF_H) */
154 /** @endcond */
155 
156 #ifndef _UINT32_DEFINED
157 /** Unsigned 32-bit value.
158 */
159 typedef  unsigned long int  uint32;
160 #define _UINT32_DEFINED
161 #endif
162 
163 #ifndef _UINT16_DEFINED
164 /** Unsigned 16-bit value.
165 */
166 typedef  unsigned short     uint16;
167 #define _UINT16_DEFINED
168 #endif
169 
170 #ifndef _UINT8_DEFINED
171 /** Unsigned 8-bit value.
172 */
173 typedef  unsigned char      uint8;
174 #define _UINT8_DEFINED
175 #endif
176 
177 #ifndef _INT32_DEFINED
178 /** Signed 32-bit value.
179 */
180 typedef  signed long int    int32;
181 #define _INT32_DEFINED
182 #endif
183 
184 #ifndef _INT16_DEFINED
185 /** Signed 16-bit value.
186 */
187 typedef  signed short       int16;
188 #define _INT16_DEFINED
189 #endif
190 
191 #ifndef _INT8_DEFINED
192 /** Signed 8-bit value.
193 */
194 typedef  signed char        int8;
195 #define _INT8_DEFINED
196 #endif
197 
198 /** @cond
199 */
200 /* This group are the deprecated types.  Their use should be
201 ** discontinued and new code should use the types above
202 */
203 #ifndef _BYTE_DEFINED
204 /** DEPRECATED: Unsigned 8  bit value type.
205 */
206 typedef  unsigned char      byte;
207 #define  _BYTE_DEFINED
208 #endif
209 
210 /** DEPRECATED: Unsinged 16 bit value type.
211 */
212 typedef  unsigned short     word;
213 /** DEPRECATED: Unsigned 32 bit value type.
214 */
215 typedef  unsigned long      dword;
216 
217 /** DEPRECATED: Unsigned 8  bit value type.
218 */
219 typedef  unsigned char      uint1;
220 /** DEPRECATED: Unsigned 16 bit value type.
221 */
222 typedef  unsigned short     uint2;
223 /** DEPRECATED: Unsigned 32 bit value type.
224 */
225 typedef  unsigned long      uint4;
226 
227 /** DEPRECATED: Signed 8  bit value type.
228 */
229 typedef  signed char        int1;
230 /** DEPRECATED: Signed 16 bit value type.
231 */
232 typedef  signed short       int2;
233 /** DEPRECATED: Signed 32 bit value type.
234 */
235 typedef  long int           int4;
236 
237 /** DEPRECATED: Signed 32 bit value.
238 */
239 typedef  signed long        sint31;
240 /** DEPRECATED: Signed 16 bit value.
241 */
242 typedef  signed short       sint15;
243 /** DEPRECATED: Signed 8  bit value.
244 */
245 typedef  signed char        sint7;
246 
247 typedef uint16 UWord16 ;
248 typedef uint32 UWord32 ;
249 typedef int32  Word32 ;
250 typedef int16  Word16 ;
251 typedef uint8  UWord8 ;
252 typedef int8   Word8 ;
253 typedef int32  Vect32 ;
254 /** @endcond */
255 
256 #if (! defined T_WINNT) && (! defined __GNUC__)
257   /* Non WinNT Targets */
258   #ifndef _INT64_DEFINED
259     /** Signed 64-bit value.
260 	*/
261     typedef long long     int64;
262     #define _INT64_DEFINED
263   #endif
264   #ifndef _UINT64_DEFINED
265     /** Unsigned 64-bit value.
266 	*/
267     typedef  unsigned long long  uint64;
268     #define _UINT64_DEFINED
269   #endif
270 #else /* T_WINNT || TARGET_OS_SOLARIS || __GNUC__ */
271   /* WINNT or SOLARIS based targets */
272   #if (defined __GNUC__)
273     #ifndef _INT64_DEFINED
274       typedef long long           int64;
275       #define _INT64_DEFINED
276     #endif
277     #ifndef _UINT64_DEFINED
278       typedef unsigned long long  uint64;
279       #define _UINT64_DEFINED
280     #endif
281   #else
282     typedef  __int64              int64;       /* Signed 64-bit value */
283     #ifndef _UINT64_DEFINED
284       typedef  unsigned __int64   uint64;      /* Unsigned 64-bit value */
285       #define _UINT64_DEFINED
286     #endif
287   #endif
288 #endif /* T_WINNT */
289 
290 #endif /* _ARM_ASM_ */
291 
292 #ifdef __cplusplus
293 }
294 #endif
295 
296 /** @} */ /* end_addtogroup utils_services */
297 #endif  /* COM_DTYPES_H */
298