xref: /OK3568_Linux_fs/external/rkwifibt/drivers/bcmdhd/include/osl_ext.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * OS Abstraction Layer Extension - the APIs defined by the "extension" API
3*4882a593Smuzhiyun  * are only supported by a subset of all operating systems.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (C) 2020, Broadcom.
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  *      Unless you and Broadcom execute a separate written software license
8*4882a593Smuzhiyun  * agreement governing use of this software, this software is licensed to you
9*4882a593Smuzhiyun  * under the terms of the GNU General Public License version 2 (the "GPL"),
10*4882a593Smuzhiyun  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11*4882a593Smuzhiyun  * following added to such license:
12*4882a593Smuzhiyun  *
13*4882a593Smuzhiyun  *      As a special exception, the copyright holders of this software give you
14*4882a593Smuzhiyun  * permission to link this software with independent modules, and to copy and
15*4882a593Smuzhiyun  * distribute the resulting executable under terms of your choice, provided that
16*4882a593Smuzhiyun  * you also meet, for each linked independent module, the terms and conditions of
17*4882a593Smuzhiyun  * the license of that module.  An independent module is a module which is not
18*4882a593Smuzhiyun  * derived from this software.  The special exception does not apply to any
19*4882a593Smuzhiyun  * modifications of the software.
20*4882a593Smuzhiyun  *
21*4882a593Smuzhiyun  *
22*4882a593Smuzhiyun  * <<Broadcom-WL-IPTag/Dual:>>
23*4882a593Smuzhiyun  */
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun #ifndef _osl_ext_h_
26*4882a593Smuzhiyun #define _osl_ext_h_
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun /* ---- Include Files ---------------------------------------------------- */
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun #if defined(THREADX)
31*4882a593Smuzhiyun 	#include <threadx_osl_ext.h>
32*4882a593Smuzhiyun #else
33*4882a593Smuzhiyun 	#define OSL_EXT_DISABLED
34*4882a593Smuzhiyun #endif
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun #ifdef __cplusplus
37*4882a593Smuzhiyun extern "C" {
38*4882a593Smuzhiyun #endif
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun /* ---- Constants and Types ---------------------------------------------- */
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun /* -----------------------------------------------------------------------
43*4882a593Smuzhiyun  * Generic OS types.
44*4882a593Smuzhiyun  */
45*4882a593Smuzhiyun typedef enum osl_ext_status_t
46*4882a593Smuzhiyun {
47*4882a593Smuzhiyun 	OSL_EXT_SUCCESS,
48*4882a593Smuzhiyun 	OSL_EXT_ERROR,
49*4882a593Smuzhiyun 	OSL_EXT_TIMEOUT
50*4882a593Smuzhiyun 
51*4882a593Smuzhiyun } osl_ext_status_t;
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun #define OSL_EXT_STATUS_DECL(status)	osl_ext_status_t status;
54*4882a593Smuzhiyun 
55*4882a593Smuzhiyun #define OSL_EXT_TIME_FOREVER ((osl_ext_time_ms_t)(-1))
56*4882a593Smuzhiyun 
57*4882a593Smuzhiyun typedef unsigned int osl_ext_time_ms_t;
58*4882a593Smuzhiyun typedef unsigned int osl_ext_time_us_t;
59*4882a593Smuzhiyun 
60*4882a593Smuzhiyun typedef unsigned int osl_ext_event_bits_t;
61*4882a593Smuzhiyun 
62*4882a593Smuzhiyun typedef unsigned int osl_ext_interrupt_state_t;
63*4882a593Smuzhiyun 
64*4882a593Smuzhiyun /* -----------------------------------------------------------------------
65*4882a593Smuzhiyun  * Timers.
66*4882a593Smuzhiyun  */
67*4882a593Smuzhiyun typedef enum
68*4882a593Smuzhiyun {
69*4882a593Smuzhiyun 	/* One-shot timer. */
70*4882a593Smuzhiyun 	OSL_EXT_TIMER_MODE_ONCE,
71*4882a593Smuzhiyun 
72*4882a593Smuzhiyun 	/* Periodic timer. */
73*4882a593Smuzhiyun 	OSL_EXT_TIMER_MODE_REPEAT
74*4882a593Smuzhiyun 
75*4882a593Smuzhiyun } osl_ext_timer_mode_t;
76*4882a593Smuzhiyun 
77*4882a593Smuzhiyun /* User registered callback and parameter to invoke when timer expires. */
78*4882a593Smuzhiyun typedef void* osl_ext_timer_arg_t;
79*4882a593Smuzhiyun typedef void (*osl_ext_timer_callback)(osl_ext_timer_arg_t arg);
80*4882a593Smuzhiyun 
81*4882a593Smuzhiyun /* -----------------------------------------------------------------------
82*4882a593Smuzhiyun  * Tasks.
83*4882a593Smuzhiyun  */
84*4882a593Smuzhiyun 
85*4882a593Smuzhiyun /* Task entry argument. */
86*4882a593Smuzhiyun typedef void* osl_ext_task_arg_t;
87*4882a593Smuzhiyun 
88*4882a593Smuzhiyun /* Task entry function. */
89*4882a593Smuzhiyun typedef void (*osl_ext_task_entry)(osl_ext_task_arg_t arg);
90*4882a593Smuzhiyun 
91*4882a593Smuzhiyun /* Abstract task priority levels. */
92*4882a593Smuzhiyun typedef enum
93*4882a593Smuzhiyun {
94*4882a593Smuzhiyun 	OSL_EXT_TASK_IDLE_PRIORITY,
95*4882a593Smuzhiyun 	OSL_EXT_TASK_CPUUTIL_PRIORITY,
96*4882a593Smuzhiyun 	OSL_EXT_TASK_LOW_PRIORITY,
97*4882a593Smuzhiyun 	OSL_EXT_TASK_LOW_NORMAL_PRIORITY,
98*4882a593Smuzhiyun 	OSL_EXT_TASK_NORMAL_PRIORITY,
99*4882a593Smuzhiyun 	OSL_EXT_TASK_HIGH_NORMAL_PRIORITY,
100*4882a593Smuzhiyun 	OSL_EXT_TASK_HIGHEST_PRIORITY,
101*4882a593Smuzhiyun 	OSL_EXT_TASK_TIME_CRITICAL_PRIORITY,
102*4882a593Smuzhiyun 
103*4882a593Smuzhiyun 	/* This must be last. */
104*4882a593Smuzhiyun 	OSL_EXT_TASK_NUM_PRIORITES
105*4882a593Smuzhiyun } osl_ext_task_priority_t;
106*4882a593Smuzhiyun 
107*4882a593Smuzhiyun #ifndef OSL_EXT_DISABLED
108*4882a593Smuzhiyun 
109*4882a593Smuzhiyun /* ---- Variable Externs ------------------------------------------------- */
110*4882a593Smuzhiyun /* ---- Function Prototypes ---------------------------------------------- */
111*4882a593Smuzhiyun 
112*4882a593Smuzhiyun /* --------------------------------------------------------------------------
113*4882a593Smuzhiyun ** Semaphore
114*4882a593Smuzhiyun */
115*4882a593Smuzhiyun 
116*4882a593Smuzhiyun /****************************************************************************
117*4882a593Smuzhiyun * Function:   osl_ext_sem_create
118*4882a593Smuzhiyun *
119*4882a593Smuzhiyun * Purpose:    Creates a counting semaphore object, which can subsequently be
120*4882a593Smuzhiyun *             used for thread notification.
121*4882a593Smuzhiyun *
122*4882a593Smuzhiyun * Parameters: name     (in)  Name to assign to the semaphore (must be unique).
123*4882a593Smuzhiyun *             init_cnt (in)  Initial count that the semaphore should have.
124*4882a593Smuzhiyun *             sem      (out) Newly created semaphore.
125*4882a593Smuzhiyun *
126*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the semaphore was created successfully, or an
127*4882a593Smuzhiyun *             error code if the semaphore could not be created.
128*4882a593Smuzhiyun *****************************************************************************
129*4882a593Smuzhiyun */
130*4882a593Smuzhiyun osl_ext_status_t osl_ext_sem_create(char *name, int init_cnt, osl_ext_sem_t *sem);
131*4882a593Smuzhiyun 
132*4882a593Smuzhiyun /****************************************************************************
133*4882a593Smuzhiyun * Function:   osl_ext_sem_delete
134*4882a593Smuzhiyun *
135*4882a593Smuzhiyun * Purpose:    Destroys a previously created semaphore object.
136*4882a593Smuzhiyun *
137*4882a593Smuzhiyun * Parameters: sem (mod) Semaphore object to destroy.
138*4882a593Smuzhiyun *
139*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the semaphore was deleted successfully, or an
140*4882a593Smuzhiyun *             error code if the semaphore could not be created.
141*4882a593Smuzhiyun *****************************************************************************
142*4882a593Smuzhiyun */
143*4882a593Smuzhiyun osl_ext_status_t osl_ext_sem_delete(osl_ext_sem_t *sem);
144*4882a593Smuzhiyun 
145*4882a593Smuzhiyun /****************************************************************************
146*4882a593Smuzhiyun * Function:   osl_ext_sem_give
147*4882a593Smuzhiyun *
148*4882a593Smuzhiyun * Purpose:    Increments the count associated with the semaphore. This will
149*4882a593Smuzhiyun *             cause one thread blocked on a take to wake up.
150*4882a593Smuzhiyun *
151*4882a593Smuzhiyun * Parameters: sem (mod) Semaphore object to give.
152*4882a593Smuzhiyun *
153*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the semaphore was given successfully, or an
154*4882a593Smuzhiyun *             error code if the semaphore could not be created.
155*4882a593Smuzhiyun *****************************************************************************
156*4882a593Smuzhiyun */
157*4882a593Smuzhiyun osl_ext_status_t osl_ext_sem_give(osl_ext_sem_t *sem);
158*4882a593Smuzhiyun 
159*4882a593Smuzhiyun /****************************************************************************
160*4882a593Smuzhiyun * Function:   osl_ext_sem_take
161*4882a593Smuzhiyun *
162*4882a593Smuzhiyun * Purpose:    Decrements the count associated with the semaphore. If the count
163*4882a593Smuzhiyun *             is less than zero, then the calling task will become blocked until
164*4882a593Smuzhiyun *             another thread does a give on the semaphore. This function will only
165*4882a593Smuzhiyun *             block the calling thread for timeout_msec milliseconds, before
166*4882a593Smuzhiyun *             returning with OSL_EXT_TIMEOUT.
167*4882a593Smuzhiyun *
168*4882a593Smuzhiyun * Parameters: sem          (mod) Semaphore object to take.
169*4882a593Smuzhiyun *             timeout_msec (in)  Number of milliseconds to wait for the
170*4882a593Smuzhiyun *                                semaphore to enter a state where it can be
171*4882a593Smuzhiyun *                                taken.
172*4882a593Smuzhiyun *
173*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the semaphore was taken successfully, or an
174*4882a593Smuzhiyun *             error code if the semaphore could not be created.
175*4882a593Smuzhiyun *****************************************************************************
176*4882a593Smuzhiyun */
177*4882a593Smuzhiyun osl_ext_status_t osl_ext_sem_take(osl_ext_sem_t *sem, osl_ext_time_ms_t timeout_msec);
178*4882a593Smuzhiyun 
179*4882a593Smuzhiyun /* --------------------------------------------------------------------------
180*4882a593Smuzhiyun ** Mutex
181*4882a593Smuzhiyun */
182*4882a593Smuzhiyun 
183*4882a593Smuzhiyun /****************************************************************************
184*4882a593Smuzhiyun * Function:   osl_ext_mutex_create
185*4882a593Smuzhiyun *
186*4882a593Smuzhiyun * Purpose:    Creates a mutex object, which can subsequently be used to control
187*4882a593Smuzhiyun *             mutually exclusion of resources.
188*4882a593Smuzhiyun *
189*4882a593Smuzhiyun * Parameters: name  (in)  Name to assign to the mutex (must be unique).
190*4882a593Smuzhiyun *             mutex (out) Mutex object to initialize.
191*4882a593Smuzhiyun *
192*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the mutex was created successfully, or an
193*4882a593Smuzhiyun *             error code if the mutex could not be created.
194*4882a593Smuzhiyun *****************************************************************************
195*4882a593Smuzhiyun */
196*4882a593Smuzhiyun osl_ext_status_t osl_ext_mutex_create(char *name, osl_ext_mutex_t *mutex);
197*4882a593Smuzhiyun 
198*4882a593Smuzhiyun /****************************************************************************
199*4882a593Smuzhiyun * Function:   osl_ext_mutex_delete
200*4882a593Smuzhiyun *
201*4882a593Smuzhiyun * Purpose:    Destroys a previously created mutex object.
202*4882a593Smuzhiyun *
203*4882a593Smuzhiyun * Parameters: mutex (mod) Mutex object to destroy.
204*4882a593Smuzhiyun *
205*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the mutex was deleted successfully, or an
206*4882a593Smuzhiyun *             error code if the mutex could not be created.
207*4882a593Smuzhiyun *****************************************************************************
208*4882a593Smuzhiyun */
209*4882a593Smuzhiyun osl_ext_status_t osl_ext_mutex_delete(osl_ext_mutex_t *mutex);
210*4882a593Smuzhiyun 
211*4882a593Smuzhiyun /****************************************************************************
212*4882a593Smuzhiyun * Function:   osl_ext_mutex_acquire
213*4882a593Smuzhiyun *
214*4882a593Smuzhiyun * Purpose:    Acquires the indicated mutual exclusion object. If the object is
215*4882a593Smuzhiyun *             currently acquired by another task, then this function will wait
216*4882a593Smuzhiyun *             for timeout_msec milli-seconds before returning with OSL_EXT_TIMEOUT.
217*4882a593Smuzhiyun *
218*4882a593Smuzhiyun * Parameters: mutex        (mod) Mutex object to acquire.
219*4882a593Smuzhiyun *             timeout_msec (in)  Number of milliseconds to wait for the mutex.
220*4882a593Smuzhiyun *
221*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the mutex was acquired successfully, or an
222*4882a593Smuzhiyun *             error code if the mutex could not be created.
223*4882a593Smuzhiyun *****************************************************************************
224*4882a593Smuzhiyun */
225*4882a593Smuzhiyun osl_ext_status_t osl_ext_mutex_acquire(osl_ext_mutex_t *mutex, osl_ext_time_ms_t timeout_msec);
226*4882a593Smuzhiyun 
227*4882a593Smuzhiyun /****************************************************************************
228*4882a593Smuzhiyun * Function:   osl_ext_mutex_release
229*4882a593Smuzhiyun *
230*4882a593Smuzhiyun * Purpose:    Releases the indicated mutual exclusion object. This makes it
231*4882a593Smuzhiyun *             available for another task to acquire.
232*4882a593Smuzhiyun *
233*4882a593Smuzhiyun * Parameters: mutex (mod) Mutex object to release.
234*4882a593Smuzhiyun *
235*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the mutex was released successfully, or an
236*4882a593Smuzhiyun *             error code if the mutex could not be created.
237*4882a593Smuzhiyun *****************************************************************************
238*4882a593Smuzhiyun */
239*4882a593Smuzhiyun osl_ext_status_t osl_ext_mutex_release(osl_ext_mutex_t *mutex);
240*4882a593Smuzhiyun 
241*4882a593Smuzhiyun /* --------------------------------------------------------------------------
242*4882a593Smuzhiyun ** Timers
243*4882a593Smuzhiyun */
244*4882a593Smuzhiyun 
245*4882a593Smuzhiyun /****************************************************************************
246*4882a593Smuzhiyun * Function:   osl_ext_timer_create
247*4882a593Smuzhiyun *
248*4882a593Smuzhiyun * Purpose:    Creates a timer object.
249*4882a593Smuzhiyun *
250*4882a593Smuzhiyun * Parameters: name (in)         Name of timer.
251*4882a593Smuzhiyun *             timeout_msec (in) Invoke callback after this number of milliseconds.
252*4882a593Smuzhiyun *             mode (in)         One-shot or periodic timer.
253*4882a593Smuzhiyun *             func (in)         Callback function to invoke on timer expiry.
254*4882a593Smuzhiyun *             arg (in)          Argument to callback function.
255*4882a593Smuzhiyun *             timer (out)       Timer object to create.
256*4882a593Smuzhiyun *
257*4882a593Smuzhiyun * Note: The function callback occurs in interrupt context. The application is
258*4882a593Smuzhiyun *       required to provide context switch for the callback if required.
259*4882a593Smuzhiyun *
260*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the timer was created successfully, or an
261*4882a593Smuzhiyun *             error code if the timer could not be created.
262*4882a593Smuzhiyun *****************************************************************************
263*4882a593Smuzhiyun */
264*4882a593Smuzhiyun osl_ext_status_t
265*4882a593Smuzhiyun osl_ext_timer_create(char *name, osl_ext_time_ms_t timeout_msec, osl_ext_timer_mode_t mode,
266*4882a593Smuzhiyun                  osl_ext_timer_callback func, osl_ext_timer_arg_t arg, osl_ext_timer_t *timer);
267*4882a593Smuzhiyun 
268*4882a593Smuzhiyun /****************************************************************************
269*4882a593Smuzhiyun * Function:   osl_ext_timer_delete
270*4882a593Smuzhiyun *
271*4882a593Smuzhiyun * Purpose:    Destroys a previously created timer object.
272*4882a593Smuzhiyun *
273*4882a593Smuzhiyun * Parameters: timer (mod) Timer object to destroy.
274*4882a593Smuzhiyun *
275*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the timer was created successfully, or an
276*4882a593Smuzhiyun *             error code if the timer could not be created.
277*4882a593Smuzhiyun *****************************************************************************
278*4882a593Smuzhiyun */
279*4882a593Smuzhiyun osl_ext_status_t osl_ext_timer_delete(osl_ext_timer_t *timer);
280*4882a593Smuzhiyun 
281*4882a593Smuzhiyun /****************************************************************************
282*4882a593Smuzhiyun * Function:   osl_ext_timer_start
283*4882a593Smuzhiyun *
284*4882a593Smuzhiyun * Purpose:    Start a previously created timer object.
285*4882a593Smuzhiyun *
286*4882a593Smuzhiyun * Parameters: timer (in)        Timer object.
287*4882a593Smuzhiyun *             timeout_msec (in) Invoke callback after this number of milliseconds.
288*4882a593Smuzhiyun *             mode (in)         One-shot or periodic timer.
289*4882a593Smuzhiyun *
290*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the timer was created successfully, or an
291*4882a593Smuzhiyun *             error code if the timer could not be created.
292*4882a593Smuzhiyun *****************************************************************************
293*4882a593Smuzhiyun */
294*4882a593Smuzhiyun osl_ext_status_t
295*4882a593Smuzhiyun osl_ext_timer_start(osl_ext_timer_t *timer,
296*4882a593Smuzhiyun 	osl_ext_time_ms_t timeout_msec, osl_ext_timer_mode_t mode);
297*4882a593Smuzhiyun 
298*4882a593Smuzhiyun /****************************************************************************
299*4882a593Smuzhiyun * Function:   osl_ext_timer_start
300*4882a593Smuzhiyun *
301*4882a593Smuzhiyun * Purpose:    Start a previously created timer object.
302*4882a593Smuzhiyun *
303*4882a593Smuzhiyun * Parameters: timer (in)        Timer object.
304*4882a593Smuzhiyun *             timeout_usec (in) Invoke callback after this number of micro-seconds.
305*4882a593Smuzhiyun *             mode (in)         One-shot or periodic timer.
306*4882a593Smuzhiyun *
307*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the timer was created successfully, or an
308*4882a593Smuzhiyun *             error code if the timer could not be created.
309*4882a593Smuzhiyun *****************************************************************************
310*4882a593Smuzhiyun */
311*4882a593Smuzhiyun osl_ext_status_t
312*4882a593Smuzhiyun osl_ext_timer_start_us(osl_ext_timer_t *timer,
313*4882a593Smuzhiyun 	osl_ext_time_us_t timeout_usec, osl_ext_timer_mode_t mode);
314*4882a593Smuzhiyun 
315*4882a593Smuzhiyun /****************************************************************************
316*4882a593Smuzhiyun * Function:   osl_ext_timer_stop
317*4882a593Smuzhiyun *
318*4882a593Smuzhiyun * Purpose:    Stop a previously created timer object.
319*4882a593Smuzhiyun *
320*4882a593Smuzhiyun * Parameters: timer (in)        Timer object.
321*4882a593Smuzhiyun *
322*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the timer was created successfully, or an
323*4882a593Smuzhiyun *             error code if the timer could not be created.
324*4882a593Smuzhiyun *****************************************************************************
325*4882a593Smuzhiyun */
326*4882a593Smuzhiyun osl_ext_status_t
327*4882a593Smuzhiyun osl_ext_timer_stop(osl_ext_timer_t *timer);
328*4882a593Smuzhiyun 
329*4882a593Smuzhiyun /****************************************************************************
330*4882a593Smuzhiyun * Function:   osl_ext_time_get
331*4882a593Smuzhiyun *
332*4882a593Smuzhiyun * Purpose:    Returns incrementing time counter.
333*4882a593Smuzhiyun *
334*4882a593Smuzhiyun * Parameters: None.
335*4882a593Smuzhiyun *
336*4882a593Smuzhiyun * Returns:    Returns incrementing time counter in msec.
337*4882a593Smuzhiyun *****************************************************************************
338*4882a593Smuzhiyun */
339*4882a593Smuzhiyun osl_ext_time_ms_t osl_ext_time_get(void);
340*4882a593Smuzhiyun 
341*4882a593Smuzhiyun /* --------------------------------------------------------------------------
342*4882a593Smuzhiyun ** Tasks
343*4882a593Smuzhiyun */
344*4882a593Smuzhiyun 
345*4882a593Smuzhiyun /****************************************************************************
346*4882a593Smuzhiyun * Function:   osl_ext_task_create
347*4882a593Smuzhiyun *
348*4882a593Smuzhiyun * Purpose:    Create a task.
349*4882a593Smuzhiyun *
350*4882a593Smuzhiyun * Parameters: name       (in)  Pointer to task string descriptor.
351*4882a593Smuzhiyun *             stack      (in)  Pointer to stack. NULL to allocate.
352*4882a593Smuzhiyun *             stack_size (in)  Stack size - in bytes.
353*4882a593Smuzhiyun *             priority   (in)  Abstract task priority.
354*4882a593Smuzhiyun *             func       (in)  A pointer to the task entry point function.
355*4882a593Smuzhiyun *             arg        (in)  Value passed into task entry point function.
356*4882a593Smuzhiyun *             task       (out) Task to create.
357*4882a593Smuzhiyun *
358*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the task was created successfully, or an
359*4882a593Smuzhiyun *             error code if the task could not be created.
360*4882a593Smuzhiyun *****************************************************************************
361*4882a593Smuzhiyun */
362*4882a593Smuzhiyun 
363*4882a593Smuzhiyun #define osl_ext_task_create(name, stack, stack_size, priority, func, arg, task) \
364*4882a593Smuzhiyun 	   osl_ext_task_create_ex((name), (stack), (stack_size), (priority), 0, (func), \
365*4882a593Smuzhiyun 	   (arg), TRUE, (task))
366*4882a593Smuzhiyun 
367*4882a593Smuzhiyun /****************************************************************************
368*4882a593Smuzhiyun * Function:   osl_ext_task_create_ex
369*4882a593Smuzhiyun *
370*4882a593Smuzhiyun * Purpose:    Create a task with autostart option.
371*4882a593Smuzhiyun *
372*4882a593Smuzhiyun * Parameters: name       (in)  Pointer to task string descriptor.
373*4882a593Smuzhiyun *             stack      (in)  Pointer to stack. NULL to allocate.
374*4882a593Smuzhiyun *             stack_size (in)  Stack size - in bytes.
375*4882a593Smuzhiyun *             priority   (in)  Abstract task priority.
376*4882a593Smuzhiyun *             func       (in)  A pointer to the task entry point function.
377*4882a593Smuzhiyun *             arg        (in)  Value passed into task entry point function.
378*4882a593Smuzhiyun *             autostart  (in)  TRUE to start task after creation.
379*4882a593Smuzhiyun *             task       (out) Task to create.
380*4882a593Smuzhiyun *
381*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the task was created successfully, or an
382*4882a593Smuzhiyun *             error code if the task could not be created.
383*4882a593Smuzhiyun *****************************************************************************
384*4882a593Smuzhiyun */
385*4882a593Smuzhiyun 
386*4882a593Smuzhiyun osl_ext_status_t osl_ext_task_create_ex(char* name,
387*4882a593Smuzhiyun 	void *stack, unsigned int stack_size, osl_ext_task_priority_t priority,
388*4882a593Smuzhiyun 	osl_ext_time_ms_t timslice_msec, osl_ext_task_entry func, osl_ext_task_arg_t arg,
389*4882a593Smuzhiyun 	bool autostart, osl_ext_task_t *task);
390*4882a593Smuzhiyun 
391*4882a593Smuzhiyun /****************************************************************************
392*4882a593Smuzhiyun * Function:   osl_ext_task_change_priority
393*4882a593Smuzhiyun *
394*4882a593Smuzhiyun * Purpose:    Change priority of a task.
395*4882a593Smuzhiyun *
396*4882a593Smuzhiyun * Parameters: task
397*4882a593Smuzhiyun *             new_priority   (in)  New task priority.
398*4882a593Smuzhiyun *             old_priority   (out) Old task priroty.
399*4882a593Smuzhiyun *
400*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the task was created successfully, or an
401*4882a593Smuzhiyun *             error code if the priority could not be changed..
402*4882a593Smuzhiyun *****************************************************************************
403*4882a593Smuzhiyun */
404*4882a593Smuzhiyun osl_ext_status_t osl_ext_task_change_priority(osl_ext_task_t *task,
405*4882a593Smuzhiyun 	osl_ext_task_priority_t new_priority, osl_ext_task_priority_t *old_priority);
406*4882a593Smuzhiyun 
407*4882a593Smuzhiyun /****************************************************************************
408*4882a593Smuzhiyun * Function:   osl_ext_task_delete
409*4882a593Smuzhiyun *
410*4882a593Smuzhiyun * Purpose:    Destroy a task.
411*4882a593Smuzhiyun *
412*4882a593Smuzhiyun * Parameters: task (mod) Task to destroy.
413*4882a593Smuzhiyun *
414*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the task was created successfully, or an
415*4882a593Smuzhiyun *             error code if the task could not be created.
416*4882a593Smuzhiyun *****************************************************************************
417*4882a593Smuzhiyun */
418*4882a593Smuzhiyun osl_ext_status_t osl_ext_task_delete(osl_ext_task_t *task);
419*4882a593Smuzhiyun 
420*4882a593Smuzhiyun /****************************************************************************
421*4882a593Smuzhiyun * Function:   osl_ext_task_is_running
422*4882a593Smuzhiyun *
423*4882a593Smuzhiyun * Purpose:    Returns current running task.
424*4882a593Smuzhiyun *
425*4882a593Smuzhiyun * Parameters: None.
426*4882a593Smuzhiyun *
427*4882a593Smuzhiyun * Returns:    osl_ext_task_t of current running task.
428*4882a593Smuzhiyun *****************************************************************************
429*4882a593Smuzhiyun */
430*4882a593Smuzhiyun osl_ext_task_t *osl_ext_task_current(void);
431*4882a593Smuzhiyun 
432*4882a593Smuzhiyun /****************************************************************************
433*4882a593Smuzhiyun * Function:   osl_ext_task_yield
434*4882a593Smuzhiyun *
435*4882a593Smuzhiyun * Purpose:    Yield the CPU to other tasks of the same priority that are
436*4882a593Smuzhiyun *             ready-to-run.
437*4882a593Smuzhiyun *
438*4882a593Smuzhiyun * Parameters: None.
439*4882a593Smuzhiyun *
440*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if successful, else error code.
441*4882a593Smuzhiyun *****************************************************************************
442*4882a593Smuzhiyun */
443*4882a593Smuzhiyun osl_ext_status_t osl_ext_task_yield(void);
444*4882a593Smuzhiyun 
445*4882a593Smuzhiyun /****************************************************************************
446*4882a593Smuzhiyun * Function:   osl_ext_task_suspend
447*4882a593Smuzhiyun *
448*4882a593Smuzhiyun * Purpose:    Suspend a task.
449*4882a593Smuzhiyun *
450*4882a593Smuzhiyun * Parameters: task (mod) Task to suspend.
451*4882a593Smuzhiyun *
452*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the task was suspended successfully, or an
453*4882a593Smuzhiyun *             error code if the task could not be suspended.
454*4882a593Smuzhiyun *****************************************************************************
455*4882a593Smuzhiyun */
456*4882a593Smuzhiyun osl_ext_status_t osl_ext_task_suspend(osl_ext_task_t *task);
457*4882a593Smuzhiyun 
458*4882a593Smuzhiyun /****************************************************************************
459*4882a593Smuzhiyun * Function:   osl_ext_task_resume
460*4882a593Smuzhiyun *
461*4882a593Smuzhiyun * Purpose:    Resume a task.
462*4882a593Smuzhiyun *
463*4882a593Smuzhiyun * Parameters: task (mod) Task to resume.
464*4882a593Smuzhiyun *
465*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the task was resumed successfully, or an
466*4882a593Smuzhiyun *             error code if the task could not be resumed.
467*4882a593Smuzhiyun *****************************************************************************
468*4882a593Smuzhiyun */
469*4882a593Smuzhiyun osl_ext_status_t osl_ext_task_resume(osl_ext_task_t *task);
470*4882a593Smuzhiyun 
471*4882a593Smuzhiyun /****************************************************************************
472*4882a593Smuzhiyun * Function:   osl_ext_task_enable_stack_check
473*4882a593Smuzhiyun *
474*4882a593Smuzhiyun * Purpose:    Enable task stack checking.
475*4882a593Smuzhiyun *
476*4882a593Smuzhiyun * Parameters: None.
477*4882a593Smuzhiyun *
478*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if successful, else error code.
479*4882a593Smuzhiyun *****************************************************************************
480*4882a593Smuzhiyun */
481*4882a593Smuzhiyun osl_ext_status_t osl_ext_task_enable_stack_check(void);
482*4882a593Smuzhiyun 
483*4882a593Smuzhiyun /* --------------------------------------------------------------------------
484*4882a593Smuzhiyun ** Queue
485*4882a593Smuzhiyun */
486*4882a593Smuzhiyun 
487*4882a593Smuzhiyun /****************************************************************************
488*4882a593Smuzhiyun * Function:   osl_ext_queue_create
489*4882a593Smuzhiyun *
490*4882a593Smuzhiyun * Purpose:    Create a queue.
491*4882a593Smuzhiyun *
492*4882a593Smuzhiyun * Parameters: name     (in)  Name to assign to the queue (must be unique).
493*4882a593Smuzhiyun *             buffer   (in)  Queue buffer. NULL to allocate.
494*4882a593Smuzhiyun *             size     (in)  Size of the queue.
495*4882a593Smuzhiyun *             queue    (out) Newly created queue.
496*4882a593Smuzhiyun *
497*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the queue was created successfully, or an
498*4882a593Smuzhiyun *             error code if the queue could not be created.
499*4882a593Smuzhiyun *****************************************************************************
500*4882a593Smuzhiyun */
501*4882a593Smuzhiyun osl_ext_status_t osl_ext_queue_create(char *name,
502*4882a593Smuzhiyun 	void *queue_buffer, unsigned int queue_size,
503*4882a593Smuzhiyun 	osl_ext_queue_t *queue);
504*4882a593Smuzhiyun 
505*4882a593Smuzhiyun /****************************************************************************
506*4882a593Smuzhiyun * Function:   osl_ext_queue_delete
507*4882a593Smuzhiyun *
508*4882a593Smuzhiyun * Purpose:    Destroys a previously created queue object.
509*4882a593Smuzhiyun *
510*4882a593Smuzhiyun * Parameters: queue    (mod) Queue object to destroy.
511*4882a593Smuzhiyun *
512*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the queue was deleted successfully, or an
513*4882a593Smuzhiyun *             error code if the queue could not be deleteed.
514*4882a593Smuzhiyun *****************************************************************************
515*4882a593Smuzhiyun */
516*4882a593Smuzhiyun osl_ext_status_t osl_ext_queue_delete(osl_ext_queue_t *queue);
517*4882a593Smuzhiyun 
518*4882a593Smuzhiyun /****************************************************************************
519*4882a593Smuzhiyun * Function:   osl_ext_queue_send
520*4882a593Smuzhiyun *
521*4882a593Smuzhiyun * Purpose:    Send/add data to the queue. This function will not block the
522*4882a593Smuzhiyun *             calling thread if the queue is full.
523*4882a593Smuzhiyun *
524*4882a593Smuzhiyun * Parameters: queue    (mod) Queue object.
525*4882a593Smuzhiyun *             data     (in)  Data pointer to be queued.
526*4882a593Smuzhiyun *
527*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the data was queued successfully, or an
528*4882a593Smuzhiyun *             error code if the data could not be queued.
529*4882a593Smuzhiyun *****************************************************************************
530*4882a593Smuzhiyun */
531*4882a593Smuzhiyun osl_ext_status_t osl_ext_queue_send(osl_ext_queue_t *queue, void *data);
532*4882a593Smuzhiyun 
533*4882a593Smuzhiyun /****************************************************************************
534*4882a593Smuzhiyun * Function:   osl_ext_queue_send_synchronous
535*4882a593Smuzhiyun *
536*4882a593Smuzhiyun * Purpose:    Send/add data to the queue. This function will block the
537*4882a593Smuzhiyun *             calling thread until the data is dequeued.
538*4882a593Smuzhiyun *
539*4882a593Smuzhiyun * Parameters: queue    (mod) Queue object.
540*4882a593Smuzhiyun *             data     (in)  Data pointer to be queued.
541*4882a593Smuzhiyun *
542*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the data was queued successfully, or an
543*4882a593Smuzhiyun *             error code if the data could not be queued.
544*4882a593Smuzhiyun *****************************************************************************
545*4882a593Smuzhiyun */
546*4882a593Smuzhiyun osl_ext_status_t osl_ext_queue_send_synchronous(osl_ext_queue_t *queue, void *data);
547*4882a593Smuzhiyun 
548*4882a593Smuzhiyun /****************************************************************************
549*4882a593Smuzhiyun * Function:   osl_ext_queue_receive
550*4882a593Smuzhiyun *
551*4882a593Smuzhiyun * Purpose:    Receive/remove data from the queue. This function will only
552*4882a593Smuzhiyun *             block the calling thread for timeout_msec milliseconds, before
553*4882a593Smuzhiyun *             returning with OSL_EXT_TIMEOUT.
554*4882a593Smuzhiyun *
555*4882a593Smuzhiyun * Parameters: queue        (mod) Queue object.
556*4882a593Smuzhiyun *             timeout_msec (in)  Number of milliseconds to wait for the
557*4882a593Smuzhiyun *                                data from the queue.
558*4882a593Smuzhiyun *             data         (out) Data pointer received/removed from the queue.
559*4882a593Smuzhiyun *
560*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the data was dequeued successfully, or an
561*4882a593Smuzhiyun *             error code if the data could not be dequeued.
562*4882a593Smuzhiyun *****************************************************************************
563*4882a593Smuzhiyun */
564*4882a593Smuzhiyun osl_ext_status_t osl_ext_queue_receive(osl_ext_queue_t *queue,
565*4882a593Smuzhiyun                  osl_ext_time_ms_t timeout_msec, void **data);
566*4882a593Smuzhiyun 
567*4882a593Smuzhiyun /****************************************************************************
568*4882a593Smuzhiyun * Function:   osl_ext_queue_count
569*4882a593Smuzhiyun *
570*4882a593Smuzhiyun * Purpose:    Returns the number of items in the queue.
571*4882a593Smuzhiyun *
572*4882a593Smuzhiyun * Parameters: queue        (mod) Queue object.
573*4882a593Smuzhiyun *             count        (out) Data pointer received/removed from the queue.
574*4882a593Smuzhiyun *
575*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the count was returned successfully, or an
576*4882a593Smuzhiyun *             error code if the count is invalid.
577*4882a593Smuzhiyun *****************************************************************************
578*4882a593Smuzhiyun */
579*4882a593Smuzhiyun osl_ext_status_t osl_ext_queue_count(osl_ext_queue_t *queue, int *count);
580*4882a593Smuzhiyun 
581*4882a593Smuzhiyun /* --------------------------------------------------------------------------
582*4882a593Smuzhiyun ** Event
583*4882a593Smuzhiyun */
584*4882a593Smuzhiyun 
585*4882a593Smuzhiyun /****************************************************************************
586*4882a593Smuzhiyun * Function:   osl_ext_event_create
587*4882a593Smuzhiyun *
588*4882a593Smuzhiyun * Purpose:    Creates a event object, which can subsequently be used to
589*4882a593Smuzhiyun *             notify and trigger tasks.
590*4882a593Smuzhiyun *
591*4882a593Smuzhiyun * Parameters: name  (in)  Name to assign to the event (must be unique).
592*4882a593Smuzhiyun *             event (out) Event object to initialize.
593*4882a593Smuzhiyun *
594*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the event was created successfully, or an
595*4882a593Smuzhiyun *             error code if the event could not be created.
596*4882a593Smuzhiyun *****************************************************************************
597*4882a593Smuzhiyun */
598*4882a593Smuzhiyun osl_ext_status_t osl_ext_event_create(char *name, osl_ext_event_t *event);
599*4882a593Smuzhiyun 
600*4882a593Smuzhiyun /****************************************************************************
601*4882a593Smuzhiyun * Function:   osl_ext_event_delete
602*4882a593Smuzhiyun *
603*4882a593Smuzhiyun * Purpose:    Destroys a previously created event object.
604*4882a593Smuzhiyun *
605*4882a593Smuzhiyun * Parameters: event (mod) Event object to destroy.
606*4882a593Smuzhiyun *
607*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the event was created successfully, or an
608*4882a593Smuzhiyun *             error code if the event could not be created.
609*4882a593Smuzhiyun *****************************************************************************
610*4882a593Smuzhiyun */
611*4882a593Smuzhiyun osl_ext_status_t osl_ext_event_delete(osl_ext_event_t *event);
612*4882a593Smuzhiyun 
613*4882a593Smuzhiyun /****************************************************************************
614*4882a593Smuzhiyun * Function:   osl_ext_event_get
615*4882a593Smuzhiyun *
616*4882a593Smuzhiyun * Purpose:    Get event from specified event object.
617*4882a593Smuzhiyun *
618*4882a593Smuzhiyun * Parameters: event        (mod) Event object to get.
619*4882a593Smuzhiyun *             requested    (in)  Requested event to get.
620*4882a593Smuzhiyun *             timeout_msec (in)  Number of milliseconds to wait for the event.
621*4882a593Smuzhiyun *             event_bits   (out) Event bits retrieved.
622*4882a593Smuzhiyun *
623*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the event was created successfully, or an
624*4882a593Smuzhiyun *             error code if the event could not be created.
625*4882a593Smuzhiyun *****************************************************************************
626*4882a593Smuzhiyun */
627*4882a593Smuzhiyun osl_ext_status_t osl_ext_event_get(osl_ext_event_t *event,
628*4882a593Smuzhiyun 	osl_ext_event_bits_t requested,	osl_ext_time_ms_t timeout_msec,
629*4882a593Smuzhiyun 	osl_ext_event_bits_t *event_bits);
630*4882a593Smuzhiyun 
631*4882a593Smuzhiyun /****************************************************************************
632*4882a593Smuzhiyun * Function:   osl_ext_event_set
633*4882a593Smuzhiyun *
634*4882a593Smuzhiyun * Purpose:    Set event of specified event object.
635*4882a593Smuzhiyun *
636*4882a593Smuzhiyun * Parameters: event      (mod) Event object to set.
637*4882a593Smuzhiyun *             event_bits (in)  Event bits to set.
638*4882a593Smuzhiyun *
639*4882a593Smuzhiyun * Returns:    OSL_EXT_SUCCESS if the event was created successfully, or an
640*4882a593Smuzhiyun *             error code if the event could not be created.
641*4882a593Smuzhiyun *****************************************************************************
642*4882a593Smuzhiyun */
643*4882a593Smuzhiyun osl_ext_status_t osl_ext_event_set(osl_ext_event_t *event,
644*4882a593Smuzhiyun 	osl_ext_event_bits_t event_bits);
645*4882a593Smuzhiyun 
646*4882a593Smuzhiyun /* --------------------------------------------------------------------------
647*4882a593Smuzhiyun ** Interrupt
648*4882a593Smuzhiyun */
649*4882a593Smuzhiyun 
650*4882a593Smuzhiyun /****************************************************************************
651*4882a593Smuzhiyun * Function:   osl_ext_interrupt_disable
652*4882a593Smuzhiyun *
653*4882a593Smuzhiyun * Purpose:    Disable CPU interrupt.
654*4882a593Smuzhiyun *
655*4882a593Smuzhiyun * Parameters: None.
656*4882a593Smuzhiyun *
657*4882a593Smuzhiyun * Returns:    The interrupt state before disable for restoring interrupt.
658*4882a593Smuzhiyun *****************************************************************************
659*4882a593Smuzhiyun */
660*4882a593Smuzhiyun osl_ext_interrupt_state_t osl_ext_interrupt_disable(void);
661*4882a593Smuzhiyun 
662*4882a593Smuzhiyun /****************************************************************************
663*4882a593Smuzhiyun * Function:   osl_ext_interrupt_restore
664*4882a593Smuzhiyun *
665*4882a593Smuzhiyun * Purpose:    Restore CPU interrupt state.
666*4882a593Smuzhiyun *
667*4882a593Smuzhiyun * Parameters: state (in)  Interrupt state to restore returned from
668*4882a593Smuzhiyun *                         osl_ext_interrupt_disable().
669*4882a593Smuzhiyun *
670*4882a593Smuzhiyun * Returns:   None.
671*4882a593Smuzhiyun *****************************************************************************
672*4882a593Smuzhiyun */
673*4882a593Smuzhiyun void osl_ext_interrupt_restore(osl_ext_interrupt_state_t state);
674*4882a593Smuzhiyun 
675*4882a593Smuzhiyun #else
676*4882a593Smuzhiyun 
677*4882a593Smuzhiyun /* ---- Constants and Types ---------------------------------------------- */
678*4882a593Smuzhiyun 
679*4882a593Smuzhiyun /* Interrupt control */
680*4882a593Smuzhiyun #define OSL_INTERRUPT_SAVE_AREA
681*4882a593Smuzhiyun #define OSL_DISABLE
682*4882a593Smuzhiyun #define OSL_RESTORE
683*4882a593Smuzhiyun 
684*4882a593Smuzhiyun /* Semaphore. */
685*4882a593Smuzhiyun #define osl_ext_sem_t
686*4882a593Smuzhiyun #define OSL_EXT_SEM_DECL(sem)
687*4882a593Smuzhiyun 
688*4882a593Smuzhiyun /* Mutex. */
689*4882a593Smuzhiyun #define osl_ext_mutex_t
690*4882a593Smuzhiyun #define OSL_EXT_MUTEX_DECL(mutex)
691*4882a593Smuzhiyun 
692*4882a593Smuzhiyun /* Timer. */
693*4882a593Smuzhiyun #define osl_ext_timer_t
694*4882a593Smuzhiyun #define OSL_EXT_TIMER_DECL(timer)
695*4882a593Smuzhiyun 
696*4882a593Smuzhiyun /* Task. */
697*4882a593Smuzhiyun #define osl_ext_task_t void
698*4882a593Smuzhiyun #define OSL_EXT_TASK_DECL(task)
699*4882a593Smuzhiyun 
700*4882a593Smuzhiyun /* Queue. */
701*4882a593Smuzhiyun #define osl_ext_queue_t
702*4882a593Smuzhiyun #define OSL_EXT_QUEUE_DECL(queue)
703*4882a593Smuzhiyun 
704*4882a593Smuzhiyun /* Event. */
705*4882a593Smuzhiyun #define osl_ext_event_t
706*4882a593Smuzhiyun #define OSL_EXT_EVENT_DECL(event)
707*4882a593Smuzhiyun 
708*4882a593Smuzhiyun /* ---- Variable Externs ------------------------------------------------- */
709*4882a593Smuzhiyun /* ---- Function Prototypes ---------------------------------------------- */
710*4882a593Smuzhiyun 
711*4882a593Smuzhiyun #define osl_ext_sem_create(name, init_cnt, sem)		(OSL_EXT_SUCCESS)
712*4882a593Smuzhiyun #define osl_ext_sem_delete(sem)				(OSL_EXT_SUCCESS)
713*4882a593Smuzhiyun #define osl_ext_sem_give(sem)				(OSL_EXT_SUCCESS)
714*4882a593Smuzhiyun #define osl_ext_sem_take(sem, timeout_msec)		(OSL_EXT_SUCCESS)
715*4882a593Smuzhiyun 
716*4882a593Smuzhiyun #define osl_ext_mutex_create(name, mutex)		(OSL_EXT_SUCCESS)
717*4882a593Smuzhiyun #define osl_ext_mutex_delete(mutex)			(OSL_EXT_SUCCESS)
718*4882a593Smuzhiyun #define osl_ext_mutex_acquire(mutex, timeout_msec)	(OSL_EXT_SUCCESS)
719*4882a593Smuzhiyun #define osl_ext_mutex_release(mutex)			(OSL_EXT_SUCCESS)
720*4882a593Smuzhiyun 
721*4882a593Smuzhiyun #define osl_ext_timer_create(name, timeout_msec, mode, func, arg, timer) \
722*4882a593Smuzhiyun 	(OSL_EXT_SUCCESS)
723*4882a593Smuzhiyun #define osl_ext_timer_delete(timer)			(OSL_EXT_SUCCESS)
724*4882a593Smuzhiyun #define osl_ext_timer_start(timer, timeout_msec, mode)	(OSL_EXT_SUCCESS)
725*4882a593Smuzhiyun #define osl_ext_timer_stop(timer)			(OSL_EXT_SUCCESS)
726*4882a593Smuzhiyun #define osl_ext_time_get()				(0)
727*4882a593Smuzhiyun 
728*4882a593Smuzhiyun #define osl_ext_task_create(name, stack, stack_size, priority, func, arg, task) \
729*4882a593Smuzhiyun 	(OSL_EXT_SUCCESS)
730*4882a593Smuzhiyun #define osl_ext_task_delete(task)			(OSL_EXT_SUCCESS)
731*4882a593Smuzhiyun #define osl_ext_task_current()				(NULL)
732*4882a593Smuzhiyun #define osl_ext_task_yield()				(OSL_EXT_SUCCESS)
733*4882a593Smuzhiyun #define osl_ext_task_enable_stack_check()		(OSL_EXT_SUCCESS)
734*4882a593Smuzhiyun 
735*4882a593Smuzhiyun #define osl_ext_queue_create(name, queue_buffer, queue_size, queue) \
736*4882a593Smuzhiyun 	(OSL_EXT_SUCCESS)
737*4882a593Smuzhiyun #define osl_ext_queue_delete(queue)			(OSL_EXT_SUCCESS)
738*4882a593Smuzhiyun #define osl_ext_queue_send(queue, data)			(OSL_EXT_SUCCESS)
739*4882a593Smuzhiyun #define osl_ext_queue_send_synchronous(queue, data)	(OSL_EXT_SUCCESS)
740*4882a593Smuzhiyun #define osl_ext_queue_receive(queue, timeout_msec, data) \
741*4882a593Smuzhiyun 	(OSL_EXT_SUCCESS)
742*4882a593Smuzhiyun #define osl_ext_queue_count(queue, count)		(OSL_EXT_SUCCESS)
743*4882a593Smuzhiyun 
744*4882a593Smuzhiyun #define osl_ext_event_create(name, event)		(OSL_EXT_SUCCESS)
745*4882a593Smuzhiyun #define osl_ext_event_delete(event)			(OSL_EXT_SUCCESS)
746*4882a593Smuzhiyun #define osl_ext_event_get(event, requested, timeout_msec, event_bits) \
747*4882a593Smuzhiyun 	(OSL_EXT_SUCCESS)
748*4882a593Smuzhiyun #define osl_ext_event_set(event, event_bits)		(OSL_EXT_SUCCESS)
749*4882a593Smuzhiyun 
750*4882a593Smuzhiyun #define osl_ext_interrupt_disable(void)			(0)
751*4882a593Smuzhiyun #define osl_ext_interrupt_restore(state)
752*4882a593Smuzhiyun 
753*4882a593Smuzhiyun #endif	/* OSL_EXT_DISABLED */
754*4882a593Smuzhiyun 
755*4882a593Smuzhiyun #ifdef __cplusplus
756*4882a593Smuzhiyun }
757*4882a593Smuzhiyun #endif
758*4882a593Smuzhiyun 
759*4882a593Smuzhiyun #endif	/* _osl_ext_h_ */
760