[wasm] Add threading, dl and hwcap support for wasm.
[mono.git] / mono / utils / mono-threads-wasm.c
1 #include "config.h"
2
3 #include <mono/utils/mono-threads.h>
4 #include <mono/utils/mono-mmap.h>
5
6 #if defined (USE_WASM_BACKEND)
7
8 #define round_down(addr, val) ((void*)((addr) & ~((val) - 1)))
9
10 void
11 mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize)
12 {
13         *staddr = round_down ((size_t)&staddr, 65536); //WASM pagesize is 64k
14         *stsize = 65536 * 4; //we say it's 4 pages, there isn't much that uses this beyond the GC
15 }
16
17 void
18 mono_threads_suspend_init_signals (void)
19 {
20 }
21
22 void
23 mono_threads_suspend_init (void)
24 {
25 }
26
27 void
28 mono_threads_suspend_register (MonoThreadInfo *info)
29 {
30 }
31
32 gboolean
33 mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
34 {
35         return TRUE;
36 }
37
38 void
39 mono_threads_suspend_free (MonoThreadInfo *info)
40 {
41 }
42
43 gboolean
44 mono_threads_suspend_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel)
45 {
46         return TRUE;
47 }
48
49 gboolean
50 mono_threads_suspend_check_suspend_result (MonoThreadInfo *info)
51 {
52         return TRUE;
53 }
54
55 void
56 mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
57 {
58 }
59
60 #endif