Defines
BCP OS Abstraction Layer Functions
BCP Higher Layer Data Structures & APIs

Defines

#define Bcp_osalMalloc   Osal_bcpMalloc
#define Bcp_osalFree   Osal_bcpFree
#define Bcp_osalMultiCoreCsEnter   Osal_bcpMultiCoreCsEnter
#define Bcp_osalMultiCoreCsExit   Osal_bcpMultiCoreCsExit
#define Bcp_osalInterruptCsEnter   Osal_bcpInterruptCsEnter
#define Bcp_osalInterruptCsExit   Osal_bcpInterruptCsExit
#define Bcp_osalLog   Osal_bcpLog
#define Bcp_osalCreateSem   Osal_bcpCreateSem
#define Bcp_osalDeleteSem   Osal_bcpDeleteSem
#define Bcp_osalPendSem   Osal_bcpPendSem
#define Bcp_osalPostSem   Osal_bcpPostSem
#define Bcp_osalBeginMemAccess   Osal_bcpBeginMemAccess
#define Bcp_osalEndMemAccess   Osal_bcpEndMemAccess
#define Bcp_osalBeginDescMemAccess   Osal_bcpBeginDescMemAccess

Define Documentation

#define Bcp_osalBeginDescMemAccess   Osal_bcpBeginDescMemAccess

============================================================================
Bcp_osalBeginDescMemAccess

brief
This API is called from the driver before it makes a read access to CPPI descriptors on the Rx data path. If the descriptors were allocated in cacheable memory region, then the application would have to ensure that the cache is updated with the contents from actual physical memory.

Parameters:
[in]hRx- Rx object handle. Must be used by application to retrieve correct descriptor size, and location of the descriptors.
[in]descPtr- Address of the descriptors that the driver is trying to access.
Returns:

void

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

       void Bcp_osalBeginDescMemAccess (void* hRx, void *descPtr) 
    

=============================================================================

#define Bcp_osalBeginMemAccess   Osal_bcpBeginMemAccess

============================================================================
Bcp_osalBeginMemAccess

brief
This API is called from the driver before it makes a read access to its multicore shared datastructures. If these data structures were placed in cacheable memory region, then the application would have to ensure that the cache is updated with the contents from actual physical memory.

Parameters:
[in]blockPtr- Address of the memory block that the driver is trying to access.
[in]size- Size of the memory block being accessed.
Returns:

void

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

       void Osal_bcpBeginMemAccess (void *blockPtr, uint32_t size) 
    

=============================================================================

#define Bcp_osalCreateSem   Osal_bcpCreateSem

============================================================================
Bcp_osalCreateSem

brief
This API is called from the BCP driver to create a software semaphore.

Parameters:
[in]void
Returns:

void* - Semaphore handle.

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

       void* Osal_bcpCreateSem (void) 
    

=============================================================================

#define Bcp_osalDeleteSem   Osal_bcpDeleteSem

============================================================================
Bcp_osalDeleteSem

brief
This API is called from the driver to delete a software semaphore created earlier using Bcp_osalCreateSem () API.

Parameters:
[in]hSem- Semaphore handle obtained using Bcp_osalCreateSem () API.
Returns:

void

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

       void Osal_bcpDeleteSem (void* hSem) 
    

=============================================================================

#define Bcp_osalEndMemAccess   Osal_bcpEndMemAccess

============================================================================
Bcp_osalEndMemAccess

brief
This API is called from the driver once its done writing to its multicore shared datastructures. If these data structures were placed in cacheable memory region, then the application would have to ensure that the actual physical memory is updated as per the contents of cache.

Parameters:
[in]blockPtr- Address of the memory block that the driver is has written to.
[in]size- Size of the memory block being accessed.
Returns:

void

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

       void Osal_bcpEndMemAccess (void *blockPtr, uint32_t size) 
    

=============================================================================

#define Bcp_osalFree   Osal_bcpFree

============================================================================
Bcp_osalFree

brief
This API is called from the BCP driver to free up the memory allocated for buffers earlier using Bcp_osalMalloc () API.

Parameters:
[in]datavoid*Pointer to the memory block to be cleaned up.
[in]num_bytesSize of the memory block to be cleaned up.
[in]bGlobalAddressIndicates that the address passed here to this function is a Global address.

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

        void Osal_bcpFree (void* dataPtr, uint32_t num_bytes, uint8_t bGlobalAddress)
    

=============================================================================

