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