Skip to content

Commit 3e0a047

Browse files
committed
lib_manager: Set target memory flags after data loading from storage
Memory region must first be mapped as writable to allow data to be placed there. Then the target access flags are set, e.g. read-only and executable. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
1 parent 7fa0fdf commit 3e0a047

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/library_manager/lib_manager.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static int lib_manager_load_data_from_storage(void __sparse_cache *vma, void *s_
129129
{
130130
/* Region must be first mapped as writable in order to initialize its contents. */
131131
int ret = sys_mm_drv_map_region((__sparse_force void *)vma, POINTER_TO_UINT(NULL), size,
132-
flags | SYS_MM_MEM_PERM_RW);
132+
SYS_MM_MEM_PERM_RW);
133133
if (ret < 0)
134134
return ret;
135135

@@ -139,11 +139,7 @@ static int lib_manager_load_data_from_storage(void __sparse_cache *vma, void *s_
139139

140140
dcache_writeback_region(vma, size);
141141

142-
/* TODO: Change attributes for memory to FLAGS. Implementation of required function in tlb
143-
* driver is in progress.
144-
* sys_mm_drv_update_region_flags(vma, size, flags);
145-
*/
146-
return 0;
142+
return sys_mm_drv_update_region_flags(vma, size, flags);
147143
}
148144

149145
static int lib_manager_load_module(const uint32_t module_id,

0 commit comments

Comments
 (0)