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