osd_module *osd_module_manager::get_module_generic(const char *type, const char *name) { int i = get_module_index(type, name); if (i>=0) return m_modules[i]; else return nullptr; }
/* Find the next module given the current module. * * The next available module in the array is returned. */ int get_next_module (GModule module) { int next = get_module_index (module) + 1; if (next == TOTAL_MODULES || module_list[next] == -1) return module_list[0]; return module_list[next]; }
static struct msm_adsp_module *find_adsp_module_by_id( struct adsp_info *info, uint32_t id) { if (id > info->max_module_id) { return NULL; } else { id = get_module_index(id); if (id < 0) return NULL; return info->id_to_module[id]; } }
/* Remove the given module from the module_list array. * * If the module is not within the array, 1 is returned. * If the module is within the array, it is removed from the array and * 0 is returned. */ int remove_module (GModule module) { int index = get_module_index (module); if (index == -1) return 1; if (index < TOTAL_MODULES - 1) memmove (&module_list[index], &module_list[index + 1], ((TOTAL_MODULES - 1) - index) * sizeof (module_list[0])); module_list[TOTAL_MODULES - 1] = -1; return 0; }
static struct msm_adsp_module *find_adsp_module_by_id( struct adsp_info *info, uint32_t id) { int mod_idx; if (id > info->max_module_id) { return NULL; } else { mod_idx = get_module_index(id); if (mod_idx < 0) return NULL; return info->id_to_module[mod_idx]; } }
static struct msm_adsp_module *find_adsp_module_by_id( struct adsp_info *info, uint32_t id) { if (id > info->max_module_id) { return NULL; } else { #if CONFIG_MSM_AMSS_VERSION >= 6350 id = get_module_index(id); if (id < 0) return NULL; #endif return info->id_to_module[id]; } }
/* Find the previous module given the current module. * * The previous available module in the array is returned. */ int get_prev_module (GModule module) { int i; int next = get_module_index (module) - 1; if (next >= 0 && module_list[next] != -1) return module_list[next]; for (i = TOTAL_MODULES - 1; i >= 0; i--) { if (module_list[i] != -1) { return module_list[i]; } } return 0; }
bool osd_module_manager::type_has_name(const char *type, const char *name) { return (get_module_index(type, name) >= 0); }