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;
95 * @ingroup IxOsalTypes
97 * @def IX_OSAL_BILLION
99 * @brief Alias for 1,000,000,000
102 #define IX_OSAL_BILLION (1000000000)
109 * @ingroup IxOsalTypes
113 * @brief Success status
117 #define IX_SUCCESS 0L /**< #defined as 0L */
121 * @ingroup IxOsalTypes
125 * @brief Failure status
129 #define IX_FAIL 1L /**< #defined as 1L */
134 #ifdef IX_PRIVATE_OFF
135 #define PRIVATE /* nothing */
137 #define PRIVATE static /**< #defined as static, except for debug builds */
138 #endif /* IX_PRIVATE_OFF */
143 * @ingroup IxOsalTypes
145 * @def IX_OSAL_INLINE
147 * @brief Alias for __inline
150 #ifndef IX_OSAL_INLINE
151 #define IX_OSAL_INLINE __inline
152 #endif /* IX_OSAL_INLINE */
156 #define __inline__ IX_OSAL_INLINE
160 /* Each OS can define its own PUBLIC, otherwise it will be empty. */
167 * @ingroup IxOsalTypes
169 * @def IX_OSAL_INLINE_EXTERN
171 * @brief Alias for __inline extern
174 #ifndef IX_OSAL_INLINE_EXTERN
175 #define IX_OSAL_INLINE_EXTERN IX_OSAL_INLINE extern
179 * @ingroup IxOsalTypes
180 * @enum IxOsalLogDevice
181 * @brief This is an emum for OSAL log devices.
185 IX_OSAL_LOG_DEV_STDOUT = 0, /**< standard output (implemented by default) */
186 IX_OSAL_LOG_DEV_STDERR = 1, /**< standard error (implemented */
187 IX_OSAL_LOG_DEV_HEX_DISPLAY = 2, /**< hexadecimal display (not implemented) */
188 IX_OSAL_LOG_DEV_ASCII_DISPLAY = 3 /**< ASCII-capable display (not implemented) */
193 * @ingroup IxOsalTypes
195 * @def IX_OSAL_LOG_ERROR
197 * @brief Alias for -1, used as log function error status
200 #define IX_OSAL_LOG_ERROR (-1)
203 * @ingroup IxOsalTypes
204 * @enum IxOsalLogLevel
205 * @brief This is an emum for OSAL log trace level.
209 IX_OSAL_LOG_LVL_NONE = 0, /**<No trace level */
210 IX_OSAL_LOG_LVL_USER = 1, /**<Set trace level to user */
211 IX_OSAL_LOG_LVL_FATAL = 2, /**<Set trace level to fatal */
212 IX_OSAL_LOG_LVL_ERROR = 3, /**<Set trace level to error */
213 IX_OSAL_LOG_LVL_WARNING = 4, /**<Set trace level to warning */
214 IX_OSAL_LOG_LVL_MESSAGE = 5, /**<Set trace level to message */
215 IX_OSAL_LOG_LVL_DEBUG1 = 6, /**<Set trace level to debug1 */
216 IX_OSAL_LOG_LVL_DEBUG2 = 7, /**<Set trace level to debug2 */
217 IX_OSAL_LOG_LVL_DEBUG3 = 8, /**<Set trace level to debug3 */
218 IX_OSAL_LOG_LVL_ALL /**<Set trace level to all */
223 * @ingroup IxOsalTypes
224 * @brief Void function pointer prototype
226 * @note accepts a void pointer parameter
227 * and does not return a value.
229 typedef void (*IxOsalVoidFnVoidPtr) (void *);
231 typedef void (*IxOsalVoidFnPtr) (void);
235 * @brief Timeval structure
237 * @note Contain subfields of seconds and nanoseconds..
241 UINT32 secs; /**< seconds */
242 UINT32 nsecs; /**< nanoseconds */
247 * @ingroup IxOsalTypes
250 * @note OSAL timer handle
253 typedef UINT32 IxOsalTimer;
257 * @ingroup IxOsalTypes
259 * @def IX_OSAL_WAIT_FOREVER
261 * @brief Definition for timeout forever, OS-specific.
264 #define IX_OSAL_WAIT_FOREVER IX_OSAL_OS_WAIT_FOREVER
267 * @ingroup IxOsalTypes
269 * @def IX_OSAL_WAIT_NONE
271 * @brief Definition for timeout 0, OS-specific.
274 #define IX_OSAL_WAIT_NONE IX_OSAL_OS_WAIT_NONE
278 * @ingroup IxOsalTypes
281 * @note Mutex handle, OS-specific
284 typedef IxOsalOsMutex IxOsalMutex;
287 * @ingroup IxOsalTypes
288 * @brief IxOsalFastMutex
290 * @note FastMutex handle, OS-specific
293 typedef IxOsalOsFastMutex IxOsalFastMutex;
296 * @ingroup IxOsalTypes
297 * @brief IxOsalThread
299 * @note Thread handle, OS-specific
302 typedef IxOsalOsThread IxOsalThread;
305 * @ingroup IxOsalTypes
306 * @brief IxOsalSemaphore
308 * @note Semaphore handle, OS-specific
311 typedef IxOsalOsSemaphore IxOsalSemaphore;
314 * @ingroup IxOsalTypes
315 * @brief IxOsalMessageQueue
317 * @note Message Queue handle, OS-specific
320 typedef IxOsalOsMessageQueue IxOsalMessageQueue;
324 * @brief Thread Attribute
325 * @note Default thread attribute
329 char *name; /**< name */
330 UINT32 stackSize; /**< stack size */
331 UINT32 priority; /**< priority */
335 * @ingroup IxOsalTypes
337 * @def IX_OSAL_THREAD_DEFAULT_STACK_SIZE
339 * @brief Default thread stack size, OS-specific.
342 #define IX_OSAL_THREAD_DEFAULT_STACK_SIZE (IX_OSAL_OS_THREAD_DEFAULT_STACK_SIZE)
345 * @ingroup IxOsalTypes
347 * @def IX_OSAL_THREAD_MAX_STACK_SIZE
349 * @brief Max stack size, OS-specific.
352 #define IX_OSAL_THREAD_MAX_STACK_SIZE (IX_OSAL_OS_THREAD_MAX_STACK_SIZE)
355 * @ingroup IxOsalTypes
357 * @def IX_OSAL_DEFAULT_THREAD_PRIORITY
359 * @brief Default thread priority, OS-specific.
362 #define IX_OSAL_DEFAULT_THREAD_PRIORITY (IX_OSAL_OS_DEFAULT_THREAD_PRIORITY)
365 * @ingroup IxOsalTypes
367 * @def IX_OSAL_MAX_THREAD_PRIORITY
369 * @brief Max thread priority, OS-specific.
372 #define IX_OSAL_MAX_THREAD_PRIORITY (IX_OSAL_OS_MAX_THREAD_PRIORITY)
379 #endif /* IxOsalTypes_H */