Bring up WAMR on esp32-s3 device (#2348)
esp32-s3's instruction memory and data memory can be accessed through mutual mirroring way, so we define a new feature named as WASM_MEM_DUAL_BUS_MIRROR.
This commit is contained in:
committed by
GitHub
parent
57abdfdb5c
commit
fbe072c0d3
@ -3013,6 +3013,9 @@ create_sections(AOTModule *module, const uint8 *buf, uint32 size,
|
||||
uint32 section_size;
|
||||
uint64 total_size;
|
||||
uint8 *aot_text;
|
||||
#if (WASM_MEM_DUAL_BUS_MIRROR != 0)
|
||||
uint8 *mirrored_text;
|
||||
#endif
|
||||
|
||||
if (!resolve_execute_mode(buf, size, &is_indirect_mode, error_buf,
|
||||
error_buf_size)) {
|
||||
@ -3071,8 +3074,17 @@ create_sections(AOTModule *module, const uint8 *buf, uint32 size,
|
||||
bh_assert((uintptr_t)aot_text < INT32_MAX);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (WASM_MEM_DUAL_BUS_MIRROR != 0)
|
||||
mirrored_text = os_get_dbus_mirror(aot_text);
|
||||
bh_assert(mirrored_text != NULL);
|
||||
bh_memcpy_s(mirrored_text, (uint32)total_size,
|
||||
section->section_body, (uint32)section_size);
|
||||
os_dcache_flush();
|
||||
#else
|
||||
bh_memcpy_s(aot_text, (uint32)total_size,
|
||||
section->section_body, (uint32)section_size);
|
||||
#endif
|
||||
section->section_body = aot_text;
|
||||
destroy_aot_text = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user