4 * @brief Define OSAL basic data types.
6 * This file contains fundamental data types used by OSAL.
9 * IXP400 SW Release version 2.0
11 * -- Copyright Notice --
14 * Copyright 2001-2005, Intel Corporation.
15 * All rights reserved.
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 * 3. Neither the name of the Intel Corporation nor the names of its contributors
27 * may be used to endorse or promote products derived from this software
28 * without specific prior written permission.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
32 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
35 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
40 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44 * -- End of Copyright Notice --
54 #define __ixp42X /* sr: U-Boot needs this define */
55 #define IXP425_EXP_CFG_BASE 0xC4000000
56 #define diag_printf debug
58 #undef SIMSPARCSOLARIS
59 #define SIMSPARCSOLARIS 0xaffe /* sr: U-Boot gets confused with this solaris define */
62 * Include the OS-specific type definitions
64 #include "IxOsalOsTypes.h"
66 * @defgroup IxOsalTypes Osal basic data types.
68 * @brief Basic data types for Osal
76 * @note Possible OSAL return status include IX_SUCCESS and IX_FAIL.
78 typedef UINT32 IX_STATUS;
83 * @note volatile UINT32
85 typedef volatile UINT32 VUINT32;
90 * @note volatile INT32
92 typedef volatile INT32 VINT32;
96 #define NUMELEMS(x) (sizeof(x) / sizeof((x)[0]))
101 * @ingroup IxOsalTypes
103 * @def IX_OSAL_BILLION
105 * @brief Alias for 1,000,000,000
108 #define IX_OSAL_BILLION (1000000000)
115 #error TRUE is not defined to 1
123 #error FALSE is not defined to 0
131 * @ingroup IxOsalTypes
135 * @brief Success status
139 #define IX_SUCCESS 0L /**< #defined as 0L */
143 * @ingroup IxOsalTypes
147 * @brief Failure status
151 #define IX_FAIL 1L /**< #defined as 1L */
156 #ifdef IX_PRIVATE_OFF
157 #define PRIVATE /* nothing */
159 #define PRIVATE static /**< #defined as static, except for debug builds */
160 #endif /* IX_PRIVATE_OFF */
165 * @ingroup IxOsalTypes
167 * @def IX_OSAL_INLINE
169 * @brief Alias for __inline
172 #ifndef IX_OSAL_INLINE
173 #define IX_OSAL_INLINE __inline
174 #endif /* IX_OSAL_INLINE */
178 #define __inline__ IX_OSAL_INLINE
182 /* Each OS can define its own PUBLIC, otherwise it will be empty. */
189 * @ingroup IxOsalTypes
191 * @def IX_OSAL_INLINE_EXTERN
193 * @brief Alias for __inline extern
196 #ifndef IX_OSAL_INLINE_EXTERN
197 #define IX_OSAL_INLINE_EXTERN IX_OSAL_INLINE extern
201 * @ingroup IxOsalTypes
202 * @enum IxOsalLogDevice
203 * @brief This is an emum for OSAL log devices.
207 IX_OSAL_LOG_DEV_STDOUT = 0, /**< standard output (implemented by default) */
208 IX_OSAL_LOG_DEV_STDERR = 1, /**< standard error (implemented */
209 IX_OSAL_LOG_DEV_HEX_DISPLAY = 2, /**< hexadecimal display (not implemented) */
210 IX_OSAL_LOG_DEV_ASCII_DISPLAY = 3 /**< ASCII-capable display (not implemented) */
215 * @ingroup IxOsalTypes
217 * @def IX_OSAL_LOG_ERROR
219 * @brief Alias for -1, used as log function error status
222 #define IX_OSAL_LOG_ERROR (-1)
225 * @ingroup IxOsalTypes
226 * @enum IxOsalLogLevel
227 * @brief This is an emum for OSAL log trace level.
231 IX_OSAL_LOG_LVL_NONE = 0, /**<No trace level */
232 IX_OSAL_LOG_LVL_USER = 1, /**<Set trace level to user */
233 IX_OSAL_LOG_LVL_FATAL = 2, /**<Set trace level to fatal */
234 IX_OSAL_LOG_LVL_ERROR = 3, /**<Set trace level to error */
235 IX_OSAL_LOG_LVL_WARNING = 4, /**<Set trace level to warning */
236 IX_OSAL_LOG_LVL_MESSAGE = 5, /**<Set trace level to message */
237 IX_OSAL_LOG_LVL_DEBUG1 = 6, /**<Set trace level to debug1 */
238 IX_OSAL_LOG_LVL_DEBUG2 = 7, /**<Set trace level to debug2 */
239 IX_OSAL_LOG_LVL_DEBUG3 = 8, /**<Set trace level to debug3 */
240 IX_OSAL_LOG_LVL_ALL /**<Set trace level to all */
245 * @ingroup IxOsalTypes
246 * @brief Void function pointer prototype
248 * @note accepts a void pointer parameter
249 * and does not return a value.
251 typedef void (*IxOsalVoidFnVoidPtr) (void *);
253 typedef void (*IxOsalVoidFnPtr) (void);
257 * @brief Timeval structure
259 * @note Contain subfields of seconds and nanoseconds..
263 UINT32 secs; /**< seconds */
264 UINT32 nsecs; /**< nanoseconds */
269 * @ingroup IxOsalTypes
272 * @note OSAL timer handle
275 typedef UINT32 IxOsalTimer;
279 * @ingroup IxOsalTypes
281 * @def IX_OSAL_WAIT_FOREVER
283 * @brief Definition for timeout forever, OS-specific.
286 #define IX_OSAL_WAIT_FOREVER IX_OSAL_OS_WAIT_FOREVER
289 * @ingroup IxOsalTypes
291 * @def IX_OSAL_WAIT_NONE
293 * @brief Definition for timeout 0, OS-specific.
296 #define IX_OSAL_WAIT_NONE IX_OSAL_OS_WAIT_NONE
300 * @ingroup IxOsalTypes
303 * @note Mutex handle, OS-specific
306 typedef IxOsalOsMutex IxOsalMutex;
309 * @ingroup IxOsalTypes
310 * @brief IxOsalFastMutex
312 * @note FastMutex handle, OS-specific
315 typedef IxOsalOsFastMutex IxOsalFastMutex;
318 * @ingroup IxOsalTypes
319 * @brief IxOsalThread
321 * @note Thread handle, OS-specific
324 typedef IxOsalOsThread IxOsalThread;
327 * @ingroup IxOsalTypes
328 * @brief IxOsalSemaphore
330 * @note Semaphore handle, OS-specific
333 typedef IxOsalOsSemaphore IxOsalSemaphore;
336 * @ingroup IxOsalTypes
337 * @brief IxOsalMessageQueue
339 * @note Message Queue handle, OS-specific
342 typedef IxOsalOsMessageQueue IxOsalMessageQueue;
346 * @brief Thread Attribute
347 * @note Default thread attribute
351 char *name; /**< name */
352 UINT32 stackSize; /**< stack size */
353 UINT32 priority; /**< priority */
357 * @ingroup IxOsalTypes
359 * @def IX_OSAL_THREAD_DEFAULT_STACK_SIZE
361 * @brief Default thread stack size, OS-specific.
364 #define IX_OSAL_THREAD_DEFAULT_STACK_SIZE (IX_OSAL_OS_THREAD_DEFAULT_STACK_SIZE)
367 * @ingroup IxOsalTypes
369 * @def IX_OSAL_THREAD_MAX_STACK_SIZE
371 * @brief Max stack size, OS-specific.
374 #define IX_OSAL_THREAD_MAX_STACK_SIZE (IX_OSAL_OS_THREAD_MAX_STACK_SIZE)
377 * @ingroup IxOsalTypes
379 * @def IX_OSAL_DEFAULT_THREAD_PRIORITY
381 * @brief Default thread priority, OS-specific.
384 #define IX_OSAL_DEFAULT_THREAD_PRIORITY (IX_OSAL_OS_DEFAULT_THREAD_PRIORITY)
387 * @ingroup IxOsalTypes
389 * @def IX_OSAL_MAX_THREAD_PRIORITY
391 * @brief Max thread priority, OS-specific.
394 #define IX_OSAL_MAX_THREAD_PRIORITY (IX_OSAL_OS_MAX_THREAD_PRIORITY)
401 #endif /* IxOsalTypes_H */