Defines
Trace Framework Operating System Abstraction Layer (OSAL) Functions

Defines

#define TF_CONSUMER_osalMemAlloc   Osal_consumer_MemAlloc
 The macro is used by the consumer Library to allocate the memory.
#define TF_CONSUMER_osalMemFree   Osal_consumer_MemFree
 The macro is used by the consumer Library to free the memory.
#define TF_CONSUMER_osalBeginMemAccess   Osal_consumer_BeginMemAccess
 The macro is used by the consumer Library to indicate that packet access has been accessed & updated . If the packet is in cached memory the implementation should writeback the contents of the packet.
#define TF_CONSUMER_osalEndMemAccess   Osal_consumer_EndMemAccess
 This macro is used to alert the application that the CONSUMER has completed access to table memory. This call will always be made following a call to Osal_CONSUMER BeginMemAccess and have the same parameters.
#define TF_CONSUMER_osalException   Osal_consumer_Exception
 This macro is used to alert the application that the CONSUMER has encountered an exception.
#define TF_CONTRACT_osalMemAlloc   Osal_contract_MemAlloc
 The macro is used by the trace framework Library to allocate the memory.
#define TF_CONTRACT_osalMemFree   Osal_contract_MemFree
 The macro is used by the trace framework Library to free the memory.
#define TF_CONTRACT_osalBeginMemAccess   Osal_contract_BeginMemAccess
 The macro is used by the producer/consumer Library to indicate that memory access has been accessed & updated . If the values are in cached memory the implementation should invalidate the contents of the cache.
#define TF_CONTRACT_osalEndMemAccess   Osal_contract_EndMemAccess
 The macro is used by the producer/consumer Library to indicate that memory access has been completed. If the values are in cached memory the implementation should writeback the contents of the contents.
#define TF_CONTRACT_osalEnter   Osal_contract_Enter
 The macro is used by the contract to indicate that memory access needs to be protected.
#define TF_CONTRACT_osalExit   Osal_contract_Exit
 The macro is used by the contract to indicate that memory access needs to be protected.
#define TF_CONTRACT_osalMmap   Osal_contract_mmap
 The macro is used by the trace framework Library to get the virtual address from Physical address (Applicable for ARM user mode library only)
#define TF_CONTRACT_osalUnmap   Osal_contract_unmap
 The macro is used by the trace framework Library to get the physical address from virtual address (Applicable for ARM user mode library only)
#define TF_PRODUCER_osalGetProcId   Osal_producer_GetProcId
 The macro is used by the trace framework Library to get the process ID.
#define TF_PRODUCER_osalMemAlloc   Osal_producer_MemAlloc
 The macro is used by the producer Library to allocate the memory.
#define TF_PRODUCER_osalMemFree   Osal_producer_MemFree
 The macro is used by the producer Library to free the memory.
#define TF_PRODUCER_osalBeginMemAccess   Osal_producer_BeginMemAccess
 The macro is used by the producer Library to indicate that packet access has been accessed & updated . If the packet is in cached memory the implementation should writeback the contents of the packet.
#define TF_PRODUCER_osalEndMemAccess   Osal_producer_EndMemAccess
 This macro is used to alert the application that the PRODUCER has completed access to table memory. This call will always be made following a call to Osal_PRODUCER BeginMemAccess and have the same parameters.
#define TF_PRODUCER_osalException   Osal_producer_Exception
 This macro is used to alert the application that the PRODUCER has encountered an exception.

Define Documentation

#define TF_CONSUMER_osalBeginMemAccess   Osal_consumer_BeginMemAccess

The macro is used by the consumer Library to indicate that packet access has been accessed & updated . If the packet is in cached memory the implementation should writeback the contents of the packet.

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

 *       void Osal_consumer_BeginMemAccess (void* addr, uint32_t sizeWords)
 *  

Parameter
addr - The address of the table to be accessed
sizeWords - The number of bytes in the table

Return Value
None

#define TF_CONSUMER_osalEndMemAccess   Osal_consumer_EndMemAccess

This macro is used to alert the application that the CONSUMER has completed access to table memory. This call will always be made following a call to Osal_CONSUMER BeginMemAccess and have the same parameters.

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

 *      void Osal_consumer_EndMemAccess (void* addr, uint32_t sizeWords)
 *  

Parameters
addr - The address of the table to be accessed
sizeWords - The number of bytes in the table

Note:
CONSUMER will make nested calls to this function for memory access protection of different memory tables. The multicore semaphore should be freed when all previous memory access has completed, in other words, when the nested call level reaches 0.
#define TF_CONSUMER_osalException   Osal_consumer_Exception

This macro is used to alert the application that the CONSUMER has encountered an exception.

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

 *      void Osal_consumer_Exception (uint32_t moduleId, uint32_t exception)
 *  

Parameters
addr - The address of the table to be accessed
sizeWords - The number of bytes in the table

Note:
CONSUMER will make nested calls to this function for memory access protection of different memory tables. The multicore semaphore should be freed when all previous memory access has completed, in other words, when the nested call level reaches 0.
#define TF_CONSUMER_osalMemAlloc   Osal_consumer_MemAlloc

The macro is used by the consumer Library to allocate the memory.

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

 *       void* Osal_consumer_MemAlloc (uint32_t num_bytes, uint32_t alignment)
 *  

Parameter
num_bytes - number of bytes to be allocated
alignment - memory alignment

Return Value
memory address allocated

#define TF_CONSUMER_osalMemFree   Osal_consumer_MemFree

