Skip to content

Commit 49464c7

Browse files
wjablon1lgirdwood
authored andcommitted
lib-manager: fix lib id packing
Function lib_manager_get_library_manifest expects a full module identifier consisting of library ID and module index packed together as a parameter. There are some incorrect calls to the function where only library index is provided. This change fixes those incorrect calls. Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
1 parent 2f31944 commit 49464c7

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/audio/base_fw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ __cold static int basefw_libraries_info_get(uint32_t *data_offset, char *data)
410410
desc = basefw_vendor_get_manifest();
411411
} else {
412412
#if CONFIG_LIBRARY_MANAGER
413-
desc = (struct sof_man_fw_desc *)lib_manager_get_library_manifest(lib_id);
413+
desc = lib_manager_get_library_manifest(LIB_MANAGER_PACK_LIB_ID(lib_id));
414414
#else
415415
desc = NULL;
416416
#endif

src/debug/telemetry/performance_monitor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ int enable_performance_counters(void)
344344
desc = basefw_vendor_get_manifest();
345345
} else {
346346
#if CONFIG_LIBRARY_MANAGER
347-
desc = (struct sof_man_fw_desc *)lib_manager_get_library_manifest(lib_id);
347+
desc = lib_manager_get_library_manifest(LIB_MANAGER_PACK_LIB_ID(lib_id));
348348
#else
349349
desc = NULL;
350350
#endif

src/include/sof/lib_manager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777

7878
#define LIB_MANAGER_GET_LIB_ID(module_id) (((module_id) & 0xF000) >> LIB_MANAGER_LIB_ID_SHIFT)
7979
#define LIB_MANAGER_GET_MODULE_INDEX(module_id) ((module_id) & 0xFFF)
80+
#define LIB_MANAGER_PACK_LIB_ID(lib_index) (((lib_index) << LIB_MANAGER_LIB_ID_SHIFT) & 0xF000)
8081

8182
#ifdef CONFIG_LIBRARY_MANAGER
8283
struct ipc_lib_msg {

0 commit comments

Comments
 (0)