You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
733 B
24 lines
733 B
|
|
#include "types.h"
|
|
#include "wasm_store.h"
|
|
|
|
/* This file contains the stub functions that the aWsm compiler expects
|
|
* This corresponds to awsm/src/codegen/runtime_stubs.rs
|
|
* This should be linked with the *.bc file generated by aWsm in order to compile a module as a *.so
|
|
*/
|
|
|
|
extern thread_local struct wasm_module_instance current_wasm_module_instance;
|
|
|
|
INLINE void
|
|
add_function_to_table(uint32_t idx, uint32_t type_id, char *pointer)
|
|
{
|
|
wasm_table_set(current_wasm_module_instance.table, idx, type_id, pointer);
|
|
}
|
|
|
|
/* char * is used as a generic pointer to a function pointer */
|
|
INLINE char *
|
|
get_function_from_table(uint32_t idx, uint32_t type_id)
|
|
{
|
|
return wasm_table_get(current_wasm_module_instance.table, idx, type_id);
|
|
}
|