Functions | Variables
qmss_drv.c File Reference

This is the Queue Manager Low Level Driver file. More...

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <ti/drv/qmss/qmss_drv.h>
#include <ti/drv/qmss/include/qmss_pvt.h>
#include <ti/drv/qmss/include/qmss_intd.h>
#include <qmss_osal.h>
#include <ti/drv/rm/rm_services.h>

Functions

static Qmss_QueueHnd Qmss_internalQueueOpen (int qGroupIsSpecified, uint32_t qGroup, Qmss_QueueType queType, int queNum, uint8_t *isAllocated)
static int32_t Qmss_internalFindQueueType (uint32_t queNum)
static void Qmss_internalUpdateGroupControl (uint32_t qGroup, int sign)
static void Qmss_internalInsertLinkingRAM (uint32_t group, Qmss_LinkingRAM *linkingRAM, uint32_t *actSize)
static Qmss_Result Qmss_internalCheckLinkingRAM (Qmss_LinkingRAM *linkingRAM)
Qmss_Result Qmss_init (Qmss_InitCfg *initCfg, Qmss_GlobalConfigParams *qmssGblCfgParams)
Qmss_Result Qmss_exit (void)
Qmss_Result Qmss_startCfg (Qmss_StartCfg *startCfg)
Qmss_Result Qmss_start (void)
Qmss_Result Qmss_getMemoryRegionCfg (Qmss_MemRegCfg *memRegInfo)
Qmss_Result Qmss_insertMemoryRegion (Qmss_MemRegInfo *memRegCfg)
Qmss_Result Qmss_removeMemoryRegion (int32_t region, uint32_t qGroup)
Qmss_QueueHnd Qmss_initDescriptor (Qmss_DescCfg *descCfg, uint32_t *numAllocated)
Qmss_QueueHnd Qmss_queueOpenInGroup (int32_t queGroup, Qmss_QueueType queType, int32_t queNum, uint8_t *isAllocated)
Qmss_QueueHnd Qmss_queueOpen (Qmss_QueueType queType, int32_t queNum, uint8_t *isAllocated)
Qmss_QueueHnd Qmss_queueOpenInRange (uint32_t startQueNum, uint32_t endQueNum, uint8_t *isAllocated)
Qmss_QueueHnd Qmss_queueBlockOpenInGroup (Qmss_QueueHnd *queueHnds, int32_t queGroup, Qmss_QueueType queType, int32_t numQ, int32_t align)
Qmss_QueueHnd Qmss_queueBlockOpen (Qmss_QueueHnd *queueHnds, Qmss_QueueType queType, int32_t numQ, int32_t align)
Qmss_QueueHnd Qmss_queueOpenUse (uint32_t QID, uint8_t *useCount)
Qmss_Result Qmss_queueClose (Qmss_QueueHnd hnd)
uint32_t Qmss_getQueueThreshold (Qmss_QueueHnd hnd)
Qmss_Result Qmss_setQueueThreshold (Qmss_QueueHnd hnd, uint16_t hilo, uint8_t threshold)
void Qmss_getStarvationCounts (Qmss_QueueHnd hnd, uint32_t numCounts, uint32_t *pStarvationCounts)
uint32_t Qmss_getStarvationCount (Qmss_QueueHnd hnd)
uint16_t Qmss_getQueueThresholdStatus (Qmss_QueueHnd hnd)
Qmss_Queue Qmss_getQueueNumber (Qmss_QueueHnd hnd)
uint32_t Qmss_getQueueGroup (Qmss_QueueHnd hnd)
Qmss_QueueHnd Qmss_getQueueHandle (Qmss_Queue queue)
Qmss_Result Qmss_downloadFirmware (Qmss_PdspId pdspId, void *image, uint32_t size)
Qmss_Result Qmss_setEoiVectorByIntd (uint8_t intdNum, Qmss_IntdInterruptType type, uint8_t accumCh)
Qmss_Result Qmss_setEoiVector (Qmss_IntdInterruptType type, uint8_t accumCh)
Qmss_Result Qmss_setEoiIntNumByIntd (uint8_t intdNum, uint8_t intNum)
Qmss_Result Qmss_setEoiIntNum (uint8_t intNum)
Qmss_Result Qmss_ackInterruptByIntd (uint8_t intdNum, uint8_t interruptNum, uint8_t value)
Qmss_Result Qmss_ackInterrupt (uint8_t interruptNum, uint8_t value)
uint32_t Qmss_getVersion (void)
const char * Qmss_getVersionStr (void)
int32_t Qmss_getMemRegQueueHandle (uint32_t memRegion)
uint32_t Qmss_getMemRegDescSize (uint32_t memRegion, uint32_t qGroup)

Variables

const char qmssLldVersionStr [] = ":" __TIME__
 Global Variable which describes the QMSS LLD Version Information.

Detailed Description

This is the Queue Manager Low Level Driver file.

============================================================================
(C) Copyright 2009-2013, Texas Instruments, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Function Documentation

uint32_t Qmss_getMemRegDescSize ( uint32_t  memRegion,
uint32_t  qGroup 
)

Description
The function returns size of the descriptors in the specified memory region.

This is for *internal* LLD usage.

Parameters:
[in]memRegionMemory region number.
[in]qGroupQueue manager group number
Return values:
Descriptorsize
int32_t Qmss_getMemRegQueueHandle ( uint32_t  memRegion)

Description
The function return the source queue handle on which the descriptors configured for the specified memory region are stored.

This is for *internal* LLD usage.

Parameters:
[in]memRegionMemory region number
Return values:
Success- Queue Handle
Failure- QMSS_NOT_INITIALIZED
static Qmss_QueueHnd Qmss_internalQueueOpen ( int  qGroupIsSpecified,
uint32_t  qGroup,
Qmss_QueueType  queType,
int  queNum,
uint8_t *  isAllocated 
) [static]

Description
Internal queue open function; is called to allocate a queue when critical section is provided by the caller.

A queue can be opened in two ways: 1) If "queNum" is set to QMSS_PARAM_NOT_SPECIFIED, then a new available queue of type "queType" is allocated. 2) If "queNum" is a valid queue number i.e., >= 0, then a queue is allocated if free else a handle to a previously opened queue is returned. In this case "queType" parameter is not used.

Parameters:
[in]qGroupIsSpecified0: Ignore qGroup in joint mode and allocate per balancing scheme 1: Use gGroup in joint mode
[in]qGroupSpecifies queue group to open from (only used in SPLIT mode
[in]queTypeSpecifies the type of queue that should be opened.
[in]queNumSpecifies the queue number that should be opened.
[out]isAllocatedIndicates whether the requested queue is a new queue allocation(1). or was already allocated. If the queue was previously allocated this parameter returns the reference count.

*

Precondition:
Appropriate Critical section protection should be provided by caller.
Return values:
Success- Queue Handle. Used as an input parameter for operation on this queue.
Failure- QMSS_RESOURCE_ALLOCATE_USE_DENIED
Failure- <0

Variable Documentation

uint32_t alternate

Used to perform round robin allocation

Used to do load balanced allocation

uint8_t pad[QMSS_MAX_CACHE_ALIGN-sizeof(uint32_t)*(QMSS_MAX_QMGR_GROUPS+1)]

Padding required to make sure linker doesn't put something else on the same cache line.


Copyright 2014, Texas Instruments Incorporated