# QMSS Low Level Driver OSAL Functions
[QMSS]

## Defines

#define | Qmss_osalMalloc Osal_qmssMalloc
| The macro is used by the QMSS LLD to allocate memory of specified size.
#define | Qmss_osalFree Osal_qmssFree
| The macro is used by the QMSS LLD to free a allocated block of memory.
#define | Qmss_osalCsEnter Osal_qmssCsEnter
| The macro is used by the QMSS LLD to provide critical sections to protect global and shared variables from.
#define | Qmss_osalCsExit Osal_qmssCsExit
| The macro is used by the QMSS LLD to exit a critical section protected using Osal_qmssCsEnter() API.
#define | Qmss_osalMtCsEnter Osal_qmssMtCsEnter
| The macro is used by the QMSS LLD to provide critical sections to protect global and shared variables from.
#define | Qmss_osalMtCsExit Osal_qmssMtCsExit
| The macro is used by the QMSS LLD to exit a critical section protected using Osal_qmssMtCsEnter() API.
#define | Qmss_osalLog Osal_qmssLog
| The macro is used by the QMSS LLD to log various messages.
#define | Qmss_osalBeginMemAccess Osal_qmssBeginMemAccess
| The macro is used by the QMSS LLD to indicate that a block of memory is about to be accessed. If the memory block is cached then this indicates that the application would need to ensure that the cache is updated with the data from the actual memory.
#define | Qmss_osalEndMemAccess Osal_qmssEndMemAccess
| The macro is used by the QMSS LLD to indicate that the block of memory has finished being accessed. If the memory block is cached then the application would need to ensure that the contents of the cache are updated immediately to the actual memory.
#define | Qmss_osalVirtToPhy(x) x
| The macro is used by the QMSS LLD to get the Physical address for a given Virtual address.
#define | Qmss_osalPhyToVirt(x) x
| The macro is used by the QMSS LLD to get the Virtual address for a given Physical address.
#define | Qmss_osalConvertDescVirtToPhy(x) x
| This callback should traverse the descriptor and convert all address references from virtual to physical.
#define | Qmss_osalConvertDescPhyToVirt(x) x
| This callback should traverse the descriptor and convert all address references from physical to virtual.

## Define Documentation

#define Qmss_osalBeginMemAccess Osal_qmssBeginMemAccess

The macro is used by the QMSS LLD to indicate that a block of memory is about to be accessed. If the memory block is cached then this indicates that the application would need to ensure that the cache is updated with the data from the actual memory.

Prototype: The following is the C prototype for the expected OSAL API.

           void Osal_qmssBeginMemAccess (void *ptr, uint32_t size)

Parameter
Address of memory block.
Size of memory block.

Return Value
Not applicable.

#define Qmss_osalConvertDescPhyToVirt | ( | x |  | ) | x

This callback should traverse the descriptor and convert all address references from physical to virtual.

Prototype: The following is the C prototype for the expected OSAL API.

           void* Qmss_osalConvertDescPhyToVirt(void *descAddr)

Parameter
Physical Address of the descriptor.

Return Value
Virtual address of the descriptor.

#define Qmss_osalConvertDescVirtToPhy | ( | x |  | ) | x

This callback should traverse the descriptor and convert all address references from virtual to physical.

Prototype: The following is the C prototype for the expected OSAL API.

           void* Qmss_osalConvertDescVirtToPhy(void *descAddr)

Parameter
Virtual Address of the descriptor.

Return Value
Physical address of the descriptor.

#define Qmss_osalCsEnter Osal_qmssCsEnter

The macro is used by the QMSS LLD to provide critical sections to protect global and shared variables from.

access from multiple cores and access from multiple threads on single core

Prototype: The following is the C prototype for the expected OSAL API.

           void* Osal_qmssCsEnter (void)

Parameter
None.

Return Value
Handle used to lock critical section.

#define Qmss_osalCsExit Osal_qmssCsExit

The macro is used by the QMSS LLD to exit a critical section protected using Osal_qmssCsEnter() API.

Prototype: The following is the C prototype for the expected OSAL API.

           void Osal_qmssCsExit (void *CsHandle)

Parameter
Handle for unlocking critical section.

Return Value
Not applicable.

#define Qmss_osalEndMemAccess Osal_qmssEndMemAccess

The macro is used by the QMSS LLD to indicate that the block of memory has finished being accessed. If the memory block is cached then the application would need to ensure that the contents of the cache are updated immediately to the actual memory.

Prototype: The following is the C prototype for the expected OSAL API.

           void Osal_qmssEndMemAccess (void *ptr, uint32_t size)

Parameter
Address of memory block.
Size of memory block.

Return Value
Not applicable.

#define Qmss_osalFree Osal_qmssFree

The macro is used by the QMSS LLD to free a allocated block of memory.

Prototype: The following is the C prototype for the expected OSAL API.

           void Osal_qmssFree (void *ptr, uint32_t size)

Parameter
Pointer to the block of memory to be cleaned up.
Size of the allocated memory which is being freed.

Return Value
Not applicable.

#define Qmss_osalLog Osal_qmssLog

The macro is used by the QMSS LLD to log various messages.

Prototype: The following is the C prototype for the expected OSAL API.

           void Osal_qmssLog( char *fmt, ... )

Parameter
printf-style format string

Return Value
Not applicable.

#define Qmss_osalMalloc Osal_qmssMalloc

The macro is used by the QMSS LLD to allocate memory of specified size.

Prototype: The following is the C prototype for the expected OSAL API.

           void* Osal_qmssMalloc (uint32_t numBytes)

Parameter
Number of bytes to be allocated

Return Value
Pointer to the allocated block size

#define Qmss_osalMtCsEnter Osal_qmssMtCsEnter

The macro is used by the QMSS LLD to provide critical sections to protect global and shared variables from.

access from multiple threads on single core

Prototype: The following is the C prototype for the expected OSAL API.

           void* Osal_qmssMtCsEnter (void)

Parameter
None.

Return Value
Handle used to lock critical section.

#define Qmss_osalMtCsExit Osal_qmssMtCsExit

The macro is used by the QMSS LLD to exit a critical section protected using Osal_qmssMtCsEnter() API.

Prototype: The following is the C prototype for the expected OSAL API.

           void Osal_qmssMtCsExit (void *CsHandle)

Parameter
Handle for unlocking critical section.

Return Value
Not applicable.

#define Qmss_osalPhyToVirt | ( | x |  | ) | x

The macro is used by the QMSS LLD to get the Virtual address for a given Physical address.

Prototype: The following is the C prototype for the expected OSAL API.

           void *Osal_qmssPhyToVirt (void *ptr)

Parameter
Physical Address of memory block.

Return Value
Virtual address.

#define Qmss_osalVirtToPhy | ( | x |  | ) | x

The macro is used by the QMSS LLD to get the Physical address for a given Virtual address.

Prototype: The following is the C prototype for the expected OSAL API.

           void *Osal_qmssVirtToPhy (void *ptr)

Parameter
Virtual Address of memory block.

Return Value
Physical address.

Copyright 2012, Texas Instruments Incorporated