0
|
1 |
/*
|
|
2 |
* osApi.h
|
|
3 |
*
|
|
4 |
* Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved.
|
|
5 |
* All rights reserved.
|
|
6 |
*
|
|
7 |
* This program and the accompanying materials are made available under the
|
|
8 |
* terms of the Eclipse Public License v1.0 or BSD License which accompanies
|
|
9 |
* this distribution. The Eclipse Public License is available at
|
|
10 |
* http://www.eclipse.org/legal/epl-v10.html and the BSD License is as below.
|
|
11 |
*
|
|
12 |
* Redistribution and use in source and binary forms, with or without
|
|
13 |
* modification, are permitted provided that the following conditions
|
|
14 |
* are met:
|
|
15 |
*
|
|
16 |
* * Redistributions of source code must retain the above copyright
|
|
17 |
* notice, this list of conditions and the following disclaimer.
|
|
18 |
* * Redistributions in binary form must reproduce the above copyright
|
|
19 |
* notice, this list of conditions and the following disclaimer in
|
|
20 |
* the documentation and/or other materials provided with the
|
|
21 |
* distribution.
|
|
22 |
* * Neither the name Texas Instruments nor the names of its
|
|
23 |
* contributors may be used to endorse or promote products derived
|
|
24 |
* from this software without specific prior written permission.
|
|
25 |
*
|
|
26 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
27 |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
28 |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
29 |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
30 |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
31 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
32 |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
33 |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
34 |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
35 |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
36 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
37 |
*/
|
|
38 |
|
|
39 |
|
|
40 |
/*--------------------------------------------------------------------------*/
|
|
41 |
/* Module: OSAPI.H*/
|
|
42 |
/**/
|
|
43 |
/* Purpose: This module defines unified interface to the OS specific*/
|
|
44 |
/* sources and services.*/
|
|
45 |
/**/
|
|
46 |
/*--------------------------------------------------------------------------*/
|
|
47 |
|
|
48 |
#ifndef __OS_API_H__
|
|
49 |
#define __OS_API_H__
|
|
50 |
|
|
51 |
/** \file osApi.h
|
|
52 |
* \brief Operating System APIs \n
|
|
53 |
* This module defines unified interface to the OS specific sources and services
|
|
54 |
*/
|
|
55 |
|
|
56 |
#include "tidef.h"
|
|
57 |
#include "TI_IPC_Api.h"
|
|
58 |
#include "OsApiDepend.h"
|
|
59 |
|
|
60 |
#ifdef __cplusplus
|
|
61 |
extern "C" {
|
|
62 |
#endif
|
|
63 |
|
|
64 |
/** \struct TI_CONNECTION_STATUS
|
|
65 |
* \struct *PTI_CONNECTION_STATUS
|
|
66 |
* \brief Ti Connection Status
|
|
67 |
*
|
|
68 |
* \par Description
|
|
69 |
*
|
|
70 |
* \sa
|
|
71 |
*/
|
|
72 |
typedef struct
|
|
73 |
{
|
|
74 |
TI_UINT32 Event;
|
|
75 |
TI_UINT8* Data;
|
|
76 |
} TI_CONNECTION_STATUS, *PTI_CONNECTION_STATUS;
|
|
77 |
|
|
78 |
#define OS_PAGE_SIZE 4096
|
|
79 |
#define MAX_MESSAGE_SIZE 500
|
|
80 |
#define MICROSECOND_IN_SECONDS 1000000
|
|
81 |
|
|
82 |
/****************************************************************************************
|
|
83 |
START OF OS API (Common to all GWSI LIB, Driver and TI Driver)
|
|
84 |
*****************************************************************************************/
|
|
85 |
|
|
86 |
|
|
87 |
/****************************************************************************************
|
|
88 |
OS HW API NEEDED BY DRIVER
|
|
89 |
*****************************************************************************************/
|
|
90 |
|
|
91 |
/** \brief OS Disable IRQ
|
|
92 |
*
|
|
93 |
* \param OsContext - Handle to the OS object
|
|
94 |
* \return void
|
|
95 |
*
|
|
96 |
* \par Description
|
|
97 |
* This function disables the Interrupts
|
|
98 |
*
|
|
99 |
* \sa
|
|
100 |
*/
|
|
101 |
void os_disableIrq (TI_HANDLE OsContext);
|
|
102 |
|
|
103 |
/** \brief OS Enable IRQ
|
|
104 |
*
|
|
105 |
* \param OsContext - Handle to the OS object
|
|
106 |
* \return void
|
|
107 |
*
|
|
108 |
* \par Description
|
|
109 |
* This function enables the Interrupts
|
|
110 |
*
|
|
111 |
* \sa
|
|
112 |
*/
|
|
113 |
void os_enableIrq (TI_HANDLE OsContext);
|
|
114 |
|
|
115 |
/****************************************************************************************
|
|
116 |
* OS Report API *
|
|
117 |
****************************************************************************************/
|
|
118 |
|
|
119 |
/** \brief OS Set Debug Mode
|
|
120 |
*
|
|
121 |
* \param enable - Indicates if debug mode should be enabled or disabled ( TI_TRUE | TI_FALSE )
|
|
122 |
* \return void
|
|
123 |
*
|
|
124 |
* \par Description
|
|
125 |
* This function sets the Debug Mode flag to True or False - according to user's request
|
|
126 |
*
|
|
127 |
* \sa
|
|
128 |
*/
|
|
129 |
void os_setDebugMode (TI_BOOL enable);
|
|
130 |
|
|
131 |
/** \brief OS Printf
|
|
132 |
*
|
|
133 |
* \param format - String to print (with formatted parametrs in string if needed) and parameters values
|
|
134 |
* if formatted parameters are used in string
|
|
135 |
* \return void
|
|
136 |
*
|
|
137 |
* \par Description
|
|
138 |
* This function prints formatted output using OS available printf method
|
|
139 |
*
|
|
140 |
* \sa
|
|
141 |
*/
|
|
142 |
void os_printf (const char *format ,...);
|
|
143 |
|
|
144 |
/****************************************************************************************
|
|
145 |
* OS Memory API *
|
|
146 |
****************************************************************************************/
|
|
147 |
|
|
148 |
/** \brief OS Memory Allocation
|
|
149 |
*
|
|
150 |
* \param OsContext - Handle to the OS object
|
|
151 |
* \param Size - Size (in bytes) to be allocated
|
|
152 |
* \return Pointer to the allocated memory on success ; NULL on failure (there isn't enough memory available)
|
|
153 |
*
|
|
154 |
* \par Description
|
|
155 |
* This function allocates resident (nonpaged) system-space memory with calling specific OS allocation function. \n
|
|
156 |
* It is assumed that this function will never be called in an interrupt context since the OS allocation function
|
|
157 |
* has the potential to put the caller to sleep while waiting for memory to become available.
|
|
158 |
*
|
|
159 |
* \sa
|
|
160 |
*/
|
|
161 |
void *os_memoryAlloc (TI_HANDLE OsContext,TI_UINT32 Size,TI_BOOL MemoryType);
|
|
162 |
|
|
163 |
/** \brief OS Memory CAllocation
|
|
164 |
*
|
|
165 |
* \param OsContext - Handle to the OS object
|
|
166 |
* \param Number - Number of element to be allocated
|
|
167 |
* \param Size - Size (in bytes) of one element
|
|
168 |
* \return Pointer to the allocated memory on success ; NULL on failure (there isn't enough memory available)
|
|
169 |
*
|
|
170 |
* \par Description
|
|
171 |
* This function allocates an array in memory with elements initialized to 0.
|
|
172 |
* Allocates resident (nonpaged) system-space memory for an array with elements initialized to 0,
|
|
173 |
* with specific OS allocation function.
|
|
174 |
* It is assumed that this function will never be called in an interrupt context since the OS allocation function
|
|
175 |
* has the potential to put the caller to sleep while waiting for memory to become available.
|
|
176 |
*
|
|
177 |
* \sa
|
|
178 |
*/
|
|
179 |
void *os_memoryCAlloc (TI_HANDLE OsContext, TI_UINT32 Number, TI_UINT32 Size);
|
|
180 |
|
|
181 |
/** \brief OS Memory Set
|
|
182 |
*
|
|
183 |
* \param OsContext - Handle to the OS object
|
|
184 |
* \param pMemPtr - Pointer to the base address of a memory block
|
|
185 |
* \param Value - Value to set to memory block
|
|
186 |
* \param Length - Length (in bytes) of memory block
|
|
187 |
* \return void
|
|
188 |
*
|
|
189 |
* \par Description
|
|
190 |
* This function fills a block of memory with a given value
|
|
191 |
*
|
|
192 |
* \sa
|
|
193 |
*/
|
|
194 |
void os_memorySet (TI_HANDLE OsContext, void *pMemPtr, TI_INT32 Value, TI_UINT32 Length);
|
|
195 |
|
|
196 |
/** \brief OS Memory Zero
|
|
197 |
*
|
|
198 |
* \param OsContext - Handle to the OS object
|
|
199 |
* \param pMemPtr - Pointer to the base address of a memory block
|
|
200 |
* \param Length - Length (in bytes) of memory block
|
|
201 |
* \return void
|
|
202 |
*
|
|
203 |
* \par Description
|
|
204 |
* This function fills a block of memory with zeros
|
|
205 |
*
|
|
206 |
* \sa
|
|
207 |
*/
|
|
208 |
void os_memoryZero (TI_HANDLE OsContext, void *pMemPtr, TI_UINT32 Length);
|
|
209 |
|
|
210 |
/** \brief OS Memory Copy
|
|
211 |
*
|
|
212 |
* \param OsContext - Handle to the OS object
|
|
213 |
* \param pDestination - Pointer to destination buffer
|
|
214 |
* \param pSource - Pointer to Source buffer
|
|
215 |
* \param Size - Size (in bytes) to copy
|
|
216 |
* \return void
|
|
217 |
*
|
|
218 |
* \par Description
|
|
219 |
* This function copies a specified number of bytes from one caller-supplied location (source buffer) to another (destination buffer)
|
|
220 |
*
|
|
221 |
* \sa
|
|
222 |
*/
|
|
223 |
void os_memoryCopy (TI_HANDLE OsContext, void *pDestination, void *pSource, TI_UINT32 Size);
|
|
224 |
|
|
225 |
/** \brief OS Memory Free
|
|
226 |
*
|
|
227 |
* \param OsContext - Handle to the OS object
|
|
228 |
* \param pMemPtr - Pointer to the base address of a memory block
|
|
229 |
* \param Size - Size (in bytes) to free
|
|
230 |
* \return void
|
|
231 |
*
|
|
232 |
* \par Description
|
|
233 |
* This function releases a block of memory which was previously allocated by user
|
|
234 |
*
|
|
235 |
* \sa
|
|
236 |
*/
|
|
237 |
void os_memoryFree (TI_HANDLE OsContext, void *pMemPtr, TI_UINT32 Size);
|
|
238 |
|
|
239 |
/** \brief OS Memory Compare
|
|
240 |
*
|
|
241 |
* \param OsContext - Handle to the OS object
|
|
242 |
* \param Buf1 - Pointer to the first buffer in comperation
|
|
243 |
* \param Buf2 - Pointer to the second buffer in comperation
|
|
244 |
* \param Count - Count (in bytes) to compare
|
|
245 |
* \return A value which indicates the relationship between the two compared buffers:
|
|
246 |
* value < 0: Buf1 less than Buf2
|
|
247 |
* value == 0: Buf1 identical to Buf2
|
|
248 |
* value > 0: Buf1 greater than Buf2
|
|
249 |
*
|
|
250 |
* \par Description
|
|
251 |
* This function compares between two given buffers
|
|
252 |
*
|
|
253 |
* \sa
|
|
254 |
*/
|
|
255 |
TI_INT32 os_memoryCompare (TI_HANDLE OsContext, TI_UINT8* Buf1, TI_UINT8* Buf2, TI_INT32 Count);
|
|
256 |
|
|
257 |
/** \brief OS Memory Allocation for HW DMA
|
|
258 |
*
|
|
259 |
* \param pOsContext - Handle to the OS object
|
|
260 |
* \param Size - Size (in bytes) to allocate
|
|
261 |
* \return Pointer to the allocated memory on success ; NULL on failure (there isn't enough memory available)
|
|
262 |
*
|
|
263 |
* \par Description
|
|
264 |
* This function allocates resident (nonpaged) system-space memory for HW DMA operations
|
|
265 |
*
|
|
266 |
* \sa
|
|
267 |
*/
|
|
268 |
void *os_memoryAlloc4HwDma (TI_HANDLE pOsContext, TI_UINT32 Size);
|
|
269 |
|
|
270 |
/** \brief OS Memory for HW DMA Free
|
|
271 |
*
|
|
272 |
* \param pOsContext - Handle to the OS object
|
|
273 |
* \param pMem_ptr - Pointer to the base virtual address of allocated memory block
|
|
274 |
* This is the address that was returned to user when he allocated the memory for HW DMA usage
|
|
275 |
* \param Size - Size (in bytes) of the memory block to be released. This parameter must be identical to the Length
|
|
276 |
* which was given by the user when he allocated the memory block for HW DMA usage
|
|
277 |
* \return Pointer to the allocated memory on success ; NULL on failure (there isn't enough memory available)
|
|
278 |
*
|
|
279 |
* \par Description
|
|
280 |
* This function releases a block of memory previously allocated by user for HW DMA operations
|
|
281 |
*
|
|
282 |
* \sa
|
|
283 |
*/
|
|
284 |
void os_memory4HwDmaFree (TI_HANDLE pOsContext, void *pMem_ptr, TI_UINT32 Size);
|
|
285 |
|
|
286 |
/** \brief OS Memory Copy from User
|
|
287 |
*
|
|
288 |
* \param OsContext - Handle to the OS object
|
|
289 |
* \param pDstPtr - Pointer to destination buffer
|
|
290 |
* \param pSrcPtr - Pointer to Source buffer
|
|
291 |
* \param Size - Size (in bytes) to copy
|
|
292 |
* \return TI_OK on success ; TI_NOK otherwise
|
|
293 |
*
|
|
294 |
* \par Description
|
|
295 |
* This function copies a specified number of bytes from one caller-supplied location (Source) to another (Destination)
|
|
296 |
*
|
|
297 |
* \sa
|
|
298 |
*/
|
|
299 |
int os_memoryCopyFromUser (TI_HANDLE OsContext, void *pDstPtr, void *pSrcPtr, TI_UINT32 Size);
|
|
300 |
|
|
301 |
/** \brief OS Memory Copy To User
|
|
302 |
*
|
|
303 |
* \param OsContext - Handle to the OS object
|
|
304 |
* \param pDstPtr - Pointer to destination buffer
|
|
305 |
* \param pSrcPtr - Pointer to Source buffer
|
|
306 |
* \param Size - Size (in bytes) to copy
|
|
307 |
* \return TI_OK on success ; TI_NOK otherwise
|
|
308 |
*
|
|
309 |
* \par Description
|
|
310 |
* This function copies a specified number of bytes from one caller-supplied location (Source) to another (Destination)
|
|
311 |
*
|
|
312 |
* \sa
|
|
313 |
*/
|
|
314 |
int os_memoryCopyToUser (TI_HANDLE OsContext, void *pDstPtr, void *pSrcPtr, TI_UINT32 Size);
|
|
315 |
|
|
316 |
/****************************************************************************************
|
|
317 |
* OS TIMER API *
|
|
318 |
****************************************************************************************/
|
|
319 |
/** \brief Timer Callback Function
|
|
320 |
*
|
|
321 |
* \param Context - Handle to the OS object
|
|
322 |
* \return void
|
|
323 |
*
|
|
324 |
* \par Description
|
|
325 |
* This callback is passed by user to OS timer when created, and is called directly from OS timer context when expired.
|
|
326 |
* E.g. the user user the timer in order to operate this function after a defined time expires
|
|
327 |
*
|
|
328 |
*/
|
|
329 |
typedef void (*fTimerFunction)(TI_HANDLE Context);
|
|
330 |
|
|
331 |
/** \brief OS Timer Create
|
|
332 |
*
|
|
333 |
* \param OsContext - Handle to the OS object
|
|
334 |
* \param pRoutine - Pointer to user's Timer Callback function
|
|
335 |
* \param hFuncHandle - Handle to user's Timer Callback function parameters
|
|
336 |
* \return Handle to timer object on success ; NULL on failure
|
|
337 |
*
|
|
338 |
* \par Description
|
|
339 |
* This function creates and initializes an OS timer object associated with a user's Timer Callback function \n
|
|
340 |
* \note 1) The user's callback is called directly from OS timer context when expired.
|
|
341 |
* \note 2) In some OSs, it may be needed to use an intermediate callback in the
|
|
342 |
* \note osapi layer (use os_timerHandlr for that).
|
|
343 |
*
|
|
344 |
* \sa
|
|
345 |
*/
|
|
346 |
TI_HANDLE os_timerCreate (TI_HANDLE OsContext, fTimerFunction pRoutine, TI_HANDLE hFuncHandle);
|
|
347 |
|
|
348 |
/** \brief OS Timer Destroy
|
|
349 |
*
|
|
350 |
* \param OsContext - Handle to the OS object
|
|
351 |
* \param TimerHandle - Handle to timer object which user got when created the timer
|
|
352 |
* \return void
|
|
353 |
*
|
|
354 |
* \par Description
|
|
355 |
* This function destroys the OS timer object which was previously created by user
|
|
356 |
*
|
|
357 |
* \sa
|
|
358 |
*/
|
|
359 |
void os_timerDestroy (TI_HANDLE OsContext, TI_HANDLE TimerHandle);
|
|
360 |
|
|
361 |
/** \brief OS Timer Start
|
|
362 |
*
|
|
363 |
* \param OsContext - Handle to the OS object
|
|
364 |
* \param TimerHandle - Handle to timer object which user got when created the timer
|
|
365 |
* \param DelayMs - The time in MS untill the timer is awaken
|
|
366 |
* \return void
|
|
367 |
*
|
|
368 |
* \par Description
|
|
369 |
* This function Start the OS timer object which was previously created by user
|
|
370 |
*
|
|
371 |
* \sa
|
|
372 |
*/
|
|
373 |
void os_timerStart (TI_HANDLE OsContext, TI_HANDLE TimerHandle, TI_UINT32 DelayMs);
|
|
374 |
|
|
375 |
/** \brief OS Timer Stop
|
|
376 |
*
|
|
377 |
* \param OsContext - Handle to the OS object
|
|
378 |
* \param TimerHandle - Handle to timer object which user got when created the timer
|
|
379 |
* \return void
|
|
380 |
*
|
|
381 |
* \par Description
|
|
382 |
* This function Stops the OS timer object which was previously created by user
|
|
383 |
*
|
|
384 |
* \sa
|
|
385 |
*/
|
|
386 |
void os_timerStop (TI_HANDLE OsContext, TI_HANDLE TimerHandle);
|
|
387 |
|
|
388 |
/** \brief OS Periodic Interrupt Timer Start
|
|
389 |
*
|
|
390 |
* \param OsContext - Handle to the OS object
|
|
391 |
* \return void
|
|
392 |
*
|
|
393 |
* \par Description
|
|
394 |
* This function starts the periodic interrupt mechanism. This function is used when PRIODIC_INTERRUPT mode is used.
|
|
395 |
* This Mode is enabled when interrupts that are usually received from the FW are masked,
|
|
396 |
* and there is need to check- in a given time periods - if handling of any FW interrupt is needed.
|
|
397 |
*
|
|
398 |
* \sa
|
|
399 |
*/
|
|
400 |
#ifdef PRIODIC_INTERRUPT
|
|
401 |
void os_periodicIntrTimerStart (TI_HANDLE OsContext);
|
|
402 |
#endif
|
|
403 |
|
|
404 |
/** \brief OS Time Stamp Ms
|
|
405 |
*
|
|
406 |
* \param OsContext - Handle to the OS object
|
|
407 |
* \return The number of milliseconds that have elapsed since the system was booted
|
|
408 |
*
|
|
409 |
* \par Description
|
|
410 |
* This function returns the number of milliseconds that have elapsed since the system was booted.
|
|
411 |
*/
|
|
412 |
TI_INT32 os_timeStampMs (TI_HANDLE OsContext);
|
|
413 |
|
|
414 |
/** \brief OS Time Stamp Us
|
|
415 |
*
|
|
416 |
* \param OsContext - Handle to the OS object
|
|
417 |
* \return The number of microseconds that have elapsed since the system was booted
|
|
418 |
*
|
|
419 |
* \par Description
|
|
420 |
* This function returns the number of microseconds that have elapsed since the system was booted. \n
|
|
421 |
* Note that sometimes this function will be called with NULL(!!!) as argument!
|
|
422 |
*/
|
|
423 |
TI_UINT32 os_timeStampUs (TI_HANDLE OsContext);
|
|
424 |
|
|
425 |
/** \brief OS Stall uSec
|
|
426 |
*
|
|
427 |
* \param OsContext - Handle to the OS object
|
|
428 |
* \param uSec - The time to delay in microseconds
|
|
429 |
* \return void
|
|
430 |
*
|
|
431 |
* \par Description
|
|
432 |
* This function makes delay in microseconds
|
|
433 |
*
|
|
434 |
* \sa
|
|
435 |
*/
|
|
436 |
void os_StalluSec (TI_HANDLE OsContext, TI_UINT32 uSec);
|
|
437 |
|
|
438 |
|
|
439 |
/****************************************************************************************
|
|
440 |
* Protection services API *
|
|
441 |
****************************************************************************************/
|
|
442 |
|
|
443 |
/** \brief OS Protect Create
|
|
444 |
*
|
|
445 |
* \param OsContext - Handle to the OS object
|
|
446 |
* \return Handle of the created mutex/spin lock object on Success ; NULL on Failure (not enough memory available or problems to initializing the mutex)
|
|
447 |
*
|
|
448 |
* \par Description
|
|
449 |
* This function allocates a mutex/spin lock object.
|
|
450 |
* The mutex/spinlock object which is created by this function is used for mutual-exclusion and protection of resources which are shared between
|
|
451 |
* multi-Tasks/Threads
|
|
452 |
*
|
|
453 |
* \sa
|
|
454 |
*/
|
|
455 |
TI_HANDLE os_protectCreate (TI_HANDLE OsContext);
|
|
456 |
|
|
457 |
/** \brief OS Protect Destroy
|
|
458 |
*
|
|
459 |
* \param OsContext - Handle to the OS object
|
|
460 |
* \param ProtectContext - Handle to the mutex/spin lock object
|
|
461 |
* \return void
|
|
462 |
*
|
|
463 |
* \par Description
|
|
464 |
* This function destroys s a mutex/spin lock object which was previously created by user:
|
|
465 |
* it frees the mutex/spin lock and then frees the object's memory
|
|
466 |
*
|
|
467 |
* \sa
|
|
468 |
*/
|
|
469 |
void os_protectDestroy (TI_HANDLE OsContext, TI_HANDLE ProtectContext);
|
|
470 |
|
|
471 |
#ifdef DRIVER_PROFILING
|
|
472 |
/** \brief OS Profile
|
|
473 |
*
|
|
474 |
* \param OsContext - Handle to the OS object
|
|
475 |
* \param fn -
|
|
476 |
* \param par -
|
|
477 |
* \return void
|
|
478 |
*
|
|
479 |
* \par Description
|
|
480 |
*
|
|
481 |
* \sa
|
|
482 |
*/
|
|
483 |
void _os_profile (TI_HANDLE OsContext, TI_UINT32 fn, TI_UINT32 par);
|
|
484 |
#define os_profile(hos,fn,par) _os_profile (hos, fn, par)
|
|
485 |
#else
|
|
486 |
#define os_profile(hos,fn,par)
|
|
487 |
#endif
|
|
488 |
|
|
489 |
|
|
490 |
/****************************************************************************************
|
|
491 |
START OF GWSI DRIVER API
|
|
492 |
*****************************************************************************************/
|
|
493 |
|
|
494 |
/** \brief OS Signaling Object Create
|
|
495 |
*
|
|
496 |
* \param OsContext - Handle to the OS object
|
|
497 |
* \return Pointer to Signal Object on Success ; NULL on Failure
|
|
498 |
*
|
|
499 |
* \par Description
|
|
500 |
* This function creates a new Signaling Object or opens an already exists Signaling Object.
|
|
501 |
* The Signaling Object created by this function is used for mutual-exclusion and protection
|
|
502 |
* of resources which are shared between multi-Tasks/Threads by using a signaling mechanism
|
|
503 |
*
|
|
504 |
* \sa
|
|
505 |
*/
|
|
506 |
void *os_SignalObjectCreate (TI_HANDLE OsContext);
|
|
507 |
|
|
508 |
/** \brief OS Signaling Object Wait
|
|
509 |
*
|
|
510 |
* \param OsContext - Handle to the OS object
|
|
511 |
* \param ptr - Pointer to Signaling Object previously created by user
|
|
512 |
* \return TI_OK (0) on Success ; TI_NOK (1) on Failure
|
|
513 |
*
|
|
514 |
* \par Description
|
|
515 |
* This function perform waiting on Signaling Object. The coller waits until signaled or until timeout
|
|
516 |
*
|
|
517 |
* \sa
|
|
518 |
*/
|
|
519 |
int os_SignalObjectWait (TI_HANDLE OsContext, void *ptr);
|
|
520 |
|
|
521 |
/** \brief OS Signaling Object Set
|
|
522 |
*
|
|
523 |
* \param OsContext - Handle to the OS object
|
|
524 |
* \param ptr - Pointer to Signaling Object previously created by user
|
|
525 |
* \return TI_OK (0) on Success ; TI_NOK (1) on Failure
|
|
526 |
*
|
|
527 |
* \par Description
|
|
528 |
* This function sets a Signaling Object to signaled state (e.g the siganeling object is released)
|
|
529 |
*
|
|
530 |
* \sa
|
|
531 |
*/
|
|
532 |
int os_SignalObjectSet (TI_HANDLE OsContext, void *ptr);
|
|
533 |
|
|
534 |
/** \brief OS Signaling Object Free
|
|
535 |
*
|
|
536 |
* \param OsContext - Handle to the OS object
|
|
537 |
* \param ptr - Pointer to Signaling Object previously created by user
|
|
538 |
* \return TI_OK (0) on Success ; TI_NOK (1) on Failure
|
|
539 |
*
|
|
540 |
* \par Description
|
|
541 |
* This function frees (closes) a Signaling Object Handle
|
|
542 |
*
|
|
543 |
* \sa
|
|
544 |
*/
|
|
545 |
int os_SignalObjectFree (TI_HANDLE OsContext, void *ptr);
|
|
546 |
|
|
547 |
/****************************************************************************************
|
|
548 |
START OF TI DRIVER API
|
|
549 |
*****************************************************************************************/
|
|
550 |
|
|
551 |
/** \brief OS Read Memory Register UINT32
|
|
552 |
*
|
|
553 |
* \param OsContext - Handle to the OS object
|
|
554 |
* \param Register - Pointer to register address
|
|
555 |
* \param Data - Pointer to output read data
|
|
556 |
* \return void
|
|
557 |
*
|
|
558 |
* \par Description
|
|
559 |
* This function reads register in 32 bit length
|
|
560 |
*
|
|
561 |
* \sa
|
|
562 |
*/
|
|
563 |
void os_hwReadMemRegisterUINT32 (TI_HANDLE OsContext, TI_UINT32* Register, TI_UINT32* Data);
|
|
564 |
|
|
565 |
/** \brief OS Write Memory Register UINT32
|
|
566 |
*
|
|
567 |
* \param OsContext - Handle to the OS object
|
|
568 |
* \param Register - Pointer to register address
|
|
569 |
* \param Data - Data to write to register
|
|
570 |
* \return void
|
|
571 |
*
|
|
572 |
* \par Description
|
|
573 |
* This function reads register in 32 bit length
|
|
574 |
*
|
|
575 |
* \sa
|
|
576 |
*/
|
|
577 |
void os_hwWriteMemRegisterUINT32 (TI_HANDLE OsContext, TI_UINT32* Register, TI_UINT32 Data);
|
|
578 |
|
|
579 |
/** \brief OS Receive Packet
|
|
580 |
*
|
|
581 |
* \param OsContext - Handle to the OS object
|
|
582 |
* \param pPacket - Pointer to received packet data
|
|
583 |
* \param Length - Length of received packet
|
|
584 |
* \return TI_TRUE on Success ; TI_FALSE on Failure
|
|
585 |
*
|
|
586 |
* \par Description
|
|
587 |
* This function transfers a packet from WLAN driver to OS
|
|
588 |
*
|
|
589 |
* \sa
|
|
590 |
*/
|
|
591 |
TI_BOOL os_receivePacket (TI_HANDLE OsContext, void *pPacket, TI_UINT16 Length);
|
|
592 |
|
|
593 |
/** \brief OS Send Packet
|
|
594 |
*
|
|
595 |
* \param OsContext - Handle to the OS object
|
|
596 |
* \param pPacket - Pointer to sent packet data
|
|
597 |
* \param Length - Length of sent packet
|
|
598 |
* \return TI_TRUE on Success ; TI_FALSE on Failure
|
|
599 |
*
|
|
600 |
* \par Description
|
|
601 |
* This function transfers a packet from OS to WLAN driver
|
|
602 |
*
|
|
603 |
* \sa
|
|
604 |
*/
|
|
605 |
TI_INT32 os_sendPacket (TI_HANDLE OsContext, void *pPacket, TI_UINT16 Length);
|
|
606 |
|
|
607 |
/** \brief OS Indicate Event
|
|
608 |
*
|
|
609 |
* \param OsContext - Handle to the OS object
|
|
610 |
* \param pData - Pointer to event data
|
|
611 |
* \return TI_OK (0) on Success ;
|
|
612 |
*
|
|
613 |
* \par Description
|
|
614 |
* This function indicate the OS about different connection driver's events,
|
|
615 |
* The function performs the rewuired operations for the event - in the OS side
|
|
616 |
*
|
|
617 |
* \sa
|
|
618 |
*/
|
|
619 |
TI_INT32 os_IndicateEvent (TI_HANDLE OsContext, IPC_EV_DATA *pData);
|
|
620 |
|
|
621 |
#ifdef __cplusplus
|
|
622 |
}
|
|
623 |
#endif
|
|
624 |
|
|
625 |
#endif /* __OS_API_H__ */
|