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 
57                       EDIT HISTORY FOR FILE
58 
59 This section contains comments describing changes made to this file.
60 Notice that changes are listed in reverse chronological order.
61 
62 $Header: /prj/iceng/SCALe/repository/cvs/scale/source/data/com_dtypes.h,v 1.1.1.1 2012/09/19 22:33:30 rjindal Exp $
63 
64 when       who     what, where, why
65 --------   ---     ----------------------------------------------------------
66 03/21/11   llg     (Tech Pubs) Edited/added Doxygen comments and markup.
67 11/09/10   EBR     Doxygenated file.
68 09/15/09   pc      Created file.
69 ===========================================================================*/
70 
71 
72 /*===========================================================================
73 
74                             Data Declarations
75 
76 ===========================================================================*/
77 
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81 
82 /* For NT apps we want to use the Win32 definitions and/or those
83  supplied by the Win32 compiler for things like NULL, MAX, MIN
84  abs, labs, etc.
85 */
86 #ifdef T_WINNT
87    #ifndef WIN32
88       #define WIN32
89    #endif
90    #include <stdlib.h>
91 #endif
92 
93 /* ------------------------------------------------------------------------
94 ** Constants
95 ** ------------------------------------------------------------------------ */
96 
97 #ifdef TRUE
98 #undef TRUE
99 #endif
100 
101 #ifdef FALSE
102 #undef FALSE
103 #endif
104 
105 /** @addtogroup utils_services
106 @{ */
107 
108 /** @name Macros for Common Data Types
109 @{ */
110 #define TRUE   1   /**< Boolean TRUE value. */
111 #define FALSE  0   /**< Boolean FALSE value. */
112 
113 #define  ON   1    /**< ON value. */
114 #define  OFF  0    /**< OFF value. */
115 
116 #ifndef NULL
117   #define NULL  0  /**< NULL value. */
118 #endif
119 /** @} */ /* end_name_group Macros for Common Data Types */
120 
121 /* -----------------------------------------------------------------------
122 ** Standard Types
123 ** ----------------------------------------------------------------------- */
124 
125 /** @} */ /* end_addtogroup utils_services */
126 
127 /* The following definitions are the same across platforms.  This first
128  group are the sanctioned types.
129 */
130 #ifndef _ARM_ASM_
131 #ifndef _BOOLEAN_DEFINED
132 
133 /** @addtogroup utils_services
134 @{ */
135 /** Boolean value type.
136 */
137 typedef  unsigned char      boolean;
138 #define _BOOLEAN_DEFINED
139 #endif
140 
141 /** @cond
142 */
143 #if defined(DALSTDDEF_H) /* guards against a known re-definer */
144 #define _BOOLEAN_DEFINED
145 #define _UINT32_DEFINED
146 #define _UINT16_DEFINED
147 #define _UINT8_DEFINED
148 #define _INT32_DEFINED
149 #define _INT16_DEFINED
150 #define _INT8_DEFINED
151 #define _UINT64_DEFINED
152 #define _INT64_DEFINED
153 #define _BYTE_DEFINED
154 #endif /* #if !defined(DALSTDDEF_H) */
155 /** @endcond */
156 
157 #ifndef _UINT32_DEFINED
158 /** Unsigned 32-bit value.
159 */
160 typedef  unsigned long int  uint32;
161 #define _UINT32_DEFINED
162 #endif
163 
164 #ifndef _UINT16_DEFINED
165 /** Unsigned 16-bit value.
166 */
167 typedef  unsigned short     uint16;
168 #define _UINT16_DEFINED
169 #endif
170 
171 #ifndef _UINT8_DEFINED
172 /** Unsigned 8-bit value.
173 */
174 typedef  unsigned char      uint8;
175 #define _UINT8_DEFINED
176 #endif
177 
178 #ifndef _INT32_DEFINED
179 /** Signed 32-bit value.
180 */
181 typedef  signed long int    int32;
182 #define _INT32_DEFINED
183 #endif
184 
185 #ifndef _INT16_DEFINED
186 /** Signed 16-bit value.
187 */
188 typedef  signed short       int16;
189 #define _INT16_DEFINED
190 #endif
191 
192 #ifndef _INT8_DEFINED
193 /** Signed 8-bit value.
194 */
195 typedef  signed char        int8;
196 #define _INT8_DEFINED
197 #endif
198 
199 /** @cond
200 */
201 /* This group are the deprecated types.  Their use should be
202 ** discontinued and new code should use the types above
203 */
204 #ifndef _BYTE_DEFINED
205 /** DEPRECATED: Unsigned 8  bit value type.
206 */
207 typedef  unsigned char      byte;
208 #define  _BYTE_DEFINED
209 #endif
210 
211 /** DEPRECATED: Unsinged 16 bit value type.
212 */
213 typedef  unsigned short     word;
214 /** DEPRECATED: Unsigned 32 bit value type.
215 */
216 typedef  unsigned long      dword;
217 
218 /** DEPRECATED: Unsigned 8  bit value type.
219 */
220 typedef  unsigned char      uint1;
221 /** DEPRECATED: Unsigned 16 bit value type.
222 */
223 typedef  unsigned short     uint2;
224 /** DEPRECATED: Unsigned 32 bit value type.
225 */
226 typedef  unsigned long      uint4;
227 
228 /** DEPRECATED: Signed 8  bit value type.
229 */
230 typedef  signed char        int1;
231 /** DEPRECATED: Signed 16 bit value type.
232 */
233 typedef  signed short       int2;
234 /** DEPRECATED: Signed 32 bit value type.
235 */
236 typedef  long int           int4;
237 
238 /** DEPRECATED: Signed 32 bit value.
239 */
240 typedef  signed long        sint31;
241 /** DEPRECATED: Signed 16 bit value.
242 */
243 typedef  signed short       sint15;
244 /** DEPRECATED: Signed 8  bit value.
245 */
246 typedef  signed char        sint7;
247 
248 typedef uint16 UWord16 ;
249 typedef uint32 UWord32 ;
250 typedef int32  Word32 ;
251 typedef int16  Word16 ;
252 typedef uint8  UWord8 ;
253 typedef int8   Word8 ;
254 typedef int32  Vect32 ;
255 /** @endcond */
256 
257 #if (! defined T_WINNT) && (! defined __GNUC__)
258   /* Non WinNT Targets */
259   #ifndef _INT64_DEFINED
260     /** Signed 64-bit value.
261 	*/
262     typedef long long     int64;
263     #define _INT64_DEFINED
264   #endif
265   #ifndef _UINT64_DEFINED
266     /** Unsigned 64-bit value.
267 	*/
268     typedef  unsigned long long  uint64;
269     #define _UINT64_DEFINED
270   #endif
271 #else /* T_WINNT || TARGET_OS_SOLARIS || __GNUC__ */
272   /* WINNT or SOLARIS based targets */
273   #if (defined __GNUC__)
274     #ifndef _INT64_DEFINED
275       typedef long long           int64;
276       #define _INT64_DEFINED
277     #endif
278     #ifndef _UINT64_DEFINED
279       typedef unsigned long long  uint64;
280       #define _UINT64_DEFINED
281     #endif
282   #else
283     typedef  __int64              int64;       /* Signed 64-bit value */
284     #ifndef _UINT64_DEFINED
285       typedef  unsigned __int64   uint64;      /* Unsigned 64-bit value */
286       #define _UINT64_DEFINED
287     #endif
288   #endif
289 #endif /* T_WINNT */
290 
291 #endif /* _ARM_ASM_ */
292 
293 #ifdef __cplusplus
294 }
295 #endif
296 
297 /** @} */ /* end_addtogroup utils_services */
298 #endif  /* COM_DTYPES_H */
299