# CPPI Low Level Driver OSAL Functions
[CPPI]

## Defines

#define | Cppi_osalMalloc Osal_cppiMalloc
| The macro is used by the CPPI LLD to allocate memory of specified size.
#define | Cppi_osalFree Osal_cppiFree
| The macro is used by the CPPI LLD to free a allocated block of memory.
#define | Cppi_osalCsEnter Osal_cppiCsEnter
| The macro is used by the CPPI LLD to provide critical sections to protect global and shared variables from.
#define | Cppi_osalCsExit Osal_cppiCsExit
| The macro is used by the CPPI LLD to exit a critical section protected using Osal_cppiCsEnter() API.
#define | Cppi_osalLog Osal_cppiLog
| The macro is used by the CPPI LLD to log various messages.
#define | Cppi_osalBeginMemAccess Osal_cppiBeginMemAccess
| The macro is used by the CPPI 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 | Cppi_osalEndMemAccess Osal_cppiEndMemAccess
| The macro is used by the CPPI 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 Documentation

#define Cppi_osalBeginMemAccess Osal_cppiBeginMemAccess

The macro is used by the CPPI 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_cppiBeginMemAccess (void *ptr, uint32_t size)

Parameter
Address of memory block.
Size of memory block.

Return Value
Not applicable.

#define Cppi_osalCsEnter Osal_cppiCsEnter

The macro is used by the CPPI 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_cppiCsEnter (void)

Parameter
None.

Return Value
Handle used to lock critical section.

#define Cppi_osalCsExit Osal_cppiCsExit

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

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

           void Osal_cppiCsExit (void *CsHandle)

Parameter
Handle for unlocking critical section.

Return Value
Not applicable.

#define Cppi_osalEndMemAccess Osal_cppiEndMemAccess

The macro is used by the CPPI 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_cppiEndMemAccess (void *ptr, uint32_t size)

Parameter
Address of memory block.
Size of memory block.

Return Value
Not applicable.

#define Cppi_osalFree Osal_cppiFree

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

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

           void Osal_cppiFree (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 Cppi_osalLog Osal_cppiLog

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

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

           void Osal_cppiLog( char *fmt, ... )

Parameter
printf-style format string

Return Value
Not applicable.

#define Cppi_osalMalloc Osal_cppiMalloc

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

Note: If the LLD is used by applications on multiple core, the "cppiHeap" should be in shared memory

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

           void* Osal_cppiMalloc (uint32_t numBytes)

Parameter
Number of bytes to be allocated

Return Value
Pointer to the allocated block size

Copyright 2012, Texas Instruments Incorporated