llext: introduce 'enum llext_storage_type'
This patch introduces an 'enum llext_storage_type' that defines the
storage type of the ELF data that will be loaded:
- LLEXT_STORAGE_TEMPORARY: ELF data is only available during
llext_load(); even when the loader supports directly accessing the
memory via llext_peek(), the buffer contents will be discarded
afterwards.
LLEXT will allocate copies of all required data into its heap.
- LLEXT_STORAGE_PERSISTENT: ELF data is stored in a *read-only* buffer
that is guaranteed to be always accessible for as long as the
extension is loaded.
LLEXT may directly reuse constant data from the buffer, but may still
allocate copies if relocations need to be applied.
- LLEXT_STORAGE_WRITABLE: ELF data is stored in a *writable* memory
buffer that is guaranteed to be always accessible for as long as the
extension is loaded.
LLEXT may freely modify and reuse data in the buffer; so, after the
extension is unloaded, the contents should be re-initialized before a
subsequent llext_load() call.
To keep full compatibility with existing code, the storage type of
LLEXT_BUF_LOADER is determined by the CONFIG_LLEXT_STORAGE_WRITABLE Kconfig
option between LLEXT_STORAGE_PERSISTENT and LLEXT_STORAGE_WRITABLE.
Signed-off-by:
Luca Burelli <l.burelli@arduino.cc>
Loading
Please sign in to comment