/* If id is EDMA_CONT_PARAMS_FIXED_NOT_EXACT then the API initially tries starts looking for a set of contiguous parameter RAMs from the "slot" that is passed as an argument to the API. On failure the API will try to find a set of contiguous Parameter RAM slots from the remaining Parameter RAM slots  */
int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count)
/* If id is EDMA_CONT_PARAMS_FIXED_NOT_EXACT then the API initially tries starts looking for a set of contiguous parameter RAMs from the "slot" that is passed as an argument to the API. On failure the API will try to find a set of contiguous Parameter RAM slots from the remaining Parameter RAM slots  */
int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count)
{
    if ((id != EDMA_CONT_PARAMS_ANY) &&
        (slot < edma_cc[ctlr]->num_channels ||
        slot >= edma_cc[ctlr]->num_slots))
        return -RT_ERROR;
    if (count < 1 || count >
        (edma_cc[ctlr]->num_slots - edma_cc[ctlr]->num_channels))
        return -RT_ERROR;
    switch (id) {
    case EDMA_CONT_PARAMS_ANY:
        return reserve_contiguous_slots(ctlr, id, count,
                         edma_cc[ctlr]->num_channels);
    case EDMA_CONT_PARAMS_FIXED_EXACT:
    case EDMA_CONT_PARAMS_FIXED_NOT_EXACT:
        return reserve_contiguous_slots(ctlr, id, count, slot);
    default:
        return -RT_ERROR;
    }
}