mirror of https://github.com/thesofproject/sof.git
llext: (cosmetic) use a macro instead of a constant
0x8000 is the manifest .text offset, use an existing macro instead of open-coding it. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
parent
a64e2817b6
commit
7457e7da23
|
@ -37,6 +37,14 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FIXME: this definition is copied from tools/rimage/src/include/rimage/manifest.h
|
||||||
|
* which we cannot easily include here, because it also pulls in
|
||||||
|
* tools/rimage/src/include/rimage/elf.h which then conflicts with
|
||||||
|
* zephyr/include/zephyr/llext/elf.h
|
||||||
|
*/
|
||||||
|
#define FILE_TEXT_OFFSET_V1_8 0x8000
|
||||||
|
|
||||||
LOG_MODULE_DECLARE(lib_manager, CONFIG_SOF_LOG_LEVEL);
|
LOG_MODULE_DECLARE(lib_manager, CONFIG_SOF_LOG_LEVEL);
|
||||||
|
|
||||||
extern struct tr_ctx lib_manager_tr;
|
extern struct tr_ctx lib_manager_tr;
|
||||||
|
@ -172,11 +180,10 @@ static int llext_manager_link(struct sof_man_fw_desc *desc, struct sof_man_modul
|
||||||
uint32_t module_id, struct module_data *md, const void **buildinfo,
|
uint32_t module_id, struct module_data *md, const void **buildinfo,
|
||||||
const struct sof_man_module_manifest **mod_manifest)
|
const struct sof_man_module_manifest **mod_manifest)
|
||||||
{
|
{
|
||||||
size_t mod_size = desc->header.preload_page_count * PAGE_SZ - 0x8000;
|
size_t mod_size = desc->header.preload_page_count * PAGE_SZ - FILE_TEXT_OFFSET_V1_8;
|
||||||
/* FIXME: where does the module begin?? */
|
|
||||||
struct llext_buf_loader ebl = LLEXT_BUF_LOADER((uint8_t *)desc -
|
struct llext_buf_loader ebl = LLEXT_BUF_LOADER((uint8_t *)desc -
|
||||||
SOF_MAN_ELF_TEXT_OFFSET + 0x8000,
|
SOF_MAN_ELF_TEXT_OFFSET + FILE_TEXT_OFFSET_V1_8,
|
||||||
mod_size);
|
mod_size);
|
||||||
struct lib_manager_mod_ctx *ctx = lib_manager_get_mod_ctx(module_id);
|
struct lib_manager_mod_ctx *ctx = lib_manager_get_mod_ctx(module_id);
|
||||||
/* Identify if this is the first time loading this module */
|
/* Identify if this is the first time loading this module */
|
||||||
struct llext_load_param ldr_parm = {!ctx->segment_size[SOF_MAN_SEGMENT_TEXT]};
|
struct llext_load_param ldr_parm = {!ctx->segment_size[SOF_MAN_SEGMENT_TEXT]};
|
||||||
|
|
Loading…
Reference in New Issue