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 * @ingroup IxOsalTypes
119 * @brief Success status
123 #define IX_SUCCESS 0L /**< #defined as 0L */
127 * @ingroup IxOsalTypes
131 * @brief Failure status
135 #define IX_FAIL 1L /**< #defined as 1L */
140 #ifdef IX_PRIVATE_OFF
141 #define PRIVATE /* nothing */
143 #define PRIVATE static /**< #defined as static, except for debug builds */
144 #endif /* IX_PRIVATE_OFF */
149 * @ingroup IxOsalTypes
151 * @def IX_OSAL_INLINE
153 * @brief Alias for __inline
156 #ifndef IX_OSAL_INLINE
157 #define IX_OSAL_INLINE __inline
158 #endif /* IX_OSAL_INLINE */
162 #define __inline__ IX_OSAL_INLINE
166 /* Each OS can define its own PUBLIC, otherwise it will be empty. */
173 * @ingroup IxOsalTypes
175 * @def IX_OSAL_INLINE_EXTERN
177 * @brief Alias for __inline extern
180 #ifndef IX_OSAL_INLINE_EXTERN
181 #define IX_OSAL_INLINE_EXTERN IX_OSAL_INLINE extern
185 * @ingroup IxOsalTypes
186 * @enum IxOsalLogDevice
187 * @brief This is an emum for OSAL log devices.
191 IX_OSAL_LOG_DEV_STDOUT = 0, /**< standard output (implemented by default) */
192 IX_OSAL_LOG_DEV_STDERR = 1, /**< standard error (implemented */
193 IX_OSAL_LOG_DEV_HEX_DISPLAY = 2, /**< hexadecimal display (not implemented) */
194 IX_OSAL_LOG_DEV_ASCII_DISPLAY = 3 /**< ASCII-capable display (not implemented) */
199 * @ingroup IxOsalTypes
201 * @def IX_OSAL_LOG_ERROR
203 * @brief Alias for -1, used as log function error status
206 #define IX_OSAL_LOG_ERROR (-1)
209 * @ingroup IxOsalTypes
210 * @enum IxOsalLogLevel
211 * @brief This is an emum for OSAL log trace level.
215 IX_OSAL_LOG_LVL_NONE = 0, /**<No trace level */
216 IX_OSAL_LOG_LVL_USER = 1, /**<Set trace level to user */
217 IX_OSAL_LOG_LVL_FATAL = 2, /**<Set trace level to fatal */
218 IX_OSAL_LOG_LVL_ERROR = 3, /**<Set trace level to error */
219 IX_OSAL_LOG_LVL_WARNING = 4, /**<Set trace level to warning */
220 IX_OSAL_LOG_LVL_MESSAGE = 5, /**<Set trace level to message */
221 IX_OSAL_LOG_LVL_DEBUG1 = 6, /**<Set trace level to debug1 */
222 IX_OSAL_LOG_LVL_DEBUG2 = 7, /**<Set trace level to debug2 */
223 IX_OSAL_LOG_LVL_DEBUG3 = 8, /**<Set trace level to debug3 */
224 IX_OSAL_LOG_LVL_ALL /**<Set trace level to all */
229 * @ingroup IxOsalTypes
230 * @brief Void function pointer prototype
232 * @note accepts a void pointer parameter
233 * and does not return a value.
235 typedef void (*IxOsalVoidFnVoidPtr) (void *);
237 typedef void (*IxOsalVoidFnPtr) (void);
241 * @brief Timeval structure
243 * @note Contain subfields of seconds and nanoseconds..
247 UINT32 secs; /**< seconds */
248 UINT32 nsecs; /**< nanoseconds */
253 * @ingroup IxOsalTypes
256 * @note OSAL timer handle
259 typedef UINT32 IxOsalTimer;
263 * @ingroup IxOsalTypes
265 * @def IX_OSAL_WAIT_FOREVER
267 * @brief Definition for timeout forever, OS-specific.
270 #define IX_OSAL_WAIT_FOREVER IX_OSAL_OS_WAIT_FOREVER
273 * @ingroup IxOsalTypes
275 * @def IX_OSAL_WAIT_NONE
277 * @brief Definition for timeout 0, OS-specific.
280 #define IX_OSAL_WAIT_NONE IX_OSAL_OS_WAIT_NONE
284 * @ingroup IxOsalTypes
287 * @note Mutex handle, OS-specific
290 typedef IxOsalOsMutex IxOsalMutex;
293 * @ingroup IxOsalTypes
294 * @brief IxOsalFastMutex
296 * @note FastMutex handle, OS-specific
299 typedef IxOsalOsFastMutex IxOsalFastMutex;
302 * @ingroup IxOsalTypes
303 * @brief IxOsalThread
305 * @note Thread handle, OS-specific
308 typedef IxOsalOsThread IxOsalThread;
311 * @ingroup IxOsalTypes
312 * @brief IxOsalSemaphore
314 * @note Semaphore handle, OS-specific
317 typedef IxOsalOsSemaphore IxOsalSemaphore;
320 * @ingroup IxOsalTypes
321 * @brief IxOsalMessageQueue
323 * @note Message Queue handle, OS-specific
326 typedef IxOsalOsMessageQueue IxOsalMessageQueue;
330 * @brief Thread Attribute
331 * @note Default thread attribute
335 char *name; /**< name */
336 UINT32 stackSize; /**< stack size */
337 UINT32 priority; /**< priority */
341 * @ingroup IxOsalTypes
343 * @def IX_OSAL_THREAD_DEFAULT_STACK_SIZE
345 * @brief Default thread stack size, OS-specific.
348 #define IX_OSAL_THREAD_DEFAULT_STACK_SIZE (IX_OSAL_OS_THREAD_DEFAULT_STACK_SIZE)
351 * @ingroup IxOsalTypes
353 * @def IX_OSAL_THREAD_MAX_STACK_SIZE
355 * @brief Max stack size, OS-specific.
358 #define IX_OSAL_THREAD_MAX_STACK_SIZE (IX_OSAL_OS_THREAD_MAX_STACK_SIZE)
361 * @ingroup IxOsalTypes
363 * @def IX_OSAL_DEFAULT_THREAD_PRIORITY
365 * @brief Default thread priority, OS-specific.
368 #define IX_OSAL_DEFAULT_THREAD_PRIORITY (IX_OSAL_OS_DEFAULT_THREAD_PRIORITY)
371 * @ingroup IxOsalTypes
373 * @def IX_OSAL_MAX_THREAD_PRIORITY
375 * @brief Max thread priority, OS-specific.
378 #define IX_OSAL_MAX_THREAD_PRIORITY (IX_OSAL_OS_MAX_THREAD_PRIORITY)
385 #endif /* IxOsalTypes_H */