2 * This file is intended to provide backward
3 * compatibility for main osService/OSSL
6 * It shall be phased out gradually and users
7 * are strongly recommended to use IX_OSAL API.
10 * IXP400 SW Release version 2.0
12 * -- Copyright Notice --
15 * Copyright 2001-2005, Intel Corporation.
16 * All rights reserved.
19 * SPDX-License-Identifier: BSD-3-Clause
21 * -- End of Copyright Notice --
24 #ifndef IX_OSAL_BACKWARD_OSSL_H
25 #define IX_OSAL_BACKWARD_OSSL_H
28 typedef IxOsalThread ix_ossl_thread_t;
30 typedef IxOsalSemaphore ix_ossl_sem_t;
32 typedef IxOsalMutex ix_ossl_mutex_t;
34 typedef IxOsalTimeval ix_ossl_time_t;
37 /* Map sub-fields for ix_ossl_time_t */
42 typedef IX_STATUS ix_error;
44 typedef UINT32 ix_ossl_thread_priority;
46 typedef UINT32 ix_uint32;
49 #define IX_OSSL_ERROR_SUCCESS IX_SUCCESS
51 #define IX_ERROR_SUCCESS IX_SUCCESS
56 IX_OSSL_SEM_UNAVAILABLE = 0,
63 IX_OSSL_MUTEX_UNLOCK = 0,
65 } ix_ossl_mutex_state;
68 typedef IxOsalVoidFnVoidPtr ix_ossl_thread_entry_point_t;
71 #define IX_OSSL_THREAD_PRI_HIGH 90
72 #define IX_OSSL_THREAD_PRI_MEDIUM 160
73 #define IX_OSSL_THREAD_PRI_LOW 240
76 #define IX_OSSL_WAIT_FOREVER IX_OSAL_WAIT_FOREVER
78 #define IX_OSSL_WAIT_NONE IX_OSAL_WAIT_NONE
80 #define BILLION IX_OSAL_BILLION
82 #define IX_OSSL_TIME_EQ(a,b) IX_OSAL_TIME_EQ(a,b)
84 #define IX_OSSL_TIME_GT(a,b) IX_OSAL_TIME_GT(a,b)
86 #define IX_OSSL_TIME_LT(a,b) IX_OSAL_TIME_LT(a,b)
88 #define IX_OSSL_TIME_ADD(a,b) IX_OSAL_TIME_ADD(a,b)
90 #define IX_OSSL_TIME_SUB(a,b) IX_OSAL_TIME_SUB(a,b)
93 /* a is tick, b is timeval */
94 #define IX_OSSL_TIME_CONVERT_TO_TICK(a,b) \
95 (a) = IX_OSAL_TIMEVAL_TO_TICKS(b)
101 ixOsalOsIxp400BackwardOsslThreadCreate (IxOsalVoidFnVoidPtr entryPoint,
102 void *arg, IxOsalThread * ptrThread);
104 #define ix_ossl_thread_create(entryPoint, arg, ptrTid) \
105 ixOsalOsIxp400BackwardOsslThreadCreate(entryPoint, arg, ptrTid)
108 /* void ix_ossl_thread_exit(ix_error retError, void* retObj) */
109 #define ix_ossl_thread_exit(retError, retObj) \
113 PUBLIC IX_STATUS ixOsalOsIxp400BackwardOsslThreadKill (IxOsalThread tid);
115 /* ix_error ix_ossl_thread_kill(tid) */
116 #define ix_ossl_thread_kill(tid) \
117 ixOsalOsIxp400BackwardOsslThreadKill(tid)
121 ixOsalOsIxp400BackwardOsslThreadSetPriority (IxOsalThread tid,
126 * ix_error ix_ossl_thread_set_priority(ix_ossl_thread_t tid,
127 * ix_ossl_thread_priority priority
131 #define ix_ossl_thread_set_priority(tid, priority) \
132 ixOsalOsIxp400BackwardOsslThreadSetPriority(tid, priority)
135 PUBLIC IX_STATUS ixOsalOsIxp400BackwardOsslTickGet (int *pticks);
137 #define ix_ossl_tick_get(pticks) \
138 ixOsalOsIxp400BackwardOsslTickGet(pticks)
140 PUBLIC IX_STATUS ixOsalOsIxp400BackwardOsslThreadDelay (int ticks);
142 #define ix_ossl_thread_delay(ticks) ixOsalOsIxp400BackwardOsslThreadDelay(ticks)
146 /* ix_error ix_ossl_sem_init(int start_value, ix_ossl_sem_t* sid); */
147 /* Note sid is a pointer to semaphore */
148 #define ix_ossl_sem_init(value, sid) \
149 ixOsalSemaphoreInit(sid, value)
153 ixOsalOsIxp400BackwardOsslSemaphoreWait (IxOsalSemaphore semaphore,
158 ix_error ix_ossl_sem_take(
164 #define ix_ossl_sem_take( sid, timeout) \
165 ixOsalOsIxp400BackwardOsslSemaphoreWait(sid, timeout)
170 ixOsalOsIxp400BackwardOsslSemaphorePost (IxOsalSemaphore sid);
172 /*ix_error ix_ossl_sem_give(ix_ossl_sem_t sid); */
173 #define ix_ossl_sem_give(sid) \
174 ixOsalOsIxp400BackwardOsslSemaphorePost(sid);
177 PUBLIC IX_STATUS ixOsalOsIxp400BackwardSemaphoreDestroy (IxOsalSemaphore sid);
179 #define ix_ossl_sem_fini(sid) \
180 ixOsalOsIxp400BackwardSemaphoreDestroy(sid)
184 ixOsalOsIxp400BackwardOsslMutexInit (ix_ossl_mutex_state start_state,
185 IxOsalMutex * pMutex);
188 /* ix_error ix_ossl_mutex_init(ix_ossl_mutex_state start_state, ix_ossl_mutex_t* mid); */
189 #define ix_ossl_mutex_init(start_state, pMutex) \
190 ixOsalOsIxp400BackwardOsslMutexInit(start_state, pMutex)
194 ixOsalOsIxp400BackwardOsslMutexLock (IxOsalMutex mid, INT32 timeout);
197 ix_error ix_ossl_mutex_lock(
202 #define ix_ossl_mutex_lock(mid, timeout) \
203 ixOsalOsIxp400BackwardOsslMutexLock(mid, timout)
206 PUBLIC IX_STATUS ixOsalOsIxp400BackwardOsslMutexUnlock (IxOsalMutex mid);
208 /* ix_error ix_ossl_mutex_unlock(ix_ossl_mutex_t mid); */
209 #define ix_ossl_mutex_unlock(mid) \
210 ixOsalOsIxp400BackwardOsslMutexUnlock(mid)
212 PUBLIC IX_STATUS ixOsalOsIxp400BackwardOsslMutexDestroy (IxOsalMutex mid);
214 #define ix_ossl_mutex_fini(mid) \
215 ixOsalOsIxp400BackwardOsslMutexDestroy(mid);
217 #define ix_ossl_sleep(sleeptime_ms) \
218 ixOsalSleep(sleeptime_ms)
220 PUBLIC IX_STATUS ixOsalOsIxp400BackwardOsslSleepTick (UINT32 ticks);
222 #define ix_ossl_sleep_tick(sleeptime_ticks) \
223 ixOsalOsIxp400BackwardOsslSleepTick(sleeptime_ticks)
226 PUBLIC IX_STATUS ixOsalOsIxp400BackwardOsslTimeGet (IxOsalTimeval * pTv);
228 #define ix_ossl_time_get(pTv) \
229 ixOsalOsIxp400BackwardOsslTimeGet(pTv)
232 typedef UINT32 ix_ossl_size_t;
234 #define ix_ossl_malloc(arg_size) \
235 ixOsalMemAlloc(arg_size)
237 #define ix_ossl_free(arg_pMemory) \
238 ixOsalMemFree(arg_pMemory)
241 #define ix_ossl_memcpy(arg_pDest, arg_pSrc,arg_Count) \
242 ixOsalMemCopy(arg_pDest, arg_pSrc,arg_Count)
244 #define ix_ossl_memset(arg_pDest, arg_pChar, arg_Count) \
245 ixOsalMemSet(arg_pDest, arg_pChar, arg_Count)
248 #endif /* IX_OSAL_BACKWARD_OSSL_H */