mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-24 18:02:13 +00:00
add stubs and dispatch
This commit is contained in:
parent
e3a6b7c9d8
commit
b7254ce1f5
7
Cargo.lock
generated
7
Cargo.lock
generated
@ -1477,6 +1477,13 @@ dependencies = [
|
||||
"wasmer-runtime-core 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-wasi"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"wasmer-runtime-core 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-win-exception-handler"
|
||||
version = "0.2.0"
|
||||
|
@ -1,9 +1,7 @@
|
||||
mod syscalls;
|
||||
use syscalls::*;
|
||||
|
||||
use wasmer_runtime_core::{
|
||||
import::ImportObject,
|
||||
imports,
|
||||
func,
|
||||
};
|
||||
use wasmer_runtime_core::{func, import::ImportObject, imports};
|
||||
|
||||
pub fn generate_import_object() -> ImportObject {
|
||||
imports! {
|
||||
@ -12,7 +10,51 @@ pub fn generate_import_object() -> ImportObject {
|
||||
// returns (pointer to state, function that can destruct the state).
|
||||
},
|
||||
"wasi_unstable" => {
|
||||
|
||||
"__wasi_args_get" => func!(__wasi_args_get),
|
||||
"__wasi_args_sizes_get" => func!(__wasi_args_sizes_get),
|
||||
"__wasi_clock_res_get" => func!(__wasi_clock_res_get),
|
||||
"__wasi_clock_time_get" => func!(__wasi_clock_time_get),
|
||||
"__wasi_environ_get" => func!(__wasi_environ_get),
|
||||
"__wasi_environ_sizes_get" => func!(__wasi_environ_sizes_get),
|
||||
"__wasi_fd_advise" => func!(__wasi_fd_advise),
|
||||
"__wasi_fd_allocate" => func!(__wasi_fd_allocate),
|
||||
"__wasi_fd_close" => func!(__wasi_fd_close),
|
||||
"__wasi_fd_datasync" => func!(__wasi_fd_datasync),
|
||||
"__wasi_fd_fdstat_get" => func!(__wasi_fd_fdstat_get),
|
||||
"__wasi_fd_fdstat_set_flags" => func!(__wasi_fd_fdstat_set_flags),
|
||||
"__wasi_fd_fdstat_set_rights" => func!(__wasi_fd_fdstat_set_rights),
|
||||
"__wasi_fd_filestat_get" => func!(__wasi_fd_filestat_get),
|
||||
"__wasi_fd_filestat_set_size" => func!(__wasi_fd_filestat_set_size),
|
||||
"__wasi_fd_filestat_set_times" => func!(__wasi_fd_filestat_set_times),
|
||||
"__wasi_fd_pread" => func!(__wasi_fd_pread),
|
||||
"__wasi_fd_prestat_get" => func!(__wasi_fd_prestat_get),
|
||||
"__wasi_fd_prestat_dir_name" => func!(__wasi_fd_prestat_dir_name),
|
||||
"__wasi_fd_pwrite" => func!(__wasi_fd_pwrite),
|
||||
"__wasi_fd_read" => func!(__wasi_fd_read),
|
||||
"__wasi_fd_readdir" => func!(__wasi_fd_readdir),
|
||||
"__wasi_fd_renumber" => func!(__wasi_fd_renumber),
|
||||
"__wasi_fd_seek" => func!(__wasi_fd_seek),
|
||||
"__wasi_fd_sync" => func!(__wasi_fd_sync),
|
||||
"__wasi_fd_tell" => func!(__wasi_fd_tell),
|
||||
"__wasi_fd_write" => func!(__wasi_fd_write),
|
||||
"__wasi_path_create_directory" => func!(__wasi_path_create_directory),
|
||||
"__wasi_path_filestat_get" => func!(__wasi_path_filestat_get),
|
||||
"__wasi_path_filestat_set_times" => func!(__wasi_path_filestat_set_times),
|
||||
"__wasi_path_link" => func!(__wasi_path_link),
|
||||
"__wasi_path_open" => func!(__wasi_path_open),
|
||||
"__wasi_path_readlink" => func!(__wasi_path_readlink),
|
||||
"__wasi_path_remove_directory" => func!(__wasi_path_remove_directory),
|
||||
"__wasi_path_rename" => func!(__wasi_path_rename),
|
||||
"__wasi_path_symlink" => func!(__wasi_path_symlink),
|
||||
"__wasi_path_unlink_file" => func!(__wasi_path_unlink_file),
|
||||
"__wasi_poll_oneoff" => func!(__wasi_poll_oneoff),
|
||||
"__wasi_proc_exit" => func!(__wasi_proc_exit),
|
||||
"__wasi_proc_raise" => func!(__wasi_proc_raise),
|
||||
"__wasi_random_get" => func!(__wasi_random_get),
|
||||
"__wasi_sched_yield" => func!(__wasi_sched_yield),
|
||||
"__wasi_sock_recv" => func!(__wasi_sock_recv),
|
||||
"__wasi_sock_send" => func!(__wasi_sock_send),
|
||||
"__wasi_sock_shutdown" => func!(__wasi_sock_shutdown),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
137
lib/wasi/src/syscalls/mod.rs
Normal file
137
lib/wasi/src/syscalls/mod.rs
Normal file
@ -0,0 +1,137 @@
|
||||
use wasmer_runtime_core::vm::Ctx;
|
||||
|
||||
pub fn __wasi_args_get(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_args_sizes_get(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_clock_res_get(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_clock_time_get(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_environ_get(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_environ_sizes_get(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_advise(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_allocate(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_close(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_datasync(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_fdstat_get(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_fdstat_set_flags(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_fdstat_set_rights(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_filestat_get(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_filestat_set_size(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_filestat_set_times(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_pread(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_prestat_get(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_prestat_dir_name(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_pwrite(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_read(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_readdir(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_renumber(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_seek(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_sync(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_tell(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_fd_write(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_path_create_directory(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_path_filestat_get(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_path_filestat_set_times(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_path_link(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_path_open(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_path_readlink(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_path_remove_directory(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_path_rename(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_path_symlink(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_path_unlink_file(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_poll_oneoff(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_proc_exit(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_proc_raise(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_random_get(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_sched_yield(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_sock_recv(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_sock_send(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
||||
pub fn __wasi_sock_shutdown(ctx: &mut Ctx) {
|
||||
unimplemented!()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user