The macro is used by the consumer Library to free the memory.

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

 *       void  Osal_consumer_MemFree (void* ptr, uint32_t size)
 *  

Parameter
ptr - memory base address to be freed
size - size of the mem block

Return Value
None

#define TF_CONTRACT_osalBeginMemAccess   Osal_contract_BeginMemAccess

The macro is used by the producer/consumer Library to indicate that memory access has been accessed & updated . If the values are in cached memory the implementation should invalidate the contents of the cache.

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

 *       void Osal_contract_BeginMemAccess (void* addr, uint32_t sizeWords)
 *  

Parameter
addr - Pointer to the memory address being accessed.
size - Size of the packet.

Return Value
None

#define TF_CONTRACT_osalEndMemAccess   Osal_contract_EndMemAccess

The macro is used by the producer/consumer Library to indicate that memory access has been completed. If the values are in cached memory the implementation should writeback the contents of the contents.

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

 *       void Osal_contract_EndMemAccess (void* addr, uint32_t sizeWords)
 *  

Parameter
addr - Pointer to the memory address being accessed.
size - Size of the packet.

Return Value
None

#define TF_CONTRACT_osalEnter   Osal_contract_Enter

The macro is used by the contract to indicate that memory access needs to be protected.

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

 *       void Osal_contract_Enter (void)
 *  

Parameter
None

Return Value
None

#define TF_CONTRACT_osalExit   Osal_contract_Exit

The macro is used by the contract to indicate that memory access needs to be protected.

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

 *       void Osal_contract_Exit (void)
 *  

Parameter
None

Return Value
None

#define TF_CONTRACT_osalMemAlloc   Osal_contract_MemAlloc

The macro is used by the trace framework Library to allocate the memory.

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

 *       void* Osal_contract_MemAlloc (uint32_t num_bytes, uint32_t alignment)
 *  

Parameter
num_bytes - number of bytes to be allocated
alignment - memory alignment

Return Value
memory address allocated

#define TF_CONTRACT_osalMemFree   Osal_contract_MemFree

The macro is used by the trace framework Library to free the memory.

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

 *       void  Osal_contract_MemFree (void* ptr, uint32_t size)
 *  

Parameter
ptr - memory base address to be freed
size - size of the mem block

Return Value
None

#define TF_CONTRACT_osalMmap   Osal_contract_mmap

The macro is used by the trace framework Library to get the virtual address from Physical address (Applicable for ARM user mode library only)

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

 *       void* Osal_contract_mmap (void* phy_addr, uint32_t size)
 *  

Parameter
addr - Pointer to the physical memory address.

Return Value
virtual address space

#define TF_CONTRACT_osalUnmap   Osal_contract_unmap

The macro is used by the trace framework Library to get the physical address from virtual address (Applicable for ARM user mode library only)

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

 *       void Osal_contract_unmap (void* virt_addr, uint32_t size)
 *
 *  

Parameter
addr - Pointer to the virtual memory address.
size - Size to be un mapped

Return Value
none

#define TF_PRODUCER_osalBeginMemAccess   Osal_producer_BeginMemAccess

The macro is used by the producer Library to indicate that packet access has been accessed & updated . If the packet is in cached memory the implementation should writeback the contents of the packet.

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

 *       void Osal_producer_BeginMemAccess (void* addr, uint32_t sizeWords)
 *  

Parameter
addr - The address of the table to be accessed
sizeWords - The number of bytes in the table

Return Value
None

#define TF_PRODUCER_osalEndMemAccess   Osal_producer_EndMemAccess

This macro is used to alert the application that the PRODUCER has completed access to table memory. This call will always be made following a call to Osal_PRODUCER BeginMemAccess and have the same parameters.

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

 *      void Osal_producer_EndMemAccess (void* addr, uint32_t sizeWords)
 *  

Parameters
addr - The address of the table to be accessed
sizeWords - The number of bytes in the table

Note:
PRODUCER will make nested calls to this function for memory access protection of different memory tables. The multicore semaphore should be freed when all previous memory access has completed, in other words, when the nested call level reaches 0.
#define TF_PRODUCER_osalException   Osal_producer_Exception

This macro is used to alert the application that the PRODUCER has encountered an exception.

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

 *      void Osal_producer_Exception (uint32_t moduleId, int32_t exception)
 *  

Parameters
addr - The address of the table to be accessed
sizeWords - The number of bytes in the table

Note:
PRODUCER will make nested calls to this function for memory access protection of different memory tables. The multicore semaphore should be freed when all previous memory access has completed, in other words, when the nested call level reaches 0.
#define TF_PRODUCER_osalGetProcId   Osal_producer_GetProcId

The macro is used by the trace framework Library to get the process ID.

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

 *       uint32_t Osal_producer_GetProcId (void)
 *  

Parameter
num_bytes - number of bytes to be allocated
alignment - memory alignment

Return Value
memory address allocated

#define TF_PRODUCER_osalMemAlloc   Osal_producer_MemAlloc

The macro is used by the producer Library to allocate the memory.

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

 *       void* Osal_producer_MemAlloc (uint32_t num_bytes, uint32_t alignment)
 *  

Parameter
num_bytes - number of bytes to be allocated
alignment - memory alignment

Return Value
memory address allocated

#define TF_PRODUCER_osalMemFree   Osal_producer_MemFree

The macro is used by the producer Library to free the memory.

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

 *       void  Osal_producer_MemFree (void* ptr, uint32_t size)
 *  

Parameter
ptr - memory base address to be freed
size - size of the mem block

Return Value
None


Copyright 2014, Texas Instruments Incorporated