diff options
author | Marek FiĊĦera <mara@neptuo.com> | 2022-05-25 21:10:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 21:10:59 +0300 |
commit | 5aadefc8b2584cfc0d9a75a79665d042aa4f7b1a (patch) | |
tree | 7a4bcccfe889650b1e212aab2723a976c8d334b3 /src/mono/wasm/runtime | |
parent | dab985716739e1b73a7822ea195b6b3e9600ab6b (diff) |
[wasm] Consolidate interop tables generators (#69620)
Combine PInvoke, icall and ManagedToNative generators to a single MSBuild task.
Diffstat (limited to 'src/mono/wasm/runtime')
-rw-r--r-- | src/mono/wasm/runtime/driver.c | 8 | ||||
-rw-r--r-- | src/mono/wasm/runtime/pinvoke.h | 24 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/mono/wasm/runtime/driver.c b/src/mono/wasm/runtime/driver.c index 596e4f05f3c..5b4274b2e90 100644 --- a/src/mono/wasm/runtime/driver.c +++ b/src/mono/wasm/runtime/driver.c @@ -30,6 +30,10 @@ #include "wasm-config.h" #include "pinvoke.h" + +#ifdef GEN_PINVOKE +#include "wasm_m2n_invoke.g.h" +#endif #include "gc-common.h" #ifdef CORE_BINDINGS @@ -514,6 +518,10 @@ mono_wasm_load_runtime (const char *unused, int debug_level) mono_dl_fallback_register (wasm_dl_load, wasm_dl_symbol, NULL, NULL); mono_wasm_install_get_native_to_interp_tramp (get_native_to_interp); + +#ifdef GEN_PINVOKE + mono_wasm_install_interp_to_native_callback (mono_wasm_interp_to_native_callback); +#endif #ifdef ENABLE_AOT monoeg_g_setenv ("MONO_AOT_MODE", "aot", 1); diff --git a/src/mono/wasm/runtime/pinvoke.h b/src/mono/wasm/runtime/pinvoke.h index 03c5ce4ed6d..a89030d92f4 100644 --- a/src/mono/wasm/runtime/pinvoke.h +++ b/src/mono/wasm/runtime/pinvoke.h @@ -1,6 +1,8 @@ #ifndef __PINVOKE_H__ #define __PINVOKE_H__ +#include <stdint.h> + typedef struct { const char *name; void *func; @@ -23,4 +25,26 @@ wasm_dl_get_native_to_interp (const char *key, void *extra_arg); void mono_wasm_pinvoke_vararg_stub (void); +typedef void* (*MonoWasmNativeToInterpCallback) (char * cookie); + +void +mono_wasm_install_interp_to_native_callback (MonoWasmNativeToInterpCallback cb); + +typedef struct _MonoInterpMethodArguments MonoInterpMethodArguments; + +int +mono_wasm_interp_method_args_get_iarg (MonoInterpMethodArguments *margs, int i); + +int64_t +mono_wasm_interp_method_args_get_larg (MonoInterpMethodArguments *margs, int i); + +float +mono_wasm_interp_method_args_get_farg (MonoInterpMethodArguments *margs, int i); + +double +mono_wasm_interp_method_args_get_darg (MonoInterpMethodArguments *margs, int i); + +void* +mono_wasm_interp_method_args_get_retval (MonoInterpMethodArguments *margs); + #endif |