#define Bcp_osalInterruptCsEnter   Osal_bcpInterruptCsEnter

============================================================================
Bcp_osalInterruptCsEnter

brief
This API is called from the BCP driver to acquire an interrupt lock, i.e., a lock that can protect the driver against context switch to an interrupt when its manipulating data structures shared between the application process and interrupt handler (ISR).

This API is called from the BCP Bcp_rxGetResult () API to protect the driver maintained list of results posted by ISR against manipulation from ISR at the same time its being accessed by the application via Bcp_rxGetResult () API. This API should disable the interrupts to ensure that protection against interrupts.

Parameters:
[in]void
Returns:

void

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

        void Osal_bcpInterruptCsEnter (void)
    

=============================================================================

#define Bcp_osalInterruptCsExit   Osal_bcpInterruptCsExit

============================================================================
Bcp_osalInterruptCsExit

brief
This API is called from the BCP driver to release an interrupt lock previously obtained using Bcp_osalInterruptCsEnter () API. This API should enable back interrupts disabled earlier in Bcp_osalInterruptCsEnter () API.

Parameters:
[in]void
Returns:

void

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

        void Osal_bcpInterruptCsExit (void)
    

=============================================================================

#define Bcp_osalLog   Osal_bcpLog

============================================================================
Bcp_osalLog

brief
This API is called from the BCP driver to log useful debug information.

Parameters:
[in]void
Returns:

void

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

       void Osal_bcpLog (char* fmt, ... ) 
    

=============================================================================

#define Bcp_osalMalloc   Osal_bcpMalloc

============================================================================
Bcp_osalMalloc

brief
This API is called from the BCP driver to allocate memory for the FFT request and result buffers used in Host mode CPPI descriptors. It can also be called to allocate memory for driver's internal book-keeping objects.

This memory can be allocated from a core's local heap.

Parameters:
[in]num_bytesNumber of bytes to be allocated.
[in]bGlobalAddressIndicates whether the address returned by this API should be a global address or a core local address. Global addresses are required by driver when allocating CPPI descriptors and buffers.
Returns:
Allocated block address
Precondition:

The buffers allocated using this API MUST be translated to global addresses when 'bGlobalAddress' is set to 1.

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

        void*  Osal_bcpMalloc (uint32_t num_bytes, uint8_t bGlobalAddress)
    

=============================================================================

#define Bcp_osalMultiCoreCsEnter   Osal_bcpMultiCoreCsEnter

============================================================================
Bcp_osalMultiCoreCsEnter

brief
This API is called from the BCP driver to acquire a multi-core, multi-threaded synchronization lock, i.e., a lock that once obtained that would ensure that no process/thread on the current core or any of the cores can access the BCP library APIs until its released by the current user.

This API is called from the BCP driver mainly from the control path APIs, i.e., Bcp_init (), Bcp_open () etc to ensure that the data structures shared between all the driver users are updated correctly.

Parameters:
[in]void
Returns:

void

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

        void Osal_bcpMultiCoreCsEnter (void)
    

=============================================================================

#define Bcp_osalMultiCoreCsExit   Osal_bcpMultiCoreCsExit

============================================================================
Bcp_osalMultiCoreCsExit

brief
This API is called from the BCP driver to release a multi-core and multi-threaded lock previously obtained using Bcp_osalMultiCoreCsEnter () API. This API should reset the multi-core, multi-threaded lock enabling another process/core to grab it to access the BCP library.

Parameters:
[in]void
Returns:

void

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

        void Osal_bcpMultiCoreCsExit (void)
    

=============================================================================

#define Bcp_osalPendSem   Osal_bcpPendSem

============================================================================
Bcp_osalPendSem

brief
This API is called from the driver to acquire a software semaphore created earlier using Bcp_osalCreateSem () API.

Parameters:
[in]hSem- Semaphore handle obtained using Bcp_osalCreateSem () API.
Returns:

void

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

       void Osal_bcpPendSem (void* hSem) 
    

=============================================================================

#define Bcp_osalPostSem   Osal_bcpPostSem

============================================================================
Bcp_osalPostSem

brief
This API is called from the driver to release a semaphore acquired earlier using Bcp_osalPendSem () API.

Parameters:
[in]hSem- Semaphore handle obtained using Bcp_osalCreateSem () API.
Returns:

void

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

       void Osal_bcpPostSem (void* hSem) 
    

=============================================================================


Copyright 2014, Texas Instruments Incorporated