diff --git a/lib/emscripten/src/emscripten_target.rs b/lib/emscripten/src/emscripten_target.rs index 5dbbe1266..3e0ab599a 100644 --- a/lib/emscripten/src/emscripten_target.rs +++ b/lib/emscripten/src/emscripten_target.rs @@ -856,20 +856,3 @@ pub fn invoke_viidddddddd( a10 ); } - -// ucontext.h -pub fn _getcontext(_ctx: &mut Ctx, _ucp: i32) -> i32 { - debug!("emscripten::_getcontext({})", _ucp); - 0 -} -pub fn _makecontext(_ctx: &mut Ctx, _ucp: i32, _func: i32, _argc: i32, _argv: i32) { - debug!("emscripten::_makecontext({}, {}, {}, {})", _ucp, _func, _argc, _argv); -} -pub fn _setcontext(_ctx: &mut Ctx, _ucp: i32) -> i32 { - debug!("emscripten::_setcontext({})", _ucp); - 0 -} -pub fn _swapcontext(_ctx: &mut Ctx, _oucp: i32, _ucp: i32) -> i32 { - debug!("emscripten::_swapcontext({}, {})", _oucp, _ucp); - 0 -} diff --git a/lib/emscripten/src/lib.rs b/lib/emscripten/src/lib.rs index 4e1e746bf..f60156bab 100644 --- a/lib/emscripten/src/lib.rs +++ b/lib/emscripten/src/lib.rs @@ -44,6 +44,7 @@ mod signal; mod storage; mod syscalls; mod time; +mod ucontext; mod utils; mod varargs; @@ -823,11 +824,11 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject "invoke_viidii" => func!(crate::emscripten_target::invoke_viidii), "invoke_viidddddddd" => func!(crate::emscripten_target::invoke_viidddddddd), - // ucontext.h - "_getcontext" => func!(crate::emscripten_target::_getcontext), - "_makecontext" => func!(crate::emscripten_target::_makecontext), - "_setcontext" => func!(crate::emscripten_target::_setcontext), - "_swapcontext" => func!(crate::emscripten_target::_swapcontext), + // ucontext + "_getcontext" => func!(crate::ucontext::_getcontext), + "_makecontext" => func!(crate::ucontext::_makecontext), + "_setcontext" => func!(crate::ucontext::_setcontext), + "_swapcontext" => func!(crate::ucontext::_swapcontext), }; for null_func_name in globals.null_func_names.iter() { diff --git a/lib/emscripten/src/ucontext.rs b/lib/emscripten/src/ucontext.rs new file mode 100644 index 000000000..a7dce73a1 --- /dev/null +++ b/lib/emscripten/src/ucontext.rs @@ -0,0 +1,18 @@ +use wasmer_runtime_core::vm::Ctx; + + +pub fn _getcontext(_ctx: &mut Ctx, _ucp: i32) -> i32 { + debug!("emscripten::_getcontext({})", _ucp); + 0 +} +pub fn _makecontext(_ctx: &mut Ctx, _ucp: i32, _func: i32, _argc: i32, _argv: i32) { + debug!("emscripten::_makecontext({}, {}, {}, {})", _ucp, _func, _argc, _argv); +} +pub fn _setcontext(_ctx: &mut Ctx, _ucp: i32) -> i32 { + debug!("emscripten::_setcontext({})", _ucp); + 0 +} +pub fn _swapcontext(_ctx: &mut Ctx, _oucp: i32, _ucp: i32) -> i32 { + debug!("emscripten::_swapcontext({}, {})", _oucp, _ucp); + 0 +}