Introduce EnclaveWasmModule to handle WASM modules inside enclaves
#594
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR I replace the existing implementation of the ECall API (in
src/enclave/inside/enclave.cpp) by two different files:src/enclave/inside/ecalls.cpp: declaration of all ECalls and declaration of a map with WASM modules. In general, for each ECall, we (i) acquire a lock on the map, (ii) get a pointer to the module, (iiii) release the lock, and (iv) run the implementation of the ECall inside theEnclaveWasmModule.src/enclave/inside/EnclaveWasmModule.cpp: simplified version of theWAMRWasmModule.In the PR I include only the changes necessary to do this port, and I leave further changes/improvements to subsequent PRs. For instance, I would like to re-factor the ECalls to camelCase, but I'd rather leave that to a separate PR.