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 * SPDX-License-Identifier: BSD-3-Clause
20 * -- End of Copyright Notice --
30 #define __ixp42X /* sr: U-Boot needs this define */
31 #define IXP425_EXP_CFG_BASE 0xC4000000
32 #define diag_printf debug
34 #undef SIMSPARCSOLARIS
35 #define SIMSPARCSOLARIS 0xaffe /* sr: U-Boot gets confused with this solaris define */
38 * Include the OS-specific type definitions
40 #include "IxOsalOsTypes.h"
42 * @defgroup IxOsalTypes Osal basic data types.
44 * @brief Basic data types for Osal
52 * @note Possible OSAL return status include IX_SUCCESS and IX_FAIL.
54 typedef UINT32 IX_STATUS;
59 * @note volatile UINT32
61 typedef volatile UINT32 VUINT32;
66 * @note volatile INT32
68 typedef volatile INT32 VINT32;
71 * @ingroup IxOsalTypes
73 * @def IX_OSAL_BILLION
75 * @brief Alias for 1,000,000,000
78 #define IX_OSAL_BILLION (1000000000)
85 * @ingroup IxOsalTypes
89 * @brief Success status
93 #define IX_SUCCESS 0L /**< #defined as 0L */
97 * @ingroup IxOsalTypes
101 * @brief Failure status
105 #define IX_FAIL 1L /**< #defined as 1L */
110 #ifdef IX_PRIVATE_OFF
111 #define PRIVATE /* nothing */
113 #define PRIVATE static /**< #defined as static, except for debug builds */
114 #endif /* IX_PRIVATE_OFF */
119 * @ingroup IxOsalTypes
121 * @def IX_OSAL_INLINE
123 * @brief Alias for __inline
126 #ifndef IX_OSAL_INLINE
127 #define IX_OSAL_INLINE __inline
128 #endif /* IX_OSAL_INLINE */
132 #define __inline__ IX_OSAL_INLINE
136 /* Each OS can define its own PUBLIC, otherwise it will be empty. */
143 * @ingroup IxOsalTypes
145 * @def IX_OSAL_INLINE_EXTERN
147 * @brief Alias for __inline extern
150 #ifndef IX_OSAL_INLINE_EXTERN
151 #define IX_OSAL_INLINE_EXTERN IX_OSAL_INLINE extern
155 * @ingroup IxOsalTypes
156 * @enum IxOsalLogDevice
157 * @brief This is an emum for OSAL log devices.
161 IX_OSAL_LOG_DEV_STDOUT = 0, /**< standard output (implemented by default) */
162 IX_OSAL_LOG_DEV_STDERR = 1, /**< standard error (implemented */
163 IX_OSAL_LOG_DEV_HEX_DISPLAY = 2, /**< hexadecimal display (not implemented) */
164 IX_OSAL_LOG_DEV_ASCII_DISPLAY = 3 /**< ASCII-capable display (not implemented) */
169 * @ingroup IxOsalTypes
171 * @def IX_OSAL_LOG_ERROR
173 * @brief Alias for -1, used as log function error status
176 #define IX_OSAL_LOG_ERROR (-1)
179 * @ingroup IxOsalTypes
180 * @enum IxOsalLogLevel
181 * @brief This is an emum for OSAL log trace level.
185 IX_OSAL_LOG_LVL_NONE = 0, /**<No trace level */
186 IX_OSAL_LOG_LVL_USER = 1, /**<Set trace level to user */
187 IX_OSAL_LOG_LVL_FATAL = 2, /**<Set trace level to fatal */
188 IX_OSAL_LOG_LVL_ERROR = 3, /**<Set trace level to error */
189 IX_OSAL_LOG_LVL_WARNING = 4, /**<Set trace level to warning */
190 IX_OSAL_LOG_LVL_MESSAGE = 5, /**<Set trace level to message */
191 IX_OSAL_LOG_LVL_DEBUG1 = 6, /**<Set trace level to debug1 */
192 IX_OSAL_LOG_LVL_DEBUG2 = 7, /**<Set trace level to debug2 */
193 IX_OSAL_LOG_LVL_DEBUG3 = 8, /**<Set trace level to debug3 */
194 IX_OSAL_LOG_LVL_ALL /**<Set trace level to all */
199 * @ingroup IxOsalTypes
200 * @brief Void function pointer prototype
202 * @note accepts a void pointer parameter
203 * and does not return a value.
205 typedef void (*IxOsalVoidFnVoidPtr) (void *);
207 typedef void (*IxOsalVoidFnPtr) (void);
211 * @brief Timeval structure
213 * @note Contain subfields of seconds and nanoseconds..
217 UINT32 secs; /**< seconds */
218 UINT32 nsecs; /**< nanoseconds */
223 * @ingroup IxOsalTypes
226 * @note OSAL timer handle
229 typedef UINT32 IxOsalTimer;
233 * @ingroup IxOsalTypes
235 * @def IX_OSAL_WAIT_FOREVER
237 * @brief Definition for timeout forever, OS-specific.
240 #define IX_OSAL_WAIT_FOREVER IX_OSAL_OS_WAIT_FOREVER
243 * @ingroup IxOsalTypes
245 * @def IX_OSAL_WAIT_NONE
247 * @brief Definition for timeout 0, OS-specific.
250 #define IX_OSAL_WAIT_NONE IX_OSAL_OS_WAIT_NONE
254 * @ingroup IxOsalTypes
257 * @note Mutex handle, OS-specific
260 typedef IxOsalOsMutex IxOsalMutex;
263 * @ingroup IxOsalTypes
264 * @brief IxOsalFastMutex
266 * @note FastMutex handle, OS-specific
269 typedef IxOsalOsFastMutex IxOsalFastMutex;
272 * @ingroup IxOsalTypes
273 * @brief IxOsalThread
275 * @note Thread handle, OS-specific
278 typedef IxOsalOsThread IxOsalThread;
281 * @ingroup IxOsalTypes
282 * @brief IxOsalSemaphore
284 * @note Semaphore handle, OS-specific
287 typedef IxOsalOsSemaphore IxOsalSemaphore;
290 * @ingroup IxOsalTypes
291 * @brief IxOsalMessageQueue
293 * @note Message Queue handle, OS-specific
296 typedef IxOsalOsMessageQueue IxOsalMessageQueue;
300 * @brief Thread Attribute
301 * @note Default thread attribute
305 char *name; /**< name */
306 UINT32 stackSize; /**< stack size */
307 UINT32 priority; /**< priority */
311 * @ingroup IxOsalTypes
313 * @def IX_OSAL_THREAD_DEFAULT_STACK_SIZE
315 * @brief Default thread stack size, OS-specific.
318 #define IX_OSAL_THREAD_DEFAULT_STACK_SIZE (IX_OSAL_OS_THREAD_DEFAULT_STACK_SIZE)
321 * @ingroup IxOsalTypes
323 * @def IX_OSAL_THREAD_MAX_STACK_SIZE
325 * @brief Max stack size, OS-specific.
328 #define IX_OSAL_THREAD_MAX_STACK_SIZE (IX_OSAL_OS_THREAD_MAX_STACK_SIZE)
331 * @ingroup IxOsalTypes
333 * @def IX_OSAL_DEFAULT_THREAD_PRIORITY
335 * @brief Default thread priority, OS-specific.
338 #define IX_OSAL_DEFAULT_THREAD_PRIORITY (IX_OSAL_OS_DEFAULT_THREAD_PRIORITY)
341 * @ingroup IxOsalTypes
343 * @def IX_OSAL_MAX_THREAD_PRIORITY
345 * @brief Max thread priority, OS-specific.
348 #define IX_OSAL_MAX_THREAD_PRIORITY (IX_OSAL_OS_MAX_THREAD_PRIORITY)
355 #endif /* IxOsalTypes_H */