Opening DSP Pools dynamically

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Overview

One of the common issues encountered with the POOL module in DSP/BIOSTM Link, is the guideline that all pools must be opened before PROC_start. This is a big limitation since all application buffer requirements must be known in advance, and prevents true multi-application support, and also results in consumption of extra memory.
This limitation is due to:

However, this limitation can be worked around by dynamically opening the DSP pools using the method detailed below.

Details

The procedure detailed in this section can be followed to enable opening shared pools after PROC_start on the ARM-side. This does not require any change in DSPLink.

(Note that the code given below is only indicative. This code cannot be associated with anything in any actual DSPLink release. You will need to make similar changes in your actual application.)

#define NUM_POOLS 1
 
/** ============================================================================
 *  @name   MESSAGE_Pools
 *
 *  @desc   Array of pools.
 *  ============================================================================
 */
POOL_Obj MESSAGE_Pools [NUM_POOLS] =
{
    POOL_NOENTRY
} ;
 
/** ============================================================================
 *  @name   POOL_config
 *
 *  @desc   POOL configuration information.
 *          POOL_config is a required global variable.
 *  ============================================================================
 */
POOL_Config POOL_config = {MESSAGE_Pools, NUM_POOLS} ;
/* Define actual SMAPOOL parameters */
SMAPOOL_Params MESSAGE_PoolParams [NUM_POOLS] ;
 
/* Setup SMAPOOL parameters*/
MESSAGE_PoolParams [poolId].poolId        = poolId ;
MESSAGE_PoolParams [poolId].exactMatchReq = TRUE ;
 
/* Populate the global POOL configuration structure with actual POOL configuration.*/
MESSAGE_Pools [poolId].initFxn = SMAPOOL_init ;
MESSAGE_Pools [poolId].fxns    = (POOL_Fxns *) &SMAPOOL_FXNS ;
MESSAGE_Pools [poolId].params  = &(MESSAGE_PoolParams [poolId]) ;
MESSAGE_Pools [poolId].object  = NULL ;
 
/* Open the POOL dynamically */
status = POOL_open (poolId, &(MESSAGE_Pools [poolId])) ;
#if !defined (POOL_open) /* To ensure no clash with future BIOS definition */
/** ============================================================================
 *  @name   POOL_open
 *
 *  @desc   Macro over the allocator for opening a pool.
 *
 *  @arg    poolId
 *              Pool id.
 *  @arg    params
 *              Parameters for opening the pool.
 *
 *  @see    POOL_close
 *  ============================================================================
 */
#define POOL_open(poolId, params)                              \
        (((POOL->allocators [poolId]).fxns->open)              \
                (&(POOL->allocators [poolId].object),          \
                 params))
#endif /* if !defined (POOL_open) */
Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox