diff --git a/packages/ti/sdo/edma3/rm/src/edma3resmgr.c b/packages/ti/sdo/edma3/rm/src/edma3resmgr.c
index 3a7c010eaaeb6e9d95fd136526e403e487bc9207..98dc8cb18195fc5b8cd0cf0c8e5a1628a2becb70 100755 (executable)
/* Initialize the global variables for the first time */
if (FALSE == rmInitDone)
{
- edma3MemZero((void *)&(resMgrObj[count]),
- sizeof(resMgrObj));
- edma3MemZero((void *)(&(edma3IntrParams[0U])),
- sizeof(edma3IntrParams));
-
+ edma3MemZero((void *)&(resMgrObj[0U]),
+ sizeof(resMgrObj));
+ edma3MemZero((void *)(&(edma3IntrParams[0U][0U])),
+ sizeof(edma3IntrParams));
rmInitDone = TRUE;
}
--rmObj->numOpens;
if (0 == rmObj->numOpens)
{
- edma3MemZero((void *)&(edma3RmChBoundRes[rmObj->phyCtrllerInstId]),
+ edma3MemZero((void *)&(edma3RmChBoundRes[rmObj->phyCtrllerInstId][0]),
sizeof(edma3RmChBoundRes[rmObj->phyCtrllerInstId]));
rmObj->state = EDMA3_RM_CLOSED;
/* DMA channel and PaRAM Set should be previously allocated. */
if (result == EDMA3_RM_SOK)
{
- if (((rmInstance->initParam.rmInstInitConfig->ownDmaChannels[channelId/32U])
- &
- (~(rmInstance->avlblDmaChannels[channelId/32U]))
- &
- ((uint32_t)1U << (channelId%32U))) != FALSE)
+ if(((channelId/32U) < 2) && ((paRAMId/32U) < 16))
{
- /* DMA channel allocated, check for the PaRAM Set */
- if (((rmInstance->initParam.rmInstInitConfig->ownPaRAMSets[paRAMId/32U])
- &
- (~(rmInstance->avlblPaRAMSets[paRAMId/32U]))
- &
- ((uint32_t)1U << (paRAMId%32U))) == FALSE)
+ if (((rmInstance->initParam.rmInstInitConfig->ownDmaChannels[channelId/32U])
+ &
+ (~(rmInstance->avlblDmaChannels[channelId/32U]))
+ &
+ ((uint32_t)1U << (channelId%32U))) != FALSE)
{
- /* PaRAM Set NOT allocated, return error */
+ /* DMA channel allocated, check for the PaRAM Set */
+ if (((rmInstance->initParam.rmInstInitConfig->ownPaRAMSets[paRAMId/32U])
+ &
+ (~(rmInstance->avlblPaRAMSets[paRAMId/32U]))
+ &
+ ((uint32_t)1U << (paRAMId%32U))) == FALSE)
+ {
+ /* PaRAM Set NOT allocated, return error */
+ result = EDMA3_RM_E_RES_NOT_ALLOCATED;
+ }
+ }
+ else
+ {
+ /* DMA channel NOT allocated, return error */
result = EDMA3_RM_E_RES_NOT_ALLOCATED;
}
}
- else
- {
- /* DMA channel NOT allocated, return error */
- result = EDMA3_RM_E_RES_NOT_ALLOCATED;
- }
}
/* QDMA channel and PaRAM Set should be previously allocated. */
if (result == EDMA3_RM_SOK)
{
- if (((rmInstance->initParam.rmInstInitConfig->ownQdmaChannels[channelId/32U])
- &
- (~(rmInstance->avlblQdmaChannels[channelId/32U]))
- &
- ((uint32_t)1U << (channelId%32U))) != FALSE)
+ if(((channelId/32U) < 1) && ((paRAMId/32U) < 16))
{
- /* QDMA channel allocated, check for the PaRAM Set */
- if (((rmInstance->initParam.rmInstInitConfig->ownPaRAMSets[paRAMId/32U])
- &
- (~(rmInstance->avlblPaRAMSets[paRAMId/32U]))
- &
- ((uint32_t)1U << (paRAMId%32U))) == FALSE)
+ if (((rmInstance->initParam.rmInstInitConfig->ownQdmaChannels[channelId/32U])
+ &
+ (~(rmInstance->avlblQdmaChannels[channelId/32U]))
+ &
+ ((uint32_t)1U << (channelId%32U))) != FALSE)
{
- /* PaRAM Set NOT allocated, return error */
+ /* QDMA channel allocated, check for the PaRAM Set */
+ if (((rmInstance->initParam.rmInstInitConfig->ownPaRAMSets[paRAMId/32U])
+ &
+ (~(rmInstance->avlblPaRAMSets[paRAMId/32U]))
+ &
+ ((uint32_t)1U << (paRAMId%32U))) == FALSE)
+ {
+ /* PaRAM Set NOT allocated, return error */
+ result = EDMA3_RM_E_RES_NOT_ALLOCATED;
+ }
+ }
+ else
+ {
+ /* QDMA channel NOT allocated, return error */
result = EDMA3_RM_E_RES_NOT_ALLOCATED;
}
}
- else
- {
- /* QDMA channel NOT allocated, return error */
- result = EDMA3_RM_E_RES_NOT_ALLOCATED;
- }
}
if (result == EDMA3_RM_SOK)
resIdSet = (1U << (resAllocIdx%32U));
/* Check whether it is owned or not */
- if (((rmInstance->initParam.rmInstInitConfig->ownDmaChannels[resAllocIdx/32U])&(resIdSet)) != FALSE)
+ if (((resAllocIdx/32U) < 2) && (((rmInstance->initParam.rmInstInitConfig->ownDmaChannels[resAllocIdx/32U])&(resIdSet)) != FALSE))
{
/* Now check if specified resource is available presently*/
if (((rmInstance->avlblDmaChannels[resAllocIdx/32U])&(resIdSet)) != FALSE)
resIdSet = (1U << (resAllocIdx%32U));
/* Check whether it is owned or not */
- if (((rmInstance->initParam.rmInstInitConfig->ownTccs[resAllocIdx/32U])&(resIdSet))!=FALSE)
+ if (((resAllocIdx/32U) < 2) && (((rmInstance->initParam.rmInstInitConfig->ownTccs[resAllocIdx/32U])&(resIdSet))!=FALSE))
{
/* Now check if specified resource is available presently*/
if (((rmInstance->avlblTccs[resAllocIdx/32U])&(resIdSet))!=FALSE)
if (((rmInstance->initParam.rmInstInitConfig->ownPaRAMSets[resAllocIdx/32U])&(resIdSet))!=FALSE)
{
/* Now check if specified resource is available presently*/
- if (((rmInstance->avlblPaRAMSets[resAllocIdx/32U])&(resIdSet))!=FALSE)
+ if (((resAllocIdx/32U) < 16) && (((rmInstance->avlblPaRAMSets[resAllocIdx/32U])&(resIdSet))!=FALSE))
{
/*
* Mark the specified resource as "Not Available"
assert (src != NULL);
assert (dst != NULL);
- assert ((len%4) == 0);
+ assert ((len%4U) == 0);
sr = (const uint32_t *)src;
ds = (uint32_t *)dst;