]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - drivers/net/npe/include/IxOsalTypes.h
imx6 SION bit has to be on for the pins that are used as ENET_REF_CLK
[karo-tx-uboot.git] / drivers / net / npe / include / IxOsalTypes.h
1 /**
2  * @file IxOsalTypes.h
3  *
4  * @brief Define OSAL basic data types.
5  *
6  * This file contains fundamental data types used by OSAL.
7  *
8  * @par
9  * IXP400 SW Release version 2.0
10  *
11  * -- Copyright Notice --
12  *
13  * @par
14  * Copyright 2001-2005, Intel Corporation.
15  * All rights reserved.
16  *
17  * @par
18  * SPDX-License-Identifier:     BSD-3-Clause
19  * @par
20  * -- End of Copyright Notice --
21  */
22
23
24 #ifndef IxOsalTypes_H
25 #define IxOsalTypes_H
26
27 #include <config.h>
28 #include <common.h>
29
30 #define __ixp42X                        /* sr: U-Boot needs this define */
31 #define IXP425_EXP_CFG_BASE     0xC4000000
32 #define diag_printf             debug
33
34 #undef SIMSPARCSOLARIS
35 #define SIMSPARCSOLARIS         0xaffe  /* sr: U-Boot gets confused with this solaris define */
36
37 /*
38  * Include the OS-specific type definitions
39  */
40 #include "IxOsalOsTypes.h"
41 /**
42  * @defgroup IxOsalTypes Osal basic data types.
43  *
44  * @brief Basic data types for Osal
45  *
46  * @{
47  */
48
49 /**
50  * @brief OSAL status
51  *
52  * @note Possible OSAL return status include IX_SUCCESS and IX_FAIL.
53  */
54 typedef UINT32 IX_STATUS;
55
56 /**
57  * @brief VUINT32
58  *
59  * @note volatile UINT32
60  */
61 typedef volatile UINT32 VUINT32;
62
63 /**
64  * @brief VINT32
65  *
66  * @note volatile INT32
67  */
68 typedef volatile INT32 VINT32;
69
70 /**
71  * @ingroup IxOsalTypes
72  *
73  * @def IX_OSAL_BILLION
74  *
75  * @brief  Alias for 1,000,000,000
76  *
77  */
78 #define IX_OSAL_BILLION (1000000000)
79
80 #ifndef NULL
81 #define NULL       0L
82 #endif
83
84 /**
85  * @ingroup IxOsalTypes
86  *
87  * @def IX_SUCCESS
88  *
89  * @brief Success status
90  *
91  */
92 #ifndef IX_SUCCESS
93 #define IX_SUCCESS 0L /**< #defined as 0L */
94 #endif
95
96 /**
97  * @ingroup IxOsalTypes
98  *
99  * @def IX_FAIL
100  *
101  * @brief Failure status
102  *
103  */
104 #ifndef IX_FAIL
105 #define IX_FAIL    1L /**< #defined as 1L */
106 #endif
107
108
109 #ifndef PRIVATE
110 #ifdef IX_PRIVATE_OFF
111 #define PRIVATE                 /* nothing */
112 #else
113 #define PRIVATE static  /**< #defined as static, except for debug builds */
114 #endif /* IX_PRIVATE_OFF */
115 #endif /* PRIVATE */
116
117
118 /**
119  * @ingroup IxOsalTypes
120  *
121  * @def IX_OSAL_INLINE
122  *
123  * @brief Alias for __inline
124  *
125  */
126 #ifndef IX_OSAL_INLINE
127 #define IX_OSAL_INLINE __inline
128 #endif /* IX_OSAL_INLINE */
129
130
131 #ifndef __inline__
132 #define __inline__      IX_OSAL_INLINE
133 #endif
134
135
136 /* Each OS can define its own PUBLIC, otherwise it will be empty. */
137 #ifndef PUBLIC
138 #define PUBLIC
139 #endif /* PUBLIC */
140
141
142 /**
143  * @ingroup IxOsalTypes
144  *
145  * @def IX_OSAL_INLINE_EXTERN
146  *
147  * @brief Alias for __inline extern
148  *
149  */
150 #ifndef IX_OSAL_INLINE_EXTERN
151 #define IX_OSAL_INLINE_EXTERN IX_OSAL_INLINE extern
152 #endif
153
154 /**
155  * @ingroup IxOsalTypes
156  * @enum IxOsalLogDevice
157  * @brief This is an emum for OSAL log devices.
158  */
159 typedef enum
160 {
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) */
165 } IxOsalLogDevice;
166
167
168 /**
169  * @ingroup IxOsalTypes
170  *
171  * @def IX_OSAL_LOG_ERROR
172  *
173  * @brief Alias for -1, used as log function error status
174  *
175  */
176 #define IX_OSAL_LOG_ERROR (-1)
177
178 /**
179  * @ingroup IxOsalTypes
180  * @enum IxOsalLogLevel
181  * @brief This is an emum for OSAL log trace level.
182  */
183 typedef enum
184 {
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 */
195 } IxOsalLogLevel;
196
197
198 /**
199  * @ingroup IxOsalTypes
200  * @brief Void function pointer prototype
201  *
202  * @note accepts a void pointer parameter
203  * and does not return a value.
204  */
205 typedef void (*IxOsalVoidFnVoidPtr) (void *);
206
207 typedef void (*IxOsalVoidFnPtr) (void);
208
209
210 /**
211  * @brief Timeval structure
212  *
213  * @note Contain subfields of seconds and nanoseconds..
214  */
215 typedef struct
216 {
217     UINT32 secs;                /**< seconds */
218     UINT32 nsecs;               /**< nanoseconds */
219 } IxOsalTimeval;
220
221
222 /**
223  * @ingroup IxOsalTypes
224  * @brief IxOsalTimer
225  *
226  * @note OSAL timer handle
227  *
228  */
229 typedef UINT32 IxOsalTimer;
230
231
232 /**
233  * @ingroup IxOsalTypes
234  *
235  * @def IX_OSAL_WAIT_FOREVER
236  *
237  * @brief Definition for timeout forever, OS-specific.
238  *
239  */
240 #define IX_OSAL_WAIT_FOREVER IX_OSAL_OS_WAIT_FOREVER
241
242 /**
243  * @ingroup IxOsalTypes
244  *
245  * @def IX_OSAL_WAIT_NONE
246  *
247  * @brief Definition for timeout 0, OS-specific.
248  *
249  */
250 #define IX_OSAL_WAIT_NONE    IX_OSAL_OS_WAIT_NONE
251
252
253 /**
254  * @ingroup IxOsalTypes
255  * @brief IxOsalMutex
256  *
257  * @note Mutex handle, OS-specific
258  *
259  */
260 typedef IxOsalOsMutex IxOsalMutex;
261
262 /**
263  * @ingroup IxOsalTypes
264  * @brief IxOsalFastMutex
265  *
266  * @note FastMutex handle, OS-specific
267  *
268  */
269 typedef IxOsalOsFastMutex IxOsalFastMutex;
270
271 /**
272  * @ingroup IxOsalTypes
273  * @brief IxOsalThread
274  *
275  * @note Thread handle, OS-specific
276  *
277  */
278 typedef IxOsalOsThread IxOsalThread;
279
280 /**
281  * @ingroup IxOsalTypes
282  * @brief IxOsalSemaphore
283  *
284  * @note Semaphore handle, OS-specific
285  *
286  */
287 typedef IxOsalOsSemaphore IxOsalSemaphore;
288
289 /**
290  * @ingroup IxOsalTypes
291  * @brief IxOsalMessageQueue
292  *
293  * @note Message Queue handle, OS-specific
294  *
295  */
296 typedef IxOsalOsMessageQueue IxOsalMessageQueue;
297
298
299 /**
300  * @brief Thread Attribute
301  * @note Default thread attribute
302  */
303 typedef struct
304 {
305     char *name;        /**< name */
306     UINT32 stackSize;  /**< stack size */
307     UINT32 priority;   /**< priority */
308 } IxOsalThreadAttr;
309
310 /**
311  * @ingroup IxOsalTypes
312  *
313  * @def IX_OSAL_THREAD_DEFAULT_STACK_SIZE
314  *
315  * @brief Default thread stack size, OS-specific.
316  *
317  */
318 #define IX_OSAL_THREAD_DEFAULT_STACK_SIZE (IX_OSAL_OS_THREAD_DEFAULT_STACK_SIZE)
319
320 /**
321  * @ingroup IxOsalTypes
322  *
323  * @def IX_OSAL_THREAD_MAX_STACK_SIZE
324  *
325  * @brief Max stack size, OS-specific.
326  *
327  */
328 #define IX_OSAL_THREAD_MAX_STACK_SIZE (IX_OSAL_OS_THREAD_MAX_STACK_SIZE)
329
330 /**
331  * @ingroup IxOsalTypes
332  *
333  * @def IX_OSAL_DEFAULT_THREAD_PRIORITY
334  *
335  * @brief Default thread priority, OS-specific.
336  *
337  */
338 #define IX_OSAL_DEFAULT_THREAD_PRIORITY (IX_OSAL_OS_DEFAULT_THREAD_PRIORITY)
339
340 /**
341  * @ingroup IxOsalTypes
342  *
343  * @def IX_OSAL_MAX_THREAD_PRIORITY
344  *
345  * @brief Max thread priority, OS-specific.
346  *
347  */
348 #define IX_OSAL_MAX_THREAD_PRIORITY (IX_OSAL_OS_MAX_THREAD_PRIORITY)
349
350 /**
351  * @} IxOsalTypes
352  */
353
354
355 #endif /* IxOsalTypes_H */