![]() |
![]() |
#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>
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.
uint32_t Qmss_getMemRegDescSize | ( | uint32_t | memRegion, | |
uint32_t | qGroup | |||
) |
Description
Backwards compatibility wrapper of Qmss_getMemRegDescSizeSubSys which operates on the global subsystem.
uint32_t Qmss_getMemRegDescSizeSubSys | ( | Qmss_SubSysHnd | subSysHnd, | |
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.
[in] | subSysHnd | Handle to specific subsystem returned by Qmss_initSubSys or Qmss_startSubSysCfg. |
[in] | memRegion | Memory region number. |
[in] | qGroup | Queue manager group number |
Descriptor | size |
Qmss_QueueHnd Qmss_getMemRegQueueHandle | ( | uint32_t | memRegion | ) |
Description
Backwards compatibility wrapper of Qmss_getMemRegQueueHandleSubSys which operates on the global subsystem.
Qmss_QueueHnd Qmss_getMemRegQueueHandleQGroupSubSys | ( | Qmss_SubSysHnd | subSysHnd, | |
uint32_t | memRegion, | |||
uint32_t | qGroup | |||
) |
Description
The function return the source queue handle on which the descriptors configured for the specified memory region are stored.
[in] | subSysHnd | Handle to specific subsystem returned by Qmss_initSubSys or Qmss_startSubSysCfg. |
[in] | memRegion | Memory region number |
[in] | qGroup | Queue group (for split mode) |
Success | - Queue Handle | |
Failure | - QMSS_NOT_INITIALIZED |
Qmss_QueueHnd Qmss_getMemRegQueueHandleSubSys | ( | Qmss_SubSysHnd | subSysHnd, | |
uint32_t | memRegion | |||
) |
Description
The function return the source queue handle on which the descriptors configured for the specified memory region are stored.
[in] | subSysHnd | Handle to specific subsystem returned by Qmss_initSubSys or Qmss_startSubSysCfg. |
[in] | memRegion | Memory region number |
Success | - Queue Handle | |
Failure | - QMSS_NOT_INITIALIZED Failure - QMSS_API_NO_SPLIT_MODE |
static Qmss_QueueHnd Qmss_internalQueueOpen | ( | Qmss_SubSysHnd | subSysHnd, | |
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.
[in] | subSysHnd | Handle to specific subsystem returned by Qmss_initSubSys or Qmss_startSubSysCfg. |
[in] | qGroupIsSpecified | 0: Ignore qGroup in joint mode and allocate per balancing scheme 1: Use gGroup in joint mode |
[in] | qGroup | Specifies queue group to open from (only used in SPLIT mode |
[in] | queType | Specifies the type of queue that should be opened. |
[in] | queNum | Specifies the queue number that should be opened. |
[out] | isAllocated | Indicates 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. |
Success | - Queue Handle. Used as an input parameter for operation on this queue. | |
Failure | - QMSS_RESOURCE_ALLOCATE_USE_DENIED | |
Failure | - <0 |
uint32_t alternate |
Used to perform round robin allocation
int32_t groupFreeQueues[QMSS_MAX_QMGR_GROUPS] |
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.