mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 06:15:33 +00:00
Merge branch 'master' into feature/generate-nullfuncs
This commit is contained in:
commit
0435d6149a
8
lib/emscripten/src/bitwise.rs
Normal file
8
lib/emscripten/src/bitwise.rs
Normal file
@ -0,0 +1,8 @@
|
||||
use wasmer_runtime_core::vm::Ctx;
|
||||
|
||||
///emscripten: _llvm_bswap_i64
|
||||
pub fn _llvm_bswap_i64(_ctx: &mut Ctx, _low: i32, high: i32) -> i32 {
|
||||
debug!("emscripten::_llvm_bswap_i64");
|
||||
// setTempRet0(low.swap_bytes)
|
||||
high.swap_bytes()
|
||||
}
|
@ -27,6 +27,7 @@ mod file_descriptor;
|
||||
pub mod stdio;
|
||||
|
||||
// EMSCRIPTEN APIS
|
||||
mod bitwise;
|
||||
mod emscripten_target;
|
||||
mod env;
|
||||
mod errno;
|
||||
@ -628,6 +629,9 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
|
||||
"__longjmp" => func!(crate::jmp::__longjmp),
|
||||
"_longjmp" => func!(crate::jmp::__longjmp),
|
||||
|
||||
// Bitwise
|
||||
"_llvm_bswap_i64" => func!(crate::bitwise::_llvm_bswap_i64),
|
||||
|
||||
// Linking
|
||||
"_dlclose" => func!(crate::linking::_dlclose),
|
||||
"_dlerror" => func!(crate::linking::_dlerror),
|
||||
|
@ -209,9 +209,11 @@ pub fn ___syscall110(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
||||
}
|
||||
|
||||
// getcwd
|
||||
pub fn ___syscall183(ctx: &mut Ctx, buf_offset: u32, _size: u32) -> u32 {
|
||||
pub fn ___syscall183(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> i32 {
|
||||
debug!("emscripten::___syscall183");
|
||||
use std::env;
|
||||
let buf_offset: c_int = varargs.get(ctx);
|
||||
let _size: c_int = varargs.get(ctx);
|
||||
let path = env::current_dir();
|
||||
let path_string = path.unwrap().display().to_string();
|
||||
let len = path_string.len();
|
||||
|
Loading…
Reference in New Issue
Block a user