/* Lookup the script's address mapped in the SDMA's memory. */
int32_t sdma_lookup_script(script_name_e script, uint32_t *addr)
/* Lookup the script's address mapped in the SDMA's memory. */
int32_t sdma_lookup_script(script_name_e script, uint32_t *addr)
{
    if (script >= SDMA_NUM_SCRIPTS) {
        return SDMA_RETV_FAIL;
    }
    uint32_t i;
    for (i = 0; i < SDMA_NUM_SCRIPTS; i++) {
        if (script_info.script_maps[i].script_index == script)
            break;
    }
    if (script_info.script_maps[i].script_addr != 0) {
        *addr = script_info.script_maps[i].script_addr;
        return SDMA_RETV_SUCCESS;
    }
    return SDMA_RETV_FAIL;
}