Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLEXT: simple changes #9818

Merged
merged 5 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/include/sof/lib_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,14 @@ struct lib_manager_segment_desc {
};

struct lib_manager_module {
unsigned int start_idx;
unsigned int start_idx; /* Index of the first driver from this module in
* the library-global driver list */
const struct sof_man_module_manifest *mod_manifest;
struct lib_manager_segment_desc segment[LIB_MANAGER_N_SEGMENTS];
};

struct lib_manager_mod_ctx {
void *base_addr;
void *base_addr; /* library cold storage address (e.g. DRAM) */
unsigned int n_mod;
struct lib_manager_module *mod;
};
Expand Down
1 change: 1 addition & 0 deletions src/ipc/ipc-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ void ipc_msg_send(struct ipc_msg *msg, void *data, bool high_priority)

k_spin_unlock(&ipc->lock, key);
}
EXPORT_SYMBOL(ipc_msg_send);

#ifdef __ZEPHYR__
static void ipc_work_handler(struct k_work *work)
Expand Down
13 changes: 7 additions & 6 deletions src/library_manager/llext_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static bool llext_manager_section_detached(const elf_shdr_t *shdr)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"doesn't the whole of struct module_data" ?


static int llext_manager_link(struct llext_buf_loader *ebl, const char *name,
struct lib_manager_module *mctx, struct module_data *md,
struct lib_manager_module *mctx, struct llext **llext,
const void **buildinfo,
const struct sof_man_module_manifest **mod_manifest)
{
Expand All @@ -240,7 +240,7 @@ static int llext_manager_link(struct llext_buf_loader *ebl, const char *name,
.pre_located = true,
.section_detached = llext_manager_section_detached,
};
int ret = llext_load(&ebl->loader, name, &md->llext, &ldr_parm);
int ret = llext_load(&ebl->loader, name, llext, &ldr_parm);

if (ret)
return ret;
Expand Down Expand Up @@ -284,9 +284,10 @@ static int llext_manager_link(struct llext_buf_loader *ebl, const char *name,
}

static int llext_manager_mod_init(struct lib_manager_mod_ctx *ctx,
const struct sof_man_fw_desc *desc,
const struct sof_man_module *mod_array)
const struct sof_man_fw_desc *desc)
{
struct sof_man_module *mod_array = (struct sof_man_module *)((uint8_t *)desc +
SOF_MAN_MODULE_OFFSET(0));
unsigned int i, n_mod;
size_t offs;

Expand Down Expand Up @@ -356,7 +357,7 @@ uintptr_t llext_manager_allocate_module(struct processing_module *proc,
tr_dbg(&lib_manager_tr, "mod_id: %#x", ipc_config->id);

if (!ctx->mod)
llext_manager_mod_init(ctx, desc, mod_array);
llext_manager_mod_init(ctx, desc);

if (entry_index >= desc->header.num_module_entries) {
tr_err(&lib_manager_tr, "Invalid driver index %u exceeds %d",
Expand Down Expand Up @@ -407,7 +408,7 @@ uintptr_t llext_manager_allocate_module(struct processing_module *proc,
struct llext_buf_loader ebl = LLEXT_BUF_LOADER((uint8_t *)dram_base + mod_offset, mod_size);

/* LLEXT linking is only needed once for all the drivers in each module */
ret = llext_manager_link(&ebl, mod_array[entry_index - inst_idx].name, mctx, md,
ret = llext_manager_link(&ebl, mod_array[entry_index - inst_idx].name, mctx, &md->llext,
(const void **)&buildinfo, &mod_manifest);
if (ret < 0) {
tr_err(&lib_manager_tr, "linking failed: %d", ret);
Expand Down
2 changes: 2 additions & 0 deletions src/math/sqrt_int16.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
//

#include <rtos/symbol.h>
#include <sof/math/sqrt.h>

#define SQRT_WRAP_SCHAR_BITS 0xFF
Expand Down Expand Up @@ -145,3 +146,4 @@ uint16_t sqrt_int16(uint16_t u)

return y;
}
EXPORT_SYMBOL(sqrt_int16);
2 changes: 2 additions & 0 deletions src/math/trig.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Keyon Jie <yang.jie@linux.intel.com>
// Shriram Shastry <malladi.sastry@linux.intel.com>

#include <rtos/symbol.h>
#include <sof/audio/format.h>
#include <sof/math/trig.h>
#include <sof/math/cordic.h>
Expand Down Expand Up @@ -99,6 +100,7 @@ void cordic_approx(int32_t th_rad_fxp, int32_t a_idx, int32_t *sign, int32_t *b_
/* Q2.30 format -sine, cosine*/
*th_cdc_fxp = th_rad_fxp;
}
EXPORT_SYMBOL(cordic_approx);

/**
* CORDIC-based approximation for inverse cosine
Expand Down
2 changes: 1 addition & 1 deletion zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ endif()
if(CONFIG_COMP_FIR STREQUAL "m")
add_subdirectory(${SOF_AUDIO_PATH}/eq_fir/llext
${PROJECT_BINARY_DIR}/eq_fir_llext)
add_dependencies(app eq_iir)
add_dependencies(app eq_fir)
elseif(CONFIG_COMP_FIR)
zephyr_library_sources(
${SOF_AUDIO_PATH}/eq_fir/eq_fir_hifi3.c
Expand Down
Loading