This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
/
env.h
68 lines (57 loc) · 1.39 KB
/
env.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
#include <stdint.h>
/*
env.h defines a list of built-in functions that the runtime has.
These can be used from the WASM binary.
*/
__attribute__((
__import_module__("env"),
__import_name__("arch_serial_write"),
))
void arch_serial_write(char ch);
__attribute__((
__import_module__("env"),
__import_name__("arch_serial_read"),
))
int arch_serial_read(void);
__attribute__((
__import_module__("env"),
__import_name__("task_exit"),
))
__attribute__((noreturn))
void task_exit(int32_t code);
__attribute__((
__import_module__("env"),
__import_name__("task_destroy"),
))
int task_destroy(int tid);
__attribute__((
__import_module__("env"),
__import_name__("vm_create"),
))
int vm_create(const char *name, void *image, int size);
__attribute__((
__import_module__("env"),
__import_name__("ipc_share_buffer"),
))
void ipc_share_buffer(char *buf, int len);
__attribute__((
__import_module__("env"),
__import_name__("ipc_copy"),
))
int ipc_copy(const char *name, char *buf);
__attribute__((
__import_module__("env"),
__import_name__("ipc_send"),
))
int ipc_send(const char *name, void *msg);
__attribute__((
__import_module__("env"),
__import_name__("ipc_receive"),
))
int ipc_receive(int src, void *msg);
__attribute__((
__import_module__("env"),
__import_name__("ipc_call"),
))
int ipc_call(const char *name, void *msg);