Skip to content

Commit

Permalink
llext: allow to copy module to IMR
Browse files Browse the repository at this point in the history
With this patch llext will support loading modules to IMR

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
  • Loading branch information
abonislawski committed Aug 20, 2024
1 parent 72aaf78 commit 015d91e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/library_manager/llext_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ extern struct tr_ctx lib_manager_tr;

static int llext_manager_update_flags(void __sparse_cache *vma, size_t size, uint32_t flags)
{
if ((uintptr_t)vma > L3_MEM_BASE_ADDR)
return 0;

size_t pre_pad_size = (uintptr_t)vma & (PAGE_SZ - 1);
void *aligned_vma = (__sparse_force uint8_t *)vma - pre_pad_size;

Expand All @@ -62,6 +65,9 @@ static int llext_manager_update_flags(void __sparse_cache *vma, size_t size, uin

static int llext_manager_align_map(void __sparse_cache *vma, size_t size, uint32_t flags)
{
if ((uintptr_t)vma > L3_MEM_BASE_ADDR)
return 0;

size_t pre_pad_size = (uintptr_t)vma & (PAGE_SZ - 1);
void *aligned_vma = (__sparse_force uint8_t *)vma - pre_pad_size;

Expand All @@ -71,6 +77,9 @@ static int llext_manager_align_map(void __sparse_cache *vma, size_t size, uint32

static int llext_manager_align_unmap(void __sparse_cache *vma, size_t size)
{
if ((uintptr_t)vma > L3_MEM_BASE_ADDR)
return 0;

size_t pre_pad_size = (uintptr_t)vma & (PAGE_SZ - 1);
void *aligned_vma = (__sparse_force uint8_t *)vma - pre_pad_size;

Expand Down

1 comment on commit 015d91e

@lgirdwood
Copy link

Choose a reason for hiding this comment

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

@abonislawski are you able to create a PR from this as a starting point, we can roll out incrementally.

Please sign in to comment.