Enhance XIP and add XIP document (#863)

Auto detect whether file is XIP file before loading module in posix like and
linux-sgx platforms, and if yes, mmap executable memory automatically to
run the XIP file.
Add document about XIP feature.
Enable test spec cases with XIP feature.
This commit is contained in:
Wenyong Huang
2021-12-06 17:25:10 +08:00
committed by GitHub
parent 3f808d4596
commit b490a229f6
11 changed files with 184 additions and 24 deletions

View File

@ -235,6 +235,17 @@ wasm_runtime_free(void *ptr);
WASM_RUNTIME_API_EXTERN package_type_t
get_package_type(const uint8_t *buf, uint32_t size);
/**
* Check whether a file is an AOT XIP (Execution In Place) file
*
* @param buf the package buffer
* @param size the package buffer size
*
* @return true if success, false otherwise
*/
WASM_RUNTIME_API_EXTERN bool
wasm_runtime_is_xip_file(const uint8_t *buf, uint32_t size);
/**
* It is a callback for WAMR providing by embedding to load a module file
* into a buffer