But It looks like that the .aot is mapped into RAM and not run inside AOT file directly?
And for Nuttx, os_mmap only the same with malloc, and some chip like esp32 does not support running text in PSRAM, which is allocated by malloc, how can the XIP work in such case? (like Nuttx-esp32)
I suppose that with following steps:
1, map the .aot within a segment of virtual space with MMAP_PROT_EXEC tag (do not allocate in RAM)
2, loading the .aot and parsing its function table without relocation.
3, enable indirect mode, let the internal funcion called by aot_call_indirect
Do you think that is reasonable and is there any suggestion about that?
In this case, you can implement your own iwasm utility (put the AOT-XIP file context in a special executable flash region and run from it) or implement proper os_mmap for your platform (like #1181).
Currently, wamr has already supported XIP feature on Windows&Posix, the entry is as below:
But It looks like that the .aot is mapped into RAM and not run inside AOT file directly?
And for Nuttx, os_mmap only the same with malloc, and some chip like esp32 does not support running text in PSRAM, which is allocated by malloc, how can the XIP work in such case? (like Nuttx-esp32)
I suppose that with following steps: 1, map the .aot within a segment of virtual space with MMAP_PROT_EXEC tag (do not allocate in RAM) 2, loading the .aot and parsing its function table without relocation. 3, enable indirect mode, let the internal funcion called by aot_call_indirect
Do you think that is reasonable and is there any suggestion about that?