diff --git a/Cargo.lock b/Cargo.lock index 9ff66b17..1d60b4c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,6 +98,54 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags 2.6.0", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin 0.9.8", + "thiserror-no-std", + "unwinding", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "asvisor" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "derive_more", + "env_logger", + "libasvisor", + "log", + "thiserror-no-std", + "tokio", +] + [[package]] name = "async-trait" version = "0.1.74" @@ -553,7 +601,7 @@ dependencies = [ name = "gen-file" version = "0.1.0" dependencies = [ - "libmsvisor", + "libasvisor", ] [[package]] @@ -753,6 +801,24 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +[[package]] +name = "libasvisor" +version = "0.1.0" +dependencies = [ + "anyhow", + "as_hostcall", + "env_logger", + "heapless", + "lazy_static", + "libloading", + "log", + "nix", + "serde", + "serde_json", + "thiserror", + "xmas-elf", +] + [[package]] name = "libc" version = "0.2.158" @@ -775,24 +841,6 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" -[[package]] -name = "libmsvisor" -version = "0.1.0" -dependencies = [ - "anyhow", - "env_logger", - "heapless", - "lazy_static", - "libloading", - "log", - "ms_hostcall", - "nix", - "serde", - "serde_json", - "thiserror", - "xmas-elf", -] - [[package]] name = "linked_list_allocator" version = "0.10.5" @@ -895,61 +943,13 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags 2.6.0", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin 0.9.8", - "thiserror-no-std", - "unwinding", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "msvisor" -version = "0.1.0" -dependencies = [ - "anyhow", - "clap", - "derive_more", - "env_logger", - "libmsvisor", - "log", - "thiserror-no-std", - "tokio", -] - [[package]] name = "msvisor-d" version = "0.1.0" dependencies = [ "anyhow", "axum", - "libmsvisor", + "libasvisor", "log", "serde", "tokio", @@ -1797,11 +1797,11 @@ dependencies = [ name = "wasmtime_wasi_api" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown 0.14.5", "lazy_static", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "sjlj", "spin 0.9.8", "wasmtime", diff --git a/Cargo.toml b/Cargo.toml index 1eab97ba..667083fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,28 +3,28 @@ [workspace] members = [ "bins/*", - "libmsvisor", - "ms_hostcall", - "ms_std_proc_macro", - "ms_std", + "libasvisor", + "as_hostcall", + "as_std_proc_macro", + "as_std", "wasmtime_wasi_api", ] # The reason for excluding "user/" is obvious. This workspace can be regarded as # a toolchain of libos. But "user/" are users' function. # -# The reason for excluding "common_service/" is relate to feature gates of ms_std. -# In current implementation, ms_std has conflict features (e.g. `panic_def` and +# The reason for excluding "common_service/" is relate to feature gates of as_std. +# In current implementation, as_std has conflict features (e.g. `panic_def` and # `unwinding`). Of course, if add "user/" to members, will also have problem of # feature gate. exclude = ["user/", "common_service/", "baseline/"] -default-members = ["bins/msvisor"] +default-members = ["bins/asvisor"] resolver = "2" [workspace.dependencies] -libmsvisor = { path = "libmsvisor", default-features = false, features = [ +libasvisor = { path = "libasvisor", default-features = false, features = [ # "enable_mpk", ] } -ms_hostcall = { path = "ms_hostcall" } -ms_std = { path = "ms_std" } +as_hostcall = { path = "as_hostcall" } +as_std = { path = "as_std" } diff --git a/README.md b/README.md index 3e661d1c..49f32c22 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# MSlibOS +# AlloyStack -[![CI](https://github.com/anti-entropy123/mslibos/actions/workflows/main.yml/badge.svg)](https://github.com/anti-entropy123/mslibos/actions/workflows/main.yml) + ## 构建 diff --git a/ms_hostcall/Cargo.lock b/as_hostcall/Cargo.lock similarity index 100% rename from ms_hostcall/Cargo.lock rename to as_hostcall/Cargo.lock diff --git a/ms_hostcall/Cargo.toml b/as_hostcall/Cargo.toml similarity index 96% rename from ms_hostcall/Cargo.toml rename to as_hostcall/Cargo.toml index d1fd6437..d6671d5e 100644 --- a/ms_hostcall/Cargo.toml +++ b/as_hostcall/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ms_hostcall" +name = "as_hostcall" version = "0.1.0" edition = "2021" diff --git a/ms_hostcall/src/err.rs b/as_hostcall/src/err.rs similarity index 100% rename from ms_hostcall/src/err.rs rename to as_hostcall/src/err.rs diff --git a/ms_hostcall/src/fatfs.rs b/as_hostcall/src/fatfs.rs similarity index 100% rename from ms_hostcall/src/fatfs.rs rename to as_hostcall/src/fatfs.rs diff --git a/ms_hostcall/src/fdtab.rs b/as_hostcall/src/fdtab.rs similarity index 100% rename from ms_hostcall/src/fdtab.rs rename to as_hostcall/src/fdtab.rs diff --git a/ms_hostcall/src/lib.rs b/as_hostcall/src/lib.rs similarity index 100% rename from ms_hostcall/src/lib.rs rename to as_hostcall/src/lib.rs diff --git a/ms_hostcall/src/mm.rs b/as_hostcall/src/mm.rs similarity index 100% rename from ms_hostcall/src/mm.rs rename to as_hostcall/src/mm.rs diff --git a/ms_hostcall/src/mmap_file_backend.rs b/as_hostcall/src/mmap_file_backend.rs similarity index 100% rename from ms_hostcall/src/mmap_file_backend.rs rename to as_hostcall/src/mmap_file_backend.rs diff --git a/ms_hostcall/src/mpk.rs b/as_hostcall/src/mpk.rs similarity index 100% rename from ms_hostcall/src/mpk.rs rename to as_hostcall/src/mpk.rs diff --git a/ms_hostcall/src/signal.rs b/as_hostcall/src/signal.rs similarity index 100% rename from ms_hostcall/src/signal.rs rename to as_hostcall/src/signal.rs diff --git a/ms_hostcall/src/socket.rs b/as_hostcall/src/socket.rs similarity index 100% rename from ms_hostcall/src/socket.rs rename to as_hostcall/src/socket.rs diff --git a/ms_hostcall/src/types.rs b/as_hostcall/src/types.rs similarity index 100% rename from ms_hostcall/src/types.rs rename to as_hostcall/src/types.rs diff --git a/ms_std/Cargo.toml b/as_std/Cargo.toml similarity index 83% rename from ms_std/Cargo.toml rename to as_std/Cargo.toml index 9d8ea25b..0926c47b 100644 --- a/ms_std/Cargo.toml +++ b/as_std/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ms_std" +name = "as_std" version = "0.1.0" edition = "2021" @@ -9,13 +9,13 @@ crate-type = ["rlib"] [dependencies] -ms_hostcall = { workspace = true, features = [ +as_hostcall = { workspace = true, features = [ "socket", "fdtab", "fatfs", "mm", ] } -ms_std_proc_macro = { path = "../ms_std_proc_macro" } +as_std_proc_macro = { path = "../as_std_proc_macro" } # buddy_system_allocator = "0.9" unwinding = { version = "=0.2.0", features = [ @@ -38,7 +38,7 @@ serde_json = { version = "1.0.135", default-features = false, features = [ [features] panic_def = [] alloc_def = [] -mpk = ["ms_hostcall/enable_mpk"] +mpk = ["as_hostcall/enable_mpk"] file-based = [] default = [] diff --git a/ms_std/src/agent.rs b/as_std/src/agent.rs similarity index 99% rename from ms_std/src/agent.rs rename to as_std/src/agent.rs index 99ae797c..c86edca1 100644 --- a/ms_std/src/agent.rs +++ b/as_std/src/agent.rs @@ -35,7 +35,7 @@ mod refer_based_impl { use core::{alloc::Layout, borrow::Borrow, mem::ManuallyDrop}; use alloc::{boxed::Box, string::String}; - use ms_hostcall::Verify; + use as_hostcall::Verify; use crate::{libos::libos, println}; @@ -163,7 +163,7 @@ mod refer_based_impl { mod file_based_impl { use alloc::{format, string::String}; use core::{borrow::Borrow, fmt::Write}; - use ms_hostcall::Verify; + use as_hostcall::Verify; use serde::{Deserialize, Serialize}; use crate::fs::File; diff --git a/ms_std/src/args.rs b/as_std/src/args.rs similarity index 100% rename from ms_std/src/args.rs rename to as_std/src/args.rs diff --git a/ms_std/src/console.rs b/as_std/src/console.rs similarity index 100% rename from ms_std/src/console.rs rename to as_std/src/console.rs diff --git a/ms_std/src/fs.rs b/as_std/src/fs.rs similarity index 98% rename from ms_std/src/fs.rs rename to as_std/src/fs.rs index 099be913..50012048 100644 --- a/ms_std/src/fs.rs +++ b/as_std/src/fs.rs @@ -1,4 +1,4 @@ -use ms_hostcall::{ +use as_hostcall::{ fdtab::{FdtabError, FdtabResult}, types::{Fd, OpenFlags, OpenMode, Stat}, }; diff --git a/ms_std/src/heap_alloc.rs b/as_std/src/heap_alloc.rs similarity index 95% rename from ms_std/src/heap_alloc.rs rename to as_std/src/heap_alloc.rs index beeda10f..a2a9091d 100644 --- a/ms_std/src/heap_alloc.rs +++ b/as_std/src/heap_alloc.rs @@ -1,5 +1,5 @@ use linked_list_allocator::LockedHeap; -use ms_hostcall::SERVICE_HEAP_SIZE; +use as_hostcall::SERVICE_HEAP_SIZE; #[global_allocator] pub static HEAP_ALLOCATOR: LockedHeap = LockedHeap::empty(); diff --git a/ms_std/src/init_context.rs b/as_std/src/init_context.rs similarity index 93% rename from ms_std/src/init_context.rs rename to as_std/src/init_context.rs index 32bfc2ee..2d6bb59d 100644 --- a/ms_std/src/init_context.rs +++ b/as_std/src/init_context.rs @@ -2,9 +2,9 @@ //! and `get_handler_addr`. These two symbols will be lookup when //! initialize service. //! To some service that depent `std`, they would use this crate directly -//! rather than `ms_std`. +//! rather than `as_std`. -use ms_hostcall::{types::HostCallResult as HCResult, IsolationContext}; +use as_hostcall::{types::HostCallResult as HCResult, IsolationContext}; use spin::Mutex; diff --git a/ms_std/src/io.rs b/as_std/src/io.rs similarity index 97% rename from ms_std/src/io.rs rename to as_std/src/io.rs index 2661a0e0..d74c559b 100644 --- a/ms_std/src/io.rs +++ b/as_std/src/io.rs @@ -2,7 +2,7 @@ use alloc::{ string::{String, ToString}, vec::Vec, }; -use ms_hostcall::fdtab::FdtabError; +use as_hostcall::fdtab::FdtabError; pub trait Read { fn read(&mut self, buf: &mut [u8]) -> Result; diff --git a/ms_std/src/lib.rs b/as_std/src/lib.rs similarity index 100% rename from ms_std/src/lib.rs rename to as_std/src/lib.rs diff --git a/ms_std/src/libos/mod.rs b/as_std/src/libos/mod.rs similarity index 98% rename from ms_std/src/libos/mod.rs rename to as_std/src/libos/mod.rs index bb767b6b..864a8f74 100644 --- a/ms_std/src/libos/mod.rs +++ b/as_std/src/libos/mod.rs @@ -3,8 +3,8 @@ use core::mem::MaybeUninit; use spin::Mutex; use crate::init_context::isolation_ctx; -pub use ms_hostcall::types::MetricEvent; -use ms_hostcall::{ +pub use as_hostcall::types::MetricEvent; +use as_hostcall::{ types::{FindHostCallFunc, PanicHandlerFunc, Transmutor}, CommonHostCall, HostCallID, }; diff --git a/as_std/src/libos/utils.rs b/as_std/src/libos/utils.rs new file mode 100644 index 00000000..fbf0d083 --- /dev/null +++ b/as_std/src/libos/utils.rs @@ -0,0 +1,142 @@ +use crate::libos::USER_HOST_CALL; + +pub macro func_type { + (metric) => (as_hostcall::types::MetricFunc), + (fs_image) => (as_hostcall::types::FsImageFunc), + (spawn_fault_handler) => (as_hostcall::types::SpawnFaultThreadFunc), + (write) => (as_hostcall::fdtab::WriteFunc), + (open) => (as_hostcall::fdtab::OpenFunc), + (read) => (as_hostcall::fdtab::ReadFunc), + (close) => (as_hostcall::fdtab::CloseFunc), + (lseek) => (as_hostcall::fdtab::LseekFunc), + (stat) => (as_hostcall::fdtab::StatFunc), + (readdir) => (as_hostcall::fdtab::ReadDirFunc), + (connect) => (as_hostcall::fdtab::ConnectFunc), + (bind) => (as_hostcall::fdtab::BindFunc), + (accept) => (as_hostcall::fdtab::AcceptFunc), + (fatfs_open) => (as_hostcall::fatfs::FatfsOpenFunc), + (fatfs_write) => (as_hostcall::fatfs::FatfsWriteFunc), + (fatfs_read) => (as_hostcall::fatfs::FatfsReadFunc), + (fatfs_close) => (as_hostcall::fatfs::FatfsCloseFunc), + (fatfs_seek) => (as_hostcall::fatfs::FatfsSeekFunc), + (fatfs_stat) => (as_hostcall::fatfs::FatfsStatFunc), + (stdout) => (as_hostcall::types::HostStdioFunc), + (addrinfo) => (as_hostcall::socket::SmoltcpAddrInfoFunc), + (smol_connect) => (as_hostcall::socket::SmoltcpConnectFunc), + (send) => (as_hostcall::socket::SmoltcpSendFunc), + (recv) => (as_hostcall::socket::SmoltcpRecvFunc), + (smol_bind) => (as_hostcall::socket::SmoltcpBindFunc), + (smol_accept) => (as_hostcall::socket::SmoltcpAcceptFunc), + (smol_close) => (as_hostcall::socket::SmoltcpCloseFunc), + (buffer_alloc) => (as_hostcall::mm::BufferAllocFunc), + (access_buffer) => (as_hostcall::mm::AccessBufferFunc), + (buffer_dealloc) => (as_hostcall::mm::BufferDeallocFunc), + (mmap) => (as_hostcall::mm::MemmapFunc), + (munmap) => (as_hostcall::mm::MemunmapFunc), + (mprotect) => (as_hostcall::mm::MprotectFunc), + (register_file_backend) => (as_hostcall::mmap_file_backend::RegisterFileBackendFunc), + (unregister_file_backend) => (as_hostcall::mmap_file_backend::UnregisterFileBackendFunc), + (get_time) => (as_hostcall::types::GetTimeFunc), + (nanosleep) => (as_hostcall::types::NanoSleepFunc), + (sigaction) => (as_hostcall::signal::SigActionFunc), +} + +pub macro hostcall_id { + (metric) => (as_hostcall::CommonHostCall::Metric), + (fs_image) => (as_hostcall::CommonHostCall::FsImage), + (spawn_fault_handler) => (as_hostcall::CommonHostCall::SpawnFaultThread), + (write) => (as_hostcall::CommonHostCall::Write), + (open) => (as_hostcall::CommonHostCall::Open), + (read) => (as_hostcall::CommonHostCall::Read), + (close) => (as_hostcall::CommonHostCall::Close), + (lseek) => (as_hostcall::CommonHostCall::Lseek), + (stat) => (as_hostcall::CommonHostCall::Stat), + (readdir) => (as_hostcall::CommonHostCall::ReadDir), + (connect) => (as_hostcall::CommonHostCall::Connect), + (bind) => (as_hostcall::CommonHostCall::Bind), + (accept) => (as_hostcall::CommonHostCall::Accept), + (fatfs_open) => (as_hostcall::CommonHostCall::FatfsOpen), + (fatfs_write) => (as_hostcall::CommonHostCall::FatfsWrite), + (fatfs_read) => (as_hostcall::CommonHostCall::FatfsRead), + (fatfs_close) => (as_hostcall::CommonHostCall::FatfsClose), + (fatfs_seek) => (as_hostcall::CommonHostCall::FatfsSeek), + (fatfs_stat) => (as_hostcall::CommonHostCall::FatfsStat), + (stdout) => (as_hostcall::CommonHostCall::Stdout), + (addrinfo) => (as_hostcall::CommonHostCall::SmoltcpAddrInfo), + (smol_connect) => (as_hostcall::CommonHostCall::SmoltcpConnect), + (send) => (as_hostcall::CommonHostCall::SmoltcpSend), + (recv) => (as_hostcall::CommonHostCall::SmoltcpRecv), + (smol_bind) => (as_hostcall::CommonHostCall::SmoltcpBind), + (smol_accept) => (as_hostcall::CommonHostCall::SmoltcpAccept), + (smol_close) => (as_hostcall::CommonHostCall::SmoltcpClose), + (buffer_alloc) => (as_hostcall::CommonHostCall::BufferAlloc), + (access_buffer) => (as_hostcall::CommonHostCall::AccessBuffer), + (buffer_dealloc) => (as_hostcall::CommonHostCall::BufferDealloc), + (mmap) => (as_hostcall::CommonHostCall::Mmap), + (munmap) => (as_hostcall::CommonHostCall::Munmap), + (mprotect) => (as_hostcall::CommonHostCall::Mprotect), + (register_file_backend) => (as_hostcall::CommonHostCall::RegisterFileBackend), + (unregister_file_backend) => (as_hostcall::CommonHostCall::UnregisterFileBackend), + (get_time) => (as_hostcall::CommonHostCall::GetTime), + (nanosleep) => (as_hostcall::CommonHostCall::NanoSleep), + (sigaction) => (as_hostcall::CommonHostCall::SigAction), +} + +pub macro libos { + ($name:ident($($arg_name:expr),*)) => { + { + fn binding() -> func_type!($name){ + let mut table = USER_HOST_CALL.lock(); + unsafe { core::mem::transmute(table.get_or_find(hostcall_id!($name))) } + } + let $name = binding(); + let res = $name($($arg_name),*); + res + } + } +} + +#[cfg(feature = "mpk")] +pub macro libos_with_switch_mpk { + ($name:ident($($arg_name:expr),*)) => { + { + use core::arch::asm; + use crate::mpk; + let pkru = mpk::pkey_read(); + let is_privilege_level = (pkru >> 30 == 0); + // grant access to libos. 00 00 11 ... ... 11 00 + let pkru = mpk::grant_libos_perm(pkru); + unsafe{ + asm!( + // "mov eax, 0x0FFFFFFC", + "xor rcx, rcx", + "mov rdx, rcx", + "wrpkru", + in("rax") pkru, + ); + } + + fn binding() -> func_type!($name){ + let mut table = USER_HOST_CALL.lock(); + unsafe { core::mem::transmute(table.get_or_find(hostcall_id!($name))) } + } + let $name = binding(); + let res = $name($($arg_name),*); + + if !is_privilege_level { + let pkru = mpk::drop_libos_perm(pkru); + // drop permission to libos. 11 00 11 ... ... 11 00 + unsafe{ + asm!( + // "mov eax, 0xCFFFFFFC", + "xor rcx, rcx", + "mov rdx, rcx", + in("rax") pkru, + ); + } + } + + res + } + } +} diff --git a/ms_std/src/mm.rs b/as_std/src/mm.rs similarity index 98% rename from ms_std/src/mm.rs rename to as_std/src/mm.rs index 2ba8df42..481221ff 100644 --- a/ms_std/src/mm.rs +++ b/as_std/src/mm.rs @@ -1,6 +1,6 @@ use core::{mem::ManuallyDrop, slice}; -use ms_hostcall::{ +use as_hostcall::{ fdtab::FdtabError, mm::{MMError, ProtFlags}, }; diff --git a/ms_std/src/mpk.rs b/as_std/src/mpk.rs similarity index 97% rename from ms_std/src/mpk.rs rename to as_std/src/mpk.rs index f44e9b4e..cf6d4ab5 100644 --- a/ms_std/src/mpk.rs +++ b/as_std/src/mpk.rs @@ -1,6 +1,6 @@ use core::arch::asm; -use ms_hostcall::mpk::LIBOS_PKEY; +use as_hostcall::mpk::LIBOS_PKEY; pub fn pkey_read() -> u32 { // Reads the value of PKRU into EAX and clears EDX. ECX must be 0 when RDPKRU is executed; otherwise, a general-protection exception (#GP) occurs. diff --git a/ms_std/src/net.rs b/as_std/src/net.rs similarity index 98% rename from ms_std/src/net.rs rename to as_std/src/net.rs index 056855aa..9f677e69 100644 --- a/ms_std/src/net.rs +++ b/as_std/src/net.rs @@ -4,7 +4,7 @@ use core::{ }; use alloc::vec::Vec; -use ms_hostcall::{fdtab::FdtabError, socket::SmoltcpError, types::Fd}; +use as_hostcall::{fdtab::FdtabError, socket::SmoltcpError, types::Fd}; use crate::{ io::{Read, Write}, diff --git a/ms_std/src/prelude.rs b/as_std/src/prelude.rs similarity index 100% rename from ms_std/src/prelude.rs rename to as_std/src/prelude.rs diff --git a/ms_std/src/sym_patch.rs b/as_std/src/sym_patch.rs similarity index 100% rename from ms_std/src/sym_patch.rs rename to as_std/src/sym_patch.rs diff --git a/ms_std/src/sync.rs b/as_std/src/sync.rs similarity index 100% rename from ms_std/src/sync.rs rename to as_std/src/sync.rs diff --git a/ms_std/src/time.rs b/as_std/src/time.rs similarity index 100% rename from ms_std/src/time.rs rename to as_std/src/time.rs diff --git a/ms_std_proc_macro/Cargo.lock b/as_std_proc_macro/Cargo.lock similarity index 100% rename from ms_std_proc_macro/Cargo.lock rename to as_std_proc_macro/Cargo.lock diff --git a/ms_std_proc_macro/Cargo.toml b/as_std_proc_macro/Cargo.toml similarity index 89% rename from ms_std_proc_macro/Cargo.toml rename to as_std_proc_macro/Cargo.toml index 1dddb828..91140cd7 100644 --- a/ms_std_proc_macro/Cargo.toml +++ b/as_std_proc_macro/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ms_std_proc_macro" +name = "as_std_proc_macro" version = "0.1.0" edition = "2021" diff --git a/ms_std_proc_macro/src/lib.rs b/as_std_proc_macro/src/lib.rs similarity index 90% rename from ms_std_proc_macro/src/lib.rs rename to as_std_proc_macro/src/lib.rs index b1ab402b..a8becdee 100644 --- a/ms_std_proc_macro/src/lib.rs +++ b/as_std_proc_macro/src/lib.rs @@ -42,7 +42,7 @@ fn derive_verify_impl(t: proc_macro2::TokenStream) -> proc_macro2::TokenStream { let fingerprint: u64 = hasher.finish(); quote::quote! { - impl ms_hostcall::Verify for #struct_name { + impl as_hostcall::Verify for #struct_name { fn __fingerprint() -> u64 { #fingerprint } @@ -54,11 +54,11 @@ fn derive_verify_impl(t: proc_macro2::TokenStream) -> proc_macro2::TokenStream { fn faas_arg_impl_test() { assert_eq!( derive_verify_impl("struct my_args {a: i64}".parse().unwrap()).to_string(), - "impl ms_hostcall :: Verify for my_args { fn __fingerprint () -> u64 { 13418197873283780248u64 } }" + "impl as_hostcall :: Verify for my_args { fn __fingerprint () -> u64 { 13418197873283780248u64 } }" ); assert_eq!( derive_verify_impl("struct my_args {a: String, b:i32,}".parse().unwrap()).to_string(), - "impl ms_hostcall :: Verify for my_args { fn __fingerprint () -> u64 { 7169761655847290832u64 } }" + "impl as_hostcall :: Verify for my_args { fn __fingerprint () -> u64 { 7169761655847290832u64 } }" ); } diff --git a/bins/msvisor-d/Cargo.toml b/bins/asvisor-d/Cargo.toml similarity index 81% rename from bins/msvisor-d/Cargo.toml rename to bins/asvisor-d/Cargo.toml index 00a2755f..79e3faf8 100644 --- a/bins/msvisor-d/Cargo.toml +++ b/bins/asvisor-d/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libmsvisor = { workspace = true, default-features = false, features = [] } +libasvisor = { workspace = true, default-features = false, features = [] } log = "0.4.20" tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread"] } @@ -15,6 +15,6 @@ serde = { version = "1.0.188" } anyhow = { version = "1.0.75" } [features] -namespace = ["libmsvisor/namespace"] +namespace = ["libasvisor/namespace"] default = ["namespace"] diff --git a/bins/msvisor-d/src/main.rs b/bins/asvisor-d/src/main.rs similarity index 99% rename from bins/msvisor-d/src/main.rs rename to bins/asvisor-d/src/main.rs index b44a5690..fe4d5ddb 100644 --- a/bins/msvisor-d/src/main.rs +++ b/bins/asvisor-d/src/main.rs @@ -1,7 +1,7 @@ use std::time::SystemTime; use axum::{extract::Query, response::IntoResponse, routing::get, Router}; -use libmsvisor::{ +use libasvisor::{ isolation::{config::IsolationConfig, Isolation}, logger, }; diff --git a/bins/msvisor/Cargo.toml b/bins/asvisor/Cargo.toml similarity index 72% rename from bins/msvisor/Cargo.toml rename to bins/asvisor/Cargo.toml index 659c0db9..e2998c28 100644 --- a/bins/msvisor/Cargo.toml +++ b/bins/asvisor/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "msvisor" +name = "asvisor" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libmsvisor = { workspace = true, default-features = false, features = [] } +libasvisor = { workspace = true, default-features = false, features = [] } log = "0.4.20" env_logger = "0.10.0" @@ -20,9 +20,9 @@ tokio = { version = "1.32.0", features = [ ], optional = true } [features] -namespace = ["libmsvisor/namespace"] +namespace = ["libasvisor/namespace"] multi_workflow = ["tokio", "namespace"] -mpk = ["libmsvisor/enable_mpk"] -pkey_per_func = ["mpk", "libmsvisor/pkey_per_func"] +mpk = ["libasvisor/enable_mpk"] +pkey_per_func = ["mpk", "libasvisor/pkey_per_func"] default = ["namespace"] diff --git a/bins/msvisor/src/main.rs b/bins/asvisor/src/main.rs similarity index 92% rename from bins/msvisor/src/main.rs rename to bins/asvisor/src/main.rs index b5d73cea..4a1fc96b 100644 --- a/bins/msvisor/src/main.rs +++ b/bins/asvisor/src/main.rs @@ -3,7 +3,7 @@ use std::{sync::Arc, thread::sleep, time::Duration}; use clap::{arg, Parser}; use derive_more::Display; -use libmsvisor::{ +use libasvisor::{ isolation::{config::IsolationConfig, get_isol, Isolation}, logger, }; @@ -21,12 +21,12 @@ pub enum MetricOpt { } impl MetricOpt { - fn to_analyze(&self) -> libmsvisor::MetricOpt { + fn to_analyze(&self) -> libasvisor::MetricOpt { match self { - MetricOpt::None => libmsvisor::MetricOpt::None, - MetricOpt::All => libmsvisor::MetricOpt::All, - MetricOpt::Mem => libmsvisor::MetricOpt::Mem, - MetricOpt::TotalDur => libmsvisor::MetricOpt::TotalDur, + MetricOpt::None => libasvisor::MetricOpt::None, + MetricOpt::All => libasvisor::MetricOpt::All, + MetricOpt::Mem => libasvisor::MetricOpt::Mem, + MetricOpt::TotalDur => libasvisor::MetricOpt::TotalDur, } } } diff --git a/bins/gen-file/Cargo.toml b/bins/gen-file/Cargo.toml index 84a1afe6..ad567354 100644 --- a/bins/gen-file/Cargo.toml +++ b/bins/gen-file/Cargo.toml @@ -6,4 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libmsvisor = { workspace = true } \ No newline at end of file +libasvisor = { workspace = true } \ No newline at end of file diff --git a/bins/gen-file/src/main.rs b/bins/gen-file/src/main.rs index 17bf70ec..eaa109dc 100644 --- a/bins/gen-file/src/main.rs +++ b/bins/gen-file/src/main.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use libmsvisor::isolation::config::{ +use libasvisor::isolation::config::{ App, IsolationConfig, IsolationGroup, IsolationGroupApp, LoadableUnit, }; diff --git a/common_service/fatfs/Cargo.lock b/common_service/fatfs/Cargo.lock index 4b992e67..6c283209 100644 --- a/common_service/fatfs/Cargo.lock +++ b/common_service/fatfs/Cargo.lock @@ -17,6 +17,39 @@ dependencies = [ "libc", ] +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags 2.6.0", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -105,10 +138,10 @@ dependencies = [ name = "fatfs" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "fatfs 0.3.6", "fscommon", - "ms_hostcall", - "ms_std", ] [[package]] @@ -226,39 +259,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags 2.6.0", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "num-traits" version = "0.2.17" diff --git a/common_service/fatfs/Cargo.toml b/common_service/fatfs/Cargo.toml index d2743f59..3cb206b4 100644 --- a/common_service/fatfs/Cargo.toml +++ b/common_service/fatfs/Cargo.toml @@ -8,12 +8,12 @@ edition = "2021" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = [] } -ms_hostcall = { path = "../../ms_hostcall", features = ["fatfs"] } +as_std = { path = "../../as_std", features = [] } +as_hostcall = { path = "../../as_hostcall", features = ["fatfs"] } fatfs = "0.3.6" fscommon = "0.1.1" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] \ No newline at end of file diff --git a/common_service/fatfs/src/apis.rs b/common_service/fatfs/src/apis.rs index ba059fc4..07b3ee93 100644 --- a/common_service/fatfs/src/apis.rs +++ b/common_service/fatfs/src/apis.rs @@ -3,7 +3,7 @@ use std::{ mem::ManuallyDrop, }; -use ms_hostcall::{ +use as_hostcall::{ fatfs::{FatfsError, FatfsResult}, types::{Fd, OpenFlags, Size, Stat, TimeSpec}, }; diff --git a/common_service/fatfs/src/lib.rs b/common_service/fatfs/src/lib.rs index 22d9578b..2a4bca6f 100644 --- a/common_service/fatfs/src/lib.rs +++ b/common_service/fatfs/src/lib.rs @@ -9,8 +9,8 @@ use std::{ use fscommon::BufStream; -use ms_hostcall::{fatfs::FatfsError, types::Fd}; -use ms_std::libos::libos; +use as_hostcall::{fatfs::FatfsError, types::Fd}; +use as_std::libos::libos; type FileSystem = fatfs::FileSystem>; type File<'a> = fatfs::File<'a, fscommon::BufStream>; @@ -20,7 +20,7 @@ pub mod apis; pub mod drop_fs; fn get_fs_image_path() -> PathBuf { - let image_path = match libos!(fs_image(ms_std::init_context::isolation_ctx().isol_id)) { + let image_path = match libos!(fs_image(as_std::init_context::isolation_ctx().isol_id)) { Some(s) => s, None => "fs_images/fatfs.img".to_owned(), }; diff --git a/common_service/fdtab/Cargo.lock b/common_service/fdtab/Cargo.lock index 6a3f511f..ea6f1c04 100644 --- a/common_service/fdtab/Cargo.lock +++ b/common_service/fdtab/Cargo.lock @@ -2,6 +2,40 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", + "unwinding", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -49,8 +83,8 @@ dependencies = [ name = "fdtab" version = "0.1.0" dependencies = [ - "ms_hostcall", - "ms_std", + "as_hostcall", + "as_std", "spin", ] @@ -116,40 +150,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", - "unwinding", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" diff --git a/common_service/fdtab/Cargo.toml b/common_service/fdtab/Cargo.toml index f112b421..3844b9b8 100644 --- a/common_service/fdtab/Cargo.toml +++ b/common_service/fdtab/Cargo.toml @@ -9,8 +9,8 @@ edition = "2021" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "unwinding"] } -ms_hostcall = { path = "../../ms_hostcall", features = [ +as_std = { path = "../../as_std", features = ["alloc_def", "unwinding"] } +as_hostcall = { path = "../../as_hostcall", features = [ "fatfs", "socket", "fdtab", @@ -19,5 +19,5 @@ ms_hostcall = { path = "../../ms_hostcall", features = [ spin = "0.9.8" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] \ No newline at end of file diff --git a/common_service/fdtab/src/apis.rs b/common_service/fdtab/src/apis.rs index fca9c3a9..ca3ee0b1 100644 --- a/common_service/fdtab/src/apis.rs +++ b/common_service/fdtab/src/apis.rs @@ -1,11 +1,11 @@ use core::net::SocketAddrV4; use alloc::borrow::ToOwned; -use ms_hostcall::{ +use as_hostcall::{ fdtab::{FdtabError, FdtabResult}, types::{Fd, OpenFlags, OpenMode, Size, SockFd, Stat}, }; -use ms_std::libos::libos; +use as_std::libos::libos; use crate::{DataSource, File, FD_TABLE}; diff --git a/common_service/fdtab/src/lib.rs b/common_service/fdtab/src/lib.rs index dd76e914..43153abe 100644 --- a/common_service/fdtab/src/lib.rs +++ b/common_service/fdtab/src/lib.rs @@ -7,8 +7,8 @@ use alloc::vec::Vec; use spin::Mutex; -use ms_hostcall::types::{Fd, OpenMode, SockFd}; -use ms_std::{self, println}; +use as_hostcall::types::{Fd, OpenMode, SockFd}; +use as_std::{self, println}; pub mod apis; diff --git a/common_service/mm/Cargo.lock b/common_service/mm/Cargo.lock index 5cf6b275..fdcc3aa6 100644 --- a/common_service/mm/Cargo.lock +++ b/common_service/mm/Cargo.lock @@ -14,6 +14,39 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin 0.9.8", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -135,48 +168,15 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" name = "mm" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "hashbrown", "lazy_static", "libc", "linked_list_allocator", - "ms_hostcall", - "ms_std", "spin 0.9.8", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin 0.9.8", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "once_cell" version = "1.18.0" diff --git a/common_service/mm/Cargo.toml b/common_service/mm/Cargo.toml index b87d93f5..c777336f 100644 --- a/common_service/mm/Cargo.toml +++ b/common_service/mm/Cargo.toml @@ -8,8 +8,8 @@ edition = "2021" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "panic_def"] } -ms_hostcall = { path = "../../ms_hostcall", features = [ +as_std = { path = "../../as_std", features = ["alloc_def", "panic_def"] } +as_hostcall = { path = "../../as_hostcall", features = [ "fatfs", "mmap_file_backend", "mm", @@ -24,5 +24,5 @@ linked_list_allocator = "0.10.5" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] \ No newline at end of file diff --git a/common_service/mm/src/faas_buffer/mod.rs b/common_service/mm/src/faas_buffer/mod.rs index 4b32a3d9..d1473ef6 100644 --- a/common_service/mm/src/faas_buffer/mod.rs +++ b/common_service/mm/src/faas_buffer/mod.rs @@ -5,7 +5,7 @@ use core::{alloc::Layout, ptr::NonNull}; use alloc::{borrow::ToOwned, string::String}; use linked_list_allocator::LockedHeap; -use ms_hostcall::{mm::MMResult, SERVICE_HEAP_SIZE}; +use as_hostcall::{mm::MMResult, SERVICE_HEAP_SIZE}; use hashbrown::HashMap; use lazy_static::lazy_static; @@ -15,7 +15,7 @@ lazy_static! { static ref BUFFER_REGISTER: Mutex> = Mutex::new(HashMap::new()); static ref BUFFER_ALLOCATOR: LockedHeap = unsafe { LockedHeap::new( - ms_std::init_context::ISOLATION_CTX.lock().heap_range.1 as *mut u8, + as_std::init_context::ISOLATION_CTX.lock().heap_range.1 as *mut u8, SERVICE_HEAP_SIZE / 2, ) }; @@ -34,7 +34,7 @@ pub fn buffer_alloc(slot: &str, l: Layout, fingerprint: u64) -> MMResult .lock() .insert(slot.to_owned(), (addr, fingerprint)); - // ms_std::println!("buffer_alloc layout={:?}, addr=0x{:x}", l, addr); + // as_std::println!("buffer_alloc layout={:?}, addr=0x{:x}", l, addr); Ok(addr) } @@ -42,9 +42,9 @@ pub fn buffer_alloc(slot: &str, l: Layout, fingerprint: u64) -> MMResult #[no_mangle] pub fn access_buffer(slot: &str) -> Option<(usize, u64)> { let mut register = BUFFER_REGISTER.lock(); - // ms_std::println!("buffer register: "); + // as_std::println!("buffer register: "); // for (k, v) in register.iter() { - // ms_std::println!(" {}: {:?}", k, v); + // as_std::println!(" {}: {:?}", k, v); // } register.remove(slot) } diff --git a/common_service/mm/src/mmap.rs b/common_service/mm/src/mmap.rs index 3b3138f5..b0fbac3e 100644 --- a/common_service/mm/src/mmap.rs +++ b/common_service/mm/src/mmap.rs @@ -4,11 +4,11 @@ use core::alloc::Layout; use alloc::borrow::ToOwned; use libc::c_void; -use ms_hostcall::{ +use as_hostcall::{ mm::{MMError, MMResult, ProtFlags}, types::Fd, }; -use ms_std::libos::libos; +use as_std::libos::libos; const PAGE_SIZE: usize = 0x1000; diff --git a/common_service/mmap_file_backend/Cargo.lock b/common_service/mmap_file_backend/Cargo.lock index b9731859..69d0e3ab 100644 --- a/common_service/mmap_file_backend/Cargo.lock +++ b/common_service/mmap_file_backend/Cargo.lock @@ -11,6 +11,39 @@ dependencies = [ "memchr", ] +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -197,45 +230,12 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" name = "mmap_file_backend" version = "0.1.0" dependencies = [ - "ms_hostcall", - "ms_std", + "as_hostcall", + "as_std", "nix", "userfaultfd", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "nix" version = "0.27.1" diff --git a/common_service/mmap_file_backend/Cargo.toml b/common_service/mmap_file_backend/Cargo.toml index 910f982d..01e948bb 100644 --- a/common_service/mmap_file_backend/Cargo.toml +++ b/common_service/mmap_file_backend/Cargo.toml @@ -9,8 +9,8 @@ edition = "2021" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std" } -ms_hostcall = { path = "../../ms_hostcall", features = [ +as_std = { path = "../../as_std" } +as_hostcall = { path = "../../as_hostcall", features = [ "fatfs", "mmap_file_backend", ] } @@ -20,5 +20,5 @@ userfaultfd = { version = "0.7.0", features = [] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] \ No newline at end of file diff --git a/common_service/mmap_file_backend/src/apis.rs b/common_service/mmap_file_backend/src/apis.rs index ad0d0ee6..bd46844f 100644 --- a/common_service/mmap_file_backend/src/apis.rs +++ b/common_service/mmap_file_backend/src/apis.rs @@ -8,11 +8,11 @@ use std::{ use nix::sys::epoll::{Epoll, EpollCreateFlags, EpollEvent, EpollFlags}; use userfaultfd::{Uffd, UffdBuilder}; -use ms_hostcall::{ +use as_hostcall::{ mmap_file_backend::{MmapFileErr, MmapFileResult}, types::Fd, }; -use ms_std::libos::libos; +use as_std::libos::libos; use crate::{ acquire_regions_or_notify, acquire_register, do_page_fault, init_notify_pipe, read_notify_pipe, @@ -102,7 +102,7 @@ pub fn register_file_backend(mm_region: &mut [c_void], file_fd: Fd) -> MmapFileR init_notify_pipe()?; libos!(spawn_fault_handler( - ms_std::init_context::isolation_ctx().isol_id + as_std::init_context::isolation_ctx().isol_id ))?; } // println!("spawn_fault_handler successfully."); diff --git a/common_service/mmap_file_backend/src/lib.rs b/common_service/mmap_file_backend/src/lib.rs index 36746bc1..6f004315 100644 --- a/common_service/mmap_file_backend/src/lib.rs +++ b/common_service/mmap_file_backend/src/lib.rs @@ -10,11 +10,11 @@ use std::{ use nix::fcntl::{fcntl, FcntlArg, OFlag}; use userfaultfd::{Event, Uffd}; -use ms_hostcall::{ +use as_hostcall::{ mmap_file_backend::{MmapFileErr, MmapFileResult}, types::Fd, }; -use ms_std::libos::libos; +use as_std::libos::libos; pub mod apis; diff --git a/common_service/ruxfdtab/Cargo.lock b/common_service/ruxfdtab/Cargo.lock index d977fbba..abe090d4 100644 --- a/common_service/ruxfdtab/Cargo.lock +++ b/common_service/ruxfdtab/Cargo.lock @@ -27,6 +27,39 @@ dependencies = [ "tock-registers", ] +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags 2.6.0", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.3.0" @@ -406,39 +439,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "359639f2591c78370034feaa79ebd114516d04ba642a89bb68b2b806ef2bc2f6" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags 2.6.0", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "nb" version = "0.1.3" @@ -613,11 +613,11 @@ dependencies = [ name = "ruxfdtab" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "axerrno", "axio", "lazy_static", - "ms_hostcall", - "ms_std", "ruxdriver", "ruxfdtable", "ruxfs", diff --git a/common_service/ruxfdtab/Cargo.toml b/common_service/ruxfdtab/Cargo.toml index 9a650a54..98c362d0 100644 --- a/common_service/ruxfdtab/Cargo.toml +++ b/common_service/ruxfdtab/Cargo.toml @@ -8,8 +8,8 @@ crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std" } -ms_hostcall = { path = "../../ms_hostcall", features = ["fatfs"] } +as_std = { path = "../../as_std" } +as_hostcall = { path = "../../as_hostcall", features = ["fatfs"] } axerrno = { git = "https://github.com/anti-entropy123/ruxos/" } # axerrno = { path = "/home/yjn/rust_project/ruxos/crates/axerrno" } @@ -33,7 +33,7 @@ spin = "0.9.8" lazy_static = { version = "1.5.0", features = ["spin_no_std"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] use-ramdisk = ["ruxfs/use-ramdisk", "ruxfs/full", "ruxdriver"] log = [] diff --git a/common_service/ruxfdtab/src/as_apis.rs b/common_service/ruxfdtab/src/as_apis.rs index dd8fca14..fa0b81fb 100644 --- a/common_service/ruxfdtab/src/as_apis.rs +++ b/common_service/ruxfdtab/src/as_apis.rs @@ -3,13 +3,13 @@ extern crate alloc; use std::path::PathBuf; use alloc::vec; -use ms_std::{libos::libos}; +use as_std::{libos::libos}; use crate::{ fd_ops::{close_file_like, get_file_like}, fs, }; -use ms_hostcall::{ +use as_hostcall::{ fdtab::{FdtabError, FdtabResult}, types::{DirEntry, Fd, OpenFlags, OpenMode, Size, Stat, TimeSpec}, }; @@ -54,7 +54,7 @@ fn convert(ruxstat: RuxStat) -> Stat { } fn get_fs_image_path() -> PathBuf { - let image_path = match libos!(fs_image(ms_std::init_context::isolation_ctx().isol_id)) { + let image_path = match libos!(fs_image(as_std::init_context::isolation_ctx().isol_id)) { Some(s) => s, None => "fs_images/fatfs.img".to_owned(), }; diff --git a/common_service/ruxfdtab/src/fd_ops.rs b/common_service/ruxfdtab/src/fd_ops.rs index 48105399..85b9a46c 100644 --- a/common_service/ruxfdtab/src/fd_ops.rs +++ b/common_service/ruxfdtab/src/fd_ops.rs @@ -1,5 +1,5 @@ use alloc::sync::Arc; -use ms_hostcall::{ +use as_hostcall::{ fdtab::{FdtabError, FdtabResult}, types::Fd, }; diff --git a/common_service/ruxfdtab/src/fs.rs b/common_service/ruxfdtab/src/fs.rs index ca8b1e4a..ec323522 100644 --- a/common_service/ruxfdtab/src/fs.rs +++ b/common_service/ruxfdtab/src/fs.rs @@ -1,7 +1,7 @@ use alloc::sync::Arc; use axerrno::LinuxResult; use axio::PollState; -use ms_hostcall::{ +use as_hostcall::{ fdtab::{FdtabError, FdtabResult}, types::Fd, }; diff --git a/common_service/ruxfdtab/src/lib.rs b/common_service/ruxfdtab/src/lib.rs index d4def3b6..f22e8e50 100644 --- a/common_service/ruxfdtab/src/lib.rs +++ b/common_service/ruxfdtab/src/lib.rs @@ -11,7 +11,7 @@ extern crate alloc; -pub use ms_std; +pub use as_std; pub mod as_apis; pub mod fd_ops; diff --git a/common_service/ruxfdtab/src/stdio.rs b/common_service/ruxfdtab/src/stdio.rs index 04b2bd28..cdb75ac5 100644 --- a/common_service/ruxfdtab/src/stdio.rs +++ b/common_service/ruxfdtab/src/stdio.rs @@ -1,7 +1,7 @@ use alloc::sync::Arc; use axerrno::{LinuxError, LinuxResult}; use axio::PollState; -use ms_std::libos::libos; +use as_std::libos::libos; pub struct Stdin {} pub struct Stdout {} diff --git a/common_service/signal/Cargo.lock b/common_service/signal/Cargo.lock index e75563ad..edbf85b0 100644 --- a/common_service/signal/Cargo.lock +++ b/common_service/signal/Cargo.lock @@ -2,6 +2,39 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.4.0" @@ -104,39 +137,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "nc" version = "0.9.5" @@ -233,8 +233,8 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" name = "signal" version = "0.1.0" dependencies = [ - "ms_hostcall", - "ms_std", + "as_hostcall", + "as_std", "nc", ] diff --git a/common_service/signal/Cargo.toml b/common_service/signal/Cargo.toml index 241f8280..23e1ff11 100644 --- a/common_service/signal/Cargo.toml +++ b/common_service/signal/Cargo.toml @@ -9,9 +9,9 @@ crate-type = ["dylib"] [dependencies] nc = { version = "0.9.5", default-features = false } -ms_std = { path = "../../ms_std", features = [] } -ms_hostcall = { path = "../../ms_hostcall", features = ["signal"] } +as_std = { path = "../../as_std", features = [] } +as_hostcall = { path = "../../as_hostcall", features = ["signal"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] diff --git a/common_service/signal/src/lib.rs b/common_service/signal/src/lib.rs index 197fe628..e3c2afeb 100644 --- a/common_service/signal/src/lib.rs +++ b/common_service/signal/src/lib.rs @@ -1,5 +1,5 @@ -use ms_hostcall::signal::SigAction; -pub use ms_std; +use as_hostcall::signal::SigAction; +pub use as_std; use nc::{self, sigset_t}; #[no_mangle] diff --git a/common_service/socket/Cargo.lock b/common_service/socket/Cargo.lock index b88d7d9e..16bef442 100644 --- a/common_service/socket/Cargo.lock +++ b/common_service/socket/Cargo.lock @@ -2,6 +2,39 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags 2.6.0", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -168,39 +201,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags 2.6.0", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -358,13 +358,13 @@ dependencies = [ name = "socket" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "defmt", "lazy_static", "libc", "log", "managed", - "ms_hostcall", - "ms_std", "rand", "smoltcp", ] diff --git a/common_service/socket/Cargo.toml b/common_service/socket/Cargo.toml index 9ab6e02f..61ec3c8f 100644 --- a/common_service/socket/Cargo.toml +++ b/common_service/socket/Cargo.toml @@ -9,8 +9,8 @@ edition = "2021" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = [] } -ms_hostcall = { path = "../../ms_hostcall", features = ["socket", "fatfs"] } +as_std = { path = "../../as_std", features = [] } +as_hostcall = { path = "../../as_hostcall", features = ["socket", "fatfs"] } log = "0.4.20" # env_logger = "0.10.0" @@ -32,6 +32,6 @@ smoltcp = { version = "0.11.0", default-features = false, features = [ [features] log = [] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] diff --git a/common_service/socket/src/apis.rs b/common_service/socket/src/apis.rs index 1e0c0727..c1d0170a 100644 --- a/common_service/socket/src/apis.rs +++ b/common_service/socket/src/apis.rs @@ -13,12 +13,12 @@ use smoltcp::{ wire::{DnsQueryType, Ipv4Address}, }; -use ms_hostcall::{ +use as_hostcall::{ socket::{SmoltcpError, SmoltcpResult}, types::{Size, SockFd}, }; #[cfg(feature = "log")] -use ms_std::println; +use as_std::println; use crate::{acquire_iface, acquire_sockets, from_sockfd, iface_poll, to_sockfd, try_phy_wait}; diff --git a/common_service/socket/src/lib.rs b/common_service/socket/src/lib.rs index f6dacb61..a47416a8 100644 --- a/common_service/socket/src/lib.rs +++ b/common_service/socket/src/lib.rs @@ -20,11 +20,11 @@ use smoltcp::{ }; use crate::setup_tap::exec_tap_setup; -use ms_hostcall::{ +use as_hostcall::{ socket::{SmoltcpError, SmoltcpResult}, types::{NetdevName, SockFd}, }; -use ms_std::init_context; +use as_std::init_context; pub mod apis; pub mod logs; diff --git a/common_service/socket/src/logs.rs b/common_service/socket/src/logs.rs index 98949a0d..21c774aa 100644 --- a/common_service/socket/src/logs.rs +++ b/common_service/socket/src/logs.rs @@ -1,5 +1,5 @@ use log::{Metadata, Record}; -use ms_std::time::{self, SystemTime}; +use as_std::time::{self, SystemTime}; pub struct MyLogger {} diff --git a/common_service/socket/src/setup_tap.rs b/common_service/socket/src/setup_tap.rs index b9e59cfb..04f9b375 100644 --- a/common_service/socket/src/setup_tap.rs +++ b/common_service/socket/src/setup_tap.rs @@ -5,7 +5,7 @@ use std::{ process::{Command, Stdio}, }; -use ms_hostcall::types::NetdevName; +use as_hostcall::types::NetdevName; fn gen_sudo_command() -> Command { let mut comd = Command::new("sudo"); diff --git a/common_service/stdio/Cargo.lock b/common_service/stdio/Cargo.lock index cb1c9a65..1194e7f9 100644 --- a/common_service/stdio/Cargo.lock +++ b/common_service/stdio/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + [[package]] name = "bitflags" version = "2.6.0" @@ -27,15 +36,6 @@ dependencies = [ "syn", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - [[package]] name = "proc-macro2" version = "1.0.70" @@ -73,7 +73,7 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" name = "stdio" version = "0.1.0" dependencies = [ - "ms_hostcall", + "as_hostcall", ] [[package]] diff --git a/common_service/stdio/Cargo.toml b/common_service/stdio/Cargo.toml index c44eee61..a57f906e 100644 --- a/common_service/stdio/Cargo.toml +++ b/common_service/stdio/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" crate-type = ["dylib"] [dependencies] -ms_hostcall = { path = "../../ms_hostcall" } +as_hostcall = { path = "../../as_hostcall" } [features] diff --git a/common_service/stdio/src/lib.rs b/common_service/stdio/src/lib.rs index 3c8c1c91..266b2dbe 100644 --- a/common_service/stdio/src/lib.rs +++ b/common_service/stdio/src/lib.rs @@ -1,4 +1,4 @@ -use ms_hostcall::types::Size; +use as_hostcall::types::Size; #[no_mangle] pub fn host_stdout(buf: &[u8]) -> Size { diff --git a/justfile b/justfile index 8ce55e64..92937889 100644 --- a/justfile +++ b/justfile @@ -78,109 +78,54 @@ cc_flags_p1 := "-Wl,--gc-sections -nostdlib -Wl,--whole-archive" cc_flags_p2 := "-Wl,--no-whole-archive -shared" target := "x86_64-unknown-none" -c_mapper_so: - @echo "c_mapper.so" - cd user/wasmtime_mapper \ +wasm_func func_name: + cd user/{{ func_name }} \ && cargo build \ --target {{target}} {{mpk_feature_flag}} \ && cc {{cc_flags_p1}} \ - target/{{target}}/debug/libwasmtime_mapper.a \ + target/{{target}}/debug/lib{{ func_name }}.a \ {{cc_flags_p2}} \ - -o target/{{target}}/debug/libwasmtime_mapper.so + -o target/{{target}}/debug/lib{{ func_name }}.so + +symbol_link func_name: + @ln -s $(pwd)/user/{{ func_name }}/target/{{target}}/debug/lib{{ func_name }}.so target/debug/ -c_reducer_so: - @echo "c_reducer.so" - cd user/wasmtime_reducer \ - && cargo build --target {{target}} {{mpk_feature_flag}} \ - && cc {{cc_flags_p1}} \ - target/{{target}}/debug/libwasmtime_reducer.a \ - {{cc_flags_p2}} \ - -o target/{{target}}/debug/libwasmtime_reducer.so -wasmtime_wordcount: c_mapper_so c_reducer_so - @echo "make symbol link: wasmtime_wordcount" +wasmtime_wordcount: + just wasm_func wasmtime_mapper + just wasm_func wasmtime_reducer @-rm target/debug/libwasmtime_mapper.so @-rm target/debug/libwasmtime_reducer.so - @ln -s $(pwd)/user/wasmtime_mapper/target/{{target}}/debug/libwasmtime_mapper.so target/debug/ - @ln -s $(pwd)/user/wasmtime_reducer/target/{{target}}/debug/libwasmtime_reducer.so target/debug/ - -c_sorter_so: - @echo "c_sorter.so" - cd user/wasmtime_sorter \ - && cargo build --target {{target}} {{mpk_feature_flag}}\ - && cc {{cc_flags_p1}} \ - target/{{target}}/debug/libwasmtime_sorter.a \ - {{cc_flags_p2}} \ - -o target/{{target}}/debug/libwasmtime_sorter.so - -c_spliter_so: - @echo "c_spliter.so" - cd user/wasmtime_spliter \ - && cargo build --target {{target}} {{mpk_feature_flag}}\ - && cc {{cc_flags_p1}} \ - target/{{target}}/debug/libwasmtime_spliter.a \ - {{cc_flags_p2}} \ - -o target/{{target}}/debug/libwasmtime_spliter.so - -c_merger_so: - @echo "c_merger.so" - cd user/wasmtime_merger \ - && cargo build --target {{target}} {{mpk_feature_flag}}\ - && cc {{cc_flags_p1}} \ - target/{{target}}/debug/libwasmtime_merger.a \ - {{cc_flags_p2}} \ - -o target/{{target}}/debug/libwasmtime_merger.so + just symbol_link wasmtime_mapper + just symbol_link wasmtime_reducer -c_checker_so: - @echo "c_checker.so" - cd user/wasmtime_checker \ - && cargo build --target {{target}} {{mpk_feature_flag}}\ - && cc {{cc_flags_p1}} \ - target/{{target}}/debug/libwasmtime_checker.a \ - {{cc_flags_p2}} \ - -o target/{{target}}/debug/libwasmtime_checker.so +wasmtime_parallel_sort: + just wasm_func wasmtime_sorter + just wasm_func wasmtime_spliter + just wasm_func wasmtime_merger + just wasm_func wasmtime_checker -wasmtime_parallel_sort: c_sorter_so c_spliter_so c_merger_so c_checker_so - @echo "make symbol link: wasmtime_parallel_sort" @-rm target/debug/libwasmtime_sorter.so @-rm target/debug/libwasmtime_spliter.so @-rm target/debug/libwasmtime_merger.so @-rm target/debug/libwasmtime_checker.so - @ln -s $(pwd)/user/wasmtime_sorter/target/{{target}}/debug/libwasmtime_sorter.so target/debug/ - @ln -s $(pwd)/user/wasmtime_spliter/target/{{target}}/debug/libwasmtime_spliter.so target/debug/ - @ln -s $(pwd)/user/wasmtime_merger/target/{{target}}/debug/libwasmtime_merger.so target/debug/ - @ln -s $(pwd)/user/wasmtime_checker/target/{{target}}/debug/libwasmtime_checker.so target/debug/ - - + + just symbol_link wasmtime_sorter + just symbol_link wasmtime_spliter + just symbol_link wasmtime_merger + just symbol_link wasmtime_checker + all_c_wasm: wasmtime_wordcount wasmtime_parallel_sort -cpython_wordcount_so: - @echo "cpython_wordcount.so" - cd user/wasmtime_cpython_wordcount \ - && cargo build --target {{target}} {{mpk_feature_flag}}\ - && cc {{cc_flags_p1}} \ - target/{{target}}/debug/libwasmtime_cpython_wordcount.a \ - {{cc_flags_p2}} \ - -o target/{{target}}/debug/libwasmtime_cpython_wordcount.so - -cpython_wordcount: cpython_wordcount_so - @echo "make symbol link: cpython_wordcount" +cpython_wordcount: + just wasm_func wasmtime_cpython_wordcount @-rm target/debug/libwasmtime_cpython_wordcount.so - @ln -s $(pwd)/user/wasmtime_cpython_wordcount/target/x86_64-unknown-none/debug/libwasmtime_cpython_wordcount.so target/debug - -cpython_parallel_sort_so: - @echo "cpython_parallel_sort.so" - cd user/wasmtime_cpython_parallel_sort \ - && cargo build --target {{target}} {{mpk_feature_flag}}\ - && cc {{cc_flags_p1}} \ - target/{{target}}/debug/libwasmtime_cpython_parallel_sort.a \ - {{cc_flags_p2}} \ - -o target/{{target}}/debug/libwasmtime_cpython_parallel_sort.so + just symbol_link wasmtime_cpython_wordcount -cpython_parallel_sort: cpython_parallel_sort_so - @echo "make symbol link: cpython_parallel_sort" +cpython_parallel_sort: + just wasm_func wasmtime_cpython_parallel_sort @-rm target/debug/libwasmtime_cpython_parallel_sort.so - @ln -s $(pwd)/user/wasmtime_cpython_parallel_sort/target/{{target}}/debug/libwasmtime_cpython_parallel_sort.so target/debug/ + just symbol_link wasmtime_cpython_parallel_sort all_py_wasm: cpython_wordcount cpython_parallel_sort diff --git a/libmsvisor/Cargo.toml b/libasvisor/Cargo.toml similarity index 88% rename from libmsvisor/Cargo.toml rename to libasvisor/Cargo.toml index 26cb7fc2..be155805 100644 --- a/libmsvisor/Cargo.toml +++ b/libasvisor/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "libmsvisor" +name = "libasvisor" version = "0.1.0" edition = "2021" # build = "build.rs" @@ -10,7 +10,7 @@ edition = "2021" lazy_static = "1.4.0" [dependencies] -ms_hostcall = { workspace = true } +as_hostcall = { workspace = true } libloading = "0.8.0" anyhow = "1.0.75" @@ -27,7 +27,7 @@ heapless = "0.8" [features] namespace = [] serviceV2 = ["nix/mman"] -enable_mpk = ["ms_hostcall/enable_mpk"] +enable_mpk = ["as_hostcall/enable_mpk"] pkey_per_func = ["enable_mpk"] default = [] diff --git a/libmsvisor/_build.rs b/libasvisor/_build.rs similarity index 100% rename from libmsvisor/_build.rs rename to libasvisor/_build.rs diff --git a/libmsvisor/src/hostcalls.rs b/libasvisor/src/hostcalls.rs similarity index 77% rename from libmsvisor/src/hostcalls.rs rename to libasvisor/src/hostcalls.rs index babbbbe1..fb590924 100644 --- a/libmsvisor/src/hostcalls.rs +++ b/libasvisor/src/hostcalls.rs @@ -1,5 +1,5 @@ use libloading::Symbol; -use ms_hostcall::types::{GetHandlerFunc, RustMainFunc, SetHandlerFunc}; +use as_hostcall::types::{GetHandlerFunc, RustMainFunc, SetHandlerFunc}; pub type SetHandlerFuncSybmol<'a> = Symbol<'a, SetHandlerFunc>; pub type GetHandlerFuncSybmol<'a> = Symbol<'a, GetHandlerFunc>; diff --git a/libmsvisor/src/isolation/config.rs b/libasvisor/src/isolation/config.rs similarity index 99% rename from libmsvisor/src/isolation/config.rs rename to libasvisor/src/isolation/config.rs index a7ffd86b..4d48bc83 100644 --- a/libmsvisor/src/isolation/config.rs +++ b/libasvisor/src/isolation/config.rs @@ -2,7 +2,7 @@ use std::{collections::BTreeMap, fs, io::BufReader, path::PathBuf}; use anyhow; use log::{debug, warn}; -use ms_hostcall::types::ServiceName; +use as_hostcall::types::ServiceName; #[allow(unused_imports)] use serde::{Deserialize, Serialize}; diff --git a/libmsvisor/src/isolation/handler.rs b/libasvisor/src/isolation/handler.rs similarity index 96% rename from libmsvisor/src/isolation/handler.rs rename to libasvisor/src/isolation/handler.rs index 215cf717..fde3feed 100644 --- a/libmsvisor/src/isolation/handler.rs +++ b/libasvisor/src/isolation/handler.rs @@ -2,7 +2,7 @@ use core::panic; use std::mem::transmute; use log::info; -use ms_hostcall::{ +use as_hostcall::{ types::{FsImageFunc, IsolationID, MetricEvent, MetricFunc, NetdevName}, CommonHostCall, HostCallID, }; @@ -10,7 +10,7 @@ use ms_hostcall::{ #[cfg(feature = "enable_mpk")] use crate::mpk; #[cfg(feature = "enable_mpk")] -use ms_hostcall::mpk::LIBOS_PKEY; +use as_hostcall::mpk::LIBOS_PKEY; use crate::{isolation::get_isol, logger}; @@ -143,7 +143,7 @@ fn find_host_call_test() { // isol_table.insert(1, Arc::clone(&isol)); }; - let hostcall_id = HostCallID::Common(ms_hostcall::CommonHostCall::Write); + let hostcall_id = HostCallID::Common(as_hostcall::CommonHostCall::Write); let addr = unsafe { find_host_call(1, hostcall_id) }; let fs_svc = isol @@ -169,7 +169,7 @@ pub fn netdev_alloc_handler() -> Result { /// rather than `panic!`. /// /// ## Safety -/// It should only be invoked by panic_handler of ms_std. +/// It should only be invoked by panic_handler of as_std. pub unsafe extern "C" fn panic_handler() -> ! { panic!() // core::panic!() diff --git a/libmsvisor/src/isolation/mod.rs b/libasvisor/src/isolation/mod.rs similarity index 99% rename from libmsvisor/src/isolation/mod.rs rename to libasvisor/src/isolation/mod.rs index 205b3301..cf2039a5 100644 --- a/libmsvisor/src/isolation/mod.rs +++ b/libasvisor/src/isolation/mod.rs @@ -12,7 +12,7 @@ use anyhow::{anyhow, Ok}; use lazy_static::lazy_static; use log::{info, warn}; -use ms_hostcall::types::{ +use as_hostcall::types::{ IsolationID as IsolID, MetricEvent::{IsolBegin, IsolEnd, Mem}, ServiceName, @@ -21,7 +21,7 @@ use ms_hostcall::types::{ #[cfg(feature = "enable_mpk")] use crate::{mpk, mpk::must_init_all_pkeys}; #[cfg(feature = "enable_mpk")] -use ms_hostcall::mpk::LIBOS_PKEY; +use as_hostcall::mpk::LIBOS_PKEY; use crate::{ logger, diff --git a/libmsvisor/src/lib.rs b/libasvisor/src/lib.rs similarity index 100% rename from libmsvisor/src/lib.rs rename to libasvisor/src/lib.rs diff --git a/libmsvisor/src/logger.rs b/libasvisor/src/logger.rs similarity index 100% rename from libmsvisor/src/logger.rs rename to libasvisor/src/logger.rs diff --git a/libmsvisor/src/metric.rs b/libasvisor/src/metric.rs similarity index 99% rename from libmsvisor/src/metric.rs rename to libasvisor/src/metric.rs index 0b5c5e24..dc3bafe8 100644 --- a/libmsvisor/src/metric.rs +++ b/libasvisor/src/metric.rs @@ -5,7 +5,7 @@ use std::{ time::UNIX_EPOCH, }; -use ms_hostcall::types::{MetricEvent, ServiceName}; +use as_hostcall::types::{MetricEvent, ServiceName}; use serde::Serialize; use serde_json::{json, Value}; diff --git a/libmsvisor/src/mpk.rs b/libasvisor/src/mpk.rs similarity index 98% rename from libmsvisor/src/mpk.rs rename to libasvisor/src/mpk.rs index 16408aa6..d064727d 100644 --- a/libmsvisor/src/mpk.rs +++ b/libasvisor/src/mpk.rs @@ -2,7 +2,7 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use std::{arch::asm, ffi::c_void}; use anyhow::{anyhow, Ok}; -use ms_hostcall::mpk::LIBOS_PKEY; +use as_hostcall::mpk::LIBOS_PKEY; use nix::{ errno::Errno, libc::{size_t, syscall, SYS_pkey_alloc, SYS_pkey_mprotect}, @@ -20,7 +20,7 @@ pub fn must_init_all_pkeys() { if pkey < 0 { panic!("pkey_alloc failed at {}", i); } - if pkey == ms_hostcall::mpk::LIBOS_PKEY { + if pkey == as_hostcall::mpk::LIBOS_PKEY { return; } } diff --git a/libmsvisor/src/service/elf_service.rs b/libasvisor/src/service/elf_service.rs similarity index 99% rename from libmsvisor/src/service/elf_service.rs rename to libasvisor/src/service/elf_service.rs index 9f5173a3..0b7dd307 100644 --- a/libmsvisor/src/service/elf_service.rs +++ b/libasvisor/src/service/elf_service.rs @@ -15,7 +15,7 @@ use lazy_static::lazy_static; use libloading::{Library, Symbol}; use log::info; -use ms_hostcall::{ +use as_hostcall::{ types::{DropHandlerFunc, IsolationID, MetricEvent, ServiceName}, IsolationContext, SERVICE_HEAP_SIZE, SERVICE_STACK_SIZE, }; @@ -35,7 +35,7 @@ use crate::{ use super::loader::Namespace; use core::arch::asm; -use ms_hostcall::types::RustMainFunc; +use as_hostcall::types::RustMainFunc; use std::mem::forget; diff --git a/libmsvisor/src/service/loader.rs b/libasvisor/src/service/loader.rs similarity index 98% rename from libmsvisor/src/service/loader.rs rename to libasvisor/src/service/loader.rs index 095942a1..aa0d5413 100644 --- a/libmsvisor/src/service/loader.rs +++ b/libasvisor/src/service/loader.rs @@ -8,11 +8,11 @@ use std::{ #[cfg(feature = "enable_mpk")] use crate::mpk; #[cfg(feature = "enable_mpk")] -use ms_hostcall::mpk::LIBOS_PKEY; +use as_hostcall::mpk::LIBOS_PKEY; use anyhow::anyhow; use libloading::Library; -use ms_hostcall::types::{IsolationID, MetricEvent, ServiceName}; +use as_hostcall::types::{IsolationID, MetricEvent, ServiceName}; use nix::libc::Lmid_t; use crate::{isolation::config::IsolationConfig, metric::MetricBucket, utils}; diff --git a/libmsvisor/src/service/mod.rs b/libasvisor/src/service/mod.rs similarity index 98% rename from libmsvisor/src/service/mod.rs rename to libasvisor/src/service/mod.rs index 84234542..aa1638fa 100644 --- a/libmsvisor/src/service/mod.rs +++ b/libasvisor/src/service/mod.rs @@ -9,7 +9,7 @@ use libloading::{Library, Symbol}; use elf_service::WithLibOSService; pub use loader::ServiceLoader; -use ms_hostcall::types::{IsolationID, ServiceName}; +use as_hostcall::types::{IsolationID, ServiceName}; use crate::{logger, metric::SvcMetricBucket, service::elf_service::ElfService}; diff --git a/libmsvisor/src/service/rust_service.rs b/libasvisor/src/service/rust_service.rs similarity index 98% rename from libmsvisor/src/service/rust_service.rs rename to libasvisor/src/service/rust_service.rs index 3f889df2..a1a82126 100644 --- a/libmsvisor/src/service/rust_service.rs +++ b/libasvisor/src/service/rust_service.rs @@ -4,8 +4,8 @@ use std::{fmt::Display, fs::File, io::Read, num::NonZeroUsize, os::fd::AsFd, rc::Rc}; +use as_hostcall::types::{IsolationID, ServiceName}; use libloading::Symbol; -use ms_hostcall::types::{IsolationID, ServiceName}; use nix::sys::mman::{mmap, MapFlags, ProtFlags}; use xmas_elf::program::{ProgramHeader, Type}; diff --git a/libmsvisor/src/utils.rs b/libasvisor/src/utils.rs similarity index 100% rename from libmsvisor/src/utils.rs rename to libasvisor/src/utils.rs diff --git a/libmsvisor/tests/faasflow_test.rs b/libasvisor/tests/faasflow_test.rs similarity index 92% rename from libmsvisor/tests/faasflow_test.rs rename to libasvisor/tests/faasflow_test.rs index b4bd76df..3794e63e 100644 --- a/libmsvisor/tests/faasflow_test.rs +++ b/libasvisor/tests/faasflow_test.rs @@ -1,4 +1,4 @@ -use libmsvisor::isolation::{config::IsolationConfig, Isolation}; +use libasvisor::isolation::{config::IsolationConfig, Isolation}; #[test] fn faasflow_test() { @@ -22,7 +22,7 @@ fn faasflow_test() { #[test] fn long_chain_test() { - // use libmsvisor::logger; + // use libasvisor::logger; // logger::init(); diff --git a/libmsvisor/tests/file_test.rs b/libasvisor/tests/file_test.rs similarity index 92% rename from libmsvisor/tests/file_test.rs rename to libasvisor/tests/file_test.rs index 9694e665..17fe330a 100644 --- a/libmsvisor/tests/file_test.rs +++ b/libasvisor/tests/file_test.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use libmsvisor::{logger, run_single_isol}; +use libasvisor::{logger, run_single_isol}; #[test] fn run_operate_file_test() { diff --git a/libmsvisor/tests/network_test.rs b/libasvisor/tests/network_test.rs similarity index 87% rename from libmsvisor/tests/network_test.rs rename to libasvisor/tests/network_test.rs index 81b28443..b8a27098 100644 --- a/libmsvisor/tests/network_test.rs +++ b/libasvisor/tests/network_test.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use libmsvisor::{ +use libasvisor::{ isolation::{config::IsolationConfig, Isolation}, logger, }; @@ -19,6 +19,6 @@ fn run_send_request_test() { isol1.run().expect("isolation user function error."); log::info!("isol1 has strong count={}", Arc::strong_count(&isol1)); - isol1.metric.analyze(&libmsvisor::MetricOpt::None); + isol1.metric.analyze(&libasvisor::MetricOpt::None); drop(isol1); } diff --git a/libmsvisor/tests/run_dylib_test.rs b/libasvisor/tests/run_dylib_test.rs similarity index 97% rename from libmsvisor/tests/run_dylib_test.rs rename to libasvisor/tests/run_dylib_test.rs index 67f580d4..23e79b64 100644 --- a/libmsvisor/tests/run_dylib_test.rs +++ b/libasvisor/tests/run_dylib_test.rs @@ -1,6 +1,6 @@ use std::thread::{self, JoinHandle}; -use libmsvisor::{ +use libasvisor::{ isolation::{config::IsolationConfig, Isolation}, logger, }; diff --git a/libmsvisor/tests/should_panic.rs b/libasvisor/tests/should_panic.rs similarity index 96% rename from libmsvisor/tests/should_panic.rs rename to libasvisor/tests/should_panic.rs index 296bf55a..9d243d2e 100644 --- a/libmsvisor/tests/should_panic.rs +++ b/libasvisor/tests/should_panic.rs @@ -1,6 +1,6 @@ use std::{env::set_current_dir, path::PathBuf}; -use libmsvisor::{ +use libasvisor::{ isolation::{config::IsolationConfig, Isolation}, logger, run_single_isol, }; diff --git a/libmsvisor/tests/wasm_test.rs b/libasvisor/tests/wasm_test.rs similarity index 98% rename from libmsvisor/tests/wasm_test.rs rename to libasvisor/tests/wasm_test.rs index 957c7100..56a66ae5 100644 --- a/libmsvisor/tests/wasm_test.rs +++ b/libasvisor/tests/wasm_test.rs @@ -1,4 +1,4 @@ -use libmsvisor::{ +use libasvisor::{ isolation::{config::IsolationConfig, Isolation}, logger, }; diff --git a/ms_std/src/libos/utils.rs b/ms_std/src/libos/utils.rs deleted file mode 100644 index 3e9d0dff..00000000 --- a/ms_std/src/libos/utils.rs +++ /dev/null @@ -1,142 +0,0 @@ -use crate::libos::USER_HOST_CALL; - -pub macro func_type { - (metric) => (ms_hostcall::types::MetricFunc), - (fs_image) => (ms_hostcall::types::FsImageFunc), - (spawn_fault_handler) => (ms_hostcall::types::SpawnFaultThreadFunc), - (write) => (ms_hostcall::fdtab::WriteFunc), - (open) => (ms_hostcall::fdtab::OpenFunc), - (read) => (ms_hostcall::fdtab::ReadFunc), - (close) => (ms_hostcall::fdtab::CloseFunc), - (lseek) => (ms_hostcall::fdtab::LseekFunc), - (stat) => (ms_hostcall::fdtab::StatFunc), - (readdir) => (ms_hostcall::fdtab::ReadDirFunc), - (connect) => (ms_hostcall::fdtab::ConnectFunc), - (bind) => (ms_hostcall::fdtab::BindFunc), - (accept) => (ms_hostcall::fdtab::AcceptFunc), - (fatfs_open) => (ms_hostcall::fatfs::FatfsOpenFunc), - (fatfs_write) => (ms_hostcall::fatfs::FatfsWriteFunc), - (fatfs_read) => (ms_hostcall::fatfs::FatfsReadFunc), - (fatfs_close) => (ms_hostcall::fatfs::FatfsCloseFunc), - (fatfs_seek) => (ms_hostcall::fatfs::FatfsSeekFunc), - (fatfs_stat) => (ms_hostcall::fatfs::FatfsStatFunc), - (stdout) => (ms_hostcall::types::HostStdioFunc), - (addrinfo) => (ms_hostcall::socket::SmoltcpAddrInfoFunc), - (smol_connect) => (ms_hostcall::socket::SmoltcpConnectFunc), - (send) => (ms_hostcall::socket::SmoltcpSendFunc), - (recv) => (ms_hostcall::socket::SmoltcpRecvFunc), - (smol_bind) => (ms_hostcall::socket::SmoltcpBindFunc), - (smol_accept) => (ms_hostcall::socket::SmoltcpAcceptFunc), - (smol_close) => (ms_hostcall::socket::SmoltcpCloseFunc), - (buffer_alloc) => (ms_hostcall::mm::BufferAllocFunc), - (access_buffer) => (ms_hostcall::mm::AccessBufferFunc), - (buffer_dealloc) => (ms_hostcall::mm::BufferDeallocFunc), - (mmap) => (ms_hostcall::mm::MemmapFunc), - (munmap) => (ms_hostcall::mm::MemunmapFunc), - (mprotect) => (ms_hostcall::mm::MprotectFunc), - (register_file_backend) => (ms_hostcall::mmap_file_backend::RegisterFileBackendFunc), - (unregister_file_backend) => (ms_hostcall::mmap_file_backend::UnregisterFileBackendFunc), - (get_time) => (ms_hostcall::types::GetTimeFunc), - (nanosleep) => (ms_hostcall::types::NanoSleepFunc), - (sigaction) => (ms_hostcall::signal::SigActionFunc), -} - -pub macro hostcall_id { - (metric) => (ms_hostcall::CommonHostCall::Metric), - (fs_image) => (ms_hostcall::CommonHostCall::FsImage), - (spawn_fault_handler) => (ms_hostcall::CommonHostCall::SpawnFaultThread), - (write) => (ms_hostcall::CommonHostCall::Write), - (open) => (ms_hostcall::CommonHostCall::Open), - (read) => (ms_hostcall::CommonHostCall::Read), - (close) => (ms_hostcall::CommonHostCall::Close), - (lseek) => (ms_hostcall::CommonHostCall::Lseek), - (stat) => (ms_hostcall::CommonHostCall::Stat), - (readdir) => (ms_hostcall::CommonHostCall::ReadDir), - (connect) => (ms_hostcall::CommonHostCall::Connect), - (bind) => (ms_hostcall::CommonHostCall::Bind), - (accept) => (ms_hostcall::CommonHostCall::Accept), - (fatfs_open) => (ms_hostcall::CommonHostCall::FatfsOpen), - (fatfs_write) => (ms_hostcall::CommonHostCall::FatfsWrite), - (fatfs_read) => (ms_hostcall::CommonHostCall::FatfsRead), - (fatfs_close) => (ms_hostcall::CommonHostCall::FatfsClose), - (fatfs_seek) => (ms_hostcall::CommonHostCall::FatfsSeek), - (fatfs_stat) => (ms_hostcall::CommonHostCall::FatfsStat), - (stdout) => (ms_hostcall::CommonHostCall::Stdout), - (addrinfo) => (ms_hostcall::CommonHostCall::SmoltcpAddrInfo), - (smol_connect) => (ms_hostcall::CommonHostCall::SmoltcpConnect), - (send) => (ms_hostcall::CommonHostCall::SmoltcpSend), - (recv) => (ms_hostcall::CommonHostCall::SmoltcpRecv), - (smol_bind) => (ms_hostcall::CommonHostCall::SmoltcpBind), - (smol_accept) => (ms_hostcall::CommonHostCall::SmoltcpAccept), - (smol_close) => (ms_hostcall::CommonHostCall::SmoltcpClose), - (buffer_alloc) => (ms_hostcall::CommonHostCall::BufferAlloc), - (access_buffer) => (ms_hostcall::CommonHostCall::AccessBuffer), - (buffer_dealloc) => (ms_hostcall::CommonHostCall::BufferDealloc), - (mmap) => (ms_hostcall::CommonHostCall::Mmap), - (munmap) => (ms_hostcall::CommonHostCall::Munmap), - (mprotect) => (ms_hostcall::CommonHostCall::Mprotect), - (register_file_backend) => (ms_hostcall::CommonHostCall::RegisterFileBackend), - (unregister_file_backend) => (ms_hostcall::CommonHostCall::UnregisterFileBackend), - (get_time) => (ms_hostcall::CommonHostCall::GetTime), - (nanosleep) => (ms_hostcall::CommonHostCall::NanoSleep), - (sigaction) => (ms_hostcall::CommonHostCall::SigAction), -} - -pub macro libos { - ($name:ident($($arg_name:expr),*)) => { - { - fn binding() -> func_type!($name){ - let mut table = USER_HOST_CALL.lock(); - unsafe { core::mem::transmute(table.get_or_find(hostcall_id!($name))) } - } - let $name = binding(); - let res = $name($($arg_name),*); - res - } - } -} - -#[cfg(feature = "mpk")] -pub macro libos_with_switch_mpk { - ($name:ident($($arg_name:expr),*)) => { - { - use core::arch::asm; - use crate::mpk; - let pkru = mpk::pkey_read(); - let is_privilege_level = (pkru >> 30 == 0); - // grant access to libos. 00 00 11 ... ... 11 00 - let pkru = mpk::grant_libos_perm(pkru); - unsafe{ - asm!( - // "mov eax, 0x0FFFFFFC", - "xor rcx, rcx", - "mov rdx, rcx", - "wrpkru", - in("rax") pkru, - ); - } - - fn binding() -> func_type!($name){ - let mut table = USER_HOST_CALL.lock(); - unsafe { core::mem::transmute(table.get_or_find(hostcall_id!($name))) } - } - let $name = binding(); - let res = $name($($arg_name),*); - - if !is_privilege_level { - let pkru = mpk::drop_libos_perm(pkru); - // drop permission to libos. 11 00 11 ... ... 11 00 - unsafe{ - asm!( - // "mov eax, 0xCFFFFFFC", - "xor rcx, rcx", - "mov rdx, rcx", - in("rax") pkru, - ); - } - } - - res - } - } -} diff --git a/user/array_sum/Cargo.lock b/user/array_sum/Cargo.lock index e0a1cf20..c7a5f933 100644 --- a/user/array_sum/Cargo.lock +++ b/user/array_sum/Cargo.lock @@ -6,12 +6,45 @@ version = 3 name = "array_sum" version = "0.1.0" dependencies = [ - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", + "as_hostcall", + "as_std", + "as_std_proc_macro", "serde", ] +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -105,39 +138,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" diff --git a/user/array_sum/Cargo.toml b/user/array_sum/Cargo.toml index bb96f25d..ac57539e 100644 --- a/user/array_sum/Cargo.toml +++ b/user/array_sum/Cargo.toml @@ -9,14 +9,14 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "panic_def"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "panic_def"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } serde = { version = "1.0.217", default-features = false, features = ["derive"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] -file-based = ["ms_std/file-based"] +file-based = ["as_std/file-based"] default = [] diff --git a/user/array_sum/src/lib.rs b/user/array_sum/src/lib.rs index 8d2dde5e..c4225b0f 100644 --- a/user/array_sum/src/lib.rs +++ b/user/array_sum/src/lib.rs @@ -4,16 +4,16 @@ extern crate alloc; // use alloc::vec::Vec; use alloc::{format, string::String}; -// use ms_std::{ +// use as_std::{ // agent::{DataBuffer, FaaSFuncResult as Result}, // println, // time::{SystemTime, UNIX_EPOCH}, // }; -use ms_std::{ +use as_std::{ agent::{DataBuffer, FaaSFuncResult as Result}, args, println, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; use serde::{Deserialize, Serialize}; #[derive(Default, FaasData, Serialize, Deserialize)] diff --git a/user/checker/Cargo.lock b/user/checker/Cargo.lock index 3c676b6a..885344c4 100644 --- a/user/checker/Cargo.lock +++ b/user/checker/Cargo.lock @@ -2,6 +2,40 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", + "unwinding", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -30,10 +64,10 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" name = "checker" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "heapless", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "serde", ] @@ -118,40 +152,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", - "unwinding", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" diff --git a/user/checker/Cargo.toml b/user/checker/Cargo.toml index d3dbebb8..14da2908 100644 --- a/user/checker/Cargo.toml +++ b/user/checker/Cargo.toml @@ -9,13 +9,13 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "unwinding"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "unwinding"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } heapless = "0.8.0" serde = { version = "1.0.217", default-features = false, features = ["derive"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] default = [] diff --git a/user/checker/src/lib.rs b/user/checker/src/lib.rs index 68014e23..9e2f2324 100644 --- a/user/checker/src/lib.rs +++ b/user/checker/src/lib.rs @@ -3,12 +3,12 @@ use alloc::{format, vec::Vec}; -use ms_std::{ +use as_std::{ args, prelude::*, time::{SystemTime, UNIX_EPOCH}, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; #[cfg_attr(feature = "file-based", derive(Serialize, Deserialize))] #[derive(Default, FaasData)] diff --git a/user/file_reader/Cargo.lock b/user/file_reader/Cargo.lock index dcc163fe..f8ee0c14 100644 --- a/user/file_reader/Cargo.lock +++ b/user/file_reader/Cargo.lock @@ -2,6 +2,39 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -49,10 +82,10 @@ dependencies = [ name = "file_reader" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "heapless", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "serde", ] @@ -106,39 +139,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" diff --git a/user/file_reader/Cargo.toml b/user/file_reader/Cargo.toml index 75bfab26..ef30fcdf 100644 --- a/user/file_reader/Cargo.toml +++ b/user/file_reader/Cargo.toml @@ -9,15 +9,15 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "panic_def"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "panic_def"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } heapless = "0.8.0" serde = { version = "1.0.217", default-features = false, features = ["derive"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] -file-based = ["ms_std/file-based"] +file-based = ["as_std/file-based"] default = [] diff --git a/user/file_reader/src/lib.rs b/user/file_reader/src/lib.rs index 1d75dba4..fc05e424 100644 --- a/user/file_reader/src/lib.rs +++ b/user/file_reader/src/lib.rs @@ -1,7 +1,7 @@ #![no_std] use alloc::{borrow::ToOwned, string::String}; -use ms_std::{ +use as_std::{ args, fs::File, io::Read, @@ -9,10 +9,10 @@ use ms_std::{ println, time::{SystemTime, UNIX_EPOCH}, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; #[allow(unused_imports)] use serde::{Deserialize, Serialize}; -// use ms_std_proc_macro::FaasData; +// use as_std_proc_macro::FaasData; #[cfg_attr(feature = "file-based", derive(Serialize, Deserialize))] #[derive(Default, FaasData)] diff --git a/user/func_a/Cargo.lock b/user/func_a/Cargo.lock index 378d0b9a..5dc04495 100644 --- a/user/func_a/Cargo.lock +++ b/user/func_a/Cargo.lock @@ -2,6 +2,39 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -49,9 +82,9 @@ dependencies = [ name = "func_a" version = "0.1.0" dependencies = [ - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", + "as_hostcall", + "as_std", + "as_std_proc_macro", "serde", ] @@ -105,39 +138,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" diff --git a/user/func_a/Cargo.toml b/user/func_a/Cargo.toml index 6777705a..58637031 100644 --- a/user/func_a/Cargo.toml +++ b/user/func_a/Cargo.toml @@ -9,14 +9,14 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "panic_def"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "panic_def"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } serde = { version = "1.0.217", default-features = false, features = ["derive"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] default = [] diff --git a/user/func_a/src/lib.rs b/user/func_a/src/lib.rs index d9a2fec9..4a2990f9 100644 --- a/user/func_a/src/lib.rs +++ b/user/func_a/src/lib.rs @@ -5,12 +5,12 @@ extern crate alloc; use alloc::{borrow::ToOwned, vec::Vec}; #[allow(unused_imports)] -use ms_std::{ +use as_std::{ agent::{DataBuffer, FaaSFuncResult as Result}, println, time::{SystemTime, UNIX_EPOCH}, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; // const DATA_SIZE: usize = 1024 * 1024 * 256 / 8; const DATA_SIZE: usize = 1024 * 1024 * 16 / 8; diff --git a/user/func_b/Cargo.lock b/user/func_b/Cargo.lock index 0af4b19e..ce310f58 100644 --- a/user/func_b/Cargo.lock +++ b/user/func_b/Cargo.lock @@ -2,6 +2,39 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -49,9 +82,9 @@ dependencies = [ name = "func_b" version = "0.1.0" dependencies = [ - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", + "as_hostcall", + "as_std", + "as_std_proc_macro", "serde", ] @@ -105,39 +138,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" diff --git a/user/func_b/Cargo.toml b/user/func_b/Cargo.toml index 2db2e2ce..87ebdc73 100644 --- a/user/func_b/Cargo.toml +++ b/user/func_b/Cargo.toml @@ -9,12 +9,12 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "panic_def"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "panic_def"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } serde = { version = "1.0.217", default-features = false, features = ["derive"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] default = [] diff --git a/user/func_b/src/lib.rs b/user/func_b/src/lib.rs index f6646b9e..16873510 100644 --- a/user/func_b/src/lib.rs +++ b/user/func_b/src/lib.rs @@ -3,12 +3,12 @@ extern crate alloc; use alloc::{borrow::ToOwned, vec::Vec}; -use ms_std::{ +use as_std::{ agent::{DataBuffer, FaaSFuncResult as Result}, println, time::SystemTime, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; const DATA_SIZE: usize = 1024 * 1024 * 16 / 8; diff --git a/user/hello_world/Cargo.lock b/user/hello_world/Cargo.lock index 93f90495..c2db307f 100644 --- a/user/hello_world/Cargo.lock +++ b/user/hello_world/Cargo.lock @@ -2,6 +2,39 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -68,9 +101,9 @@ dependencies = [ name = "hello_world" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "cfg-if", - "ms_hostcall", - "ms_std", ] [[package]] @@ -104,39 +137,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" diff --git a/user/hello_world/Cargo.toml b/user/hello_world/Cargo.toml index 02d0faf9..401b91e3 100644 --- a/user/hello_world/Cargo.toml +++ b/user/hello_world/Cargo.toml @@ -9,17 +9,17 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = [ +as_std = { path = "../../as_std", features = [ "alloc_def", "panic_def", ], optional = true } -ms_hostcall = { path = "../../ms_hostcall", optional = true } +as_hostcall = { path = "../../as_hostcall", optional = true } cfg-if = "1.0.0" [features] -with_libos = ["ms_std", "ms_hostcall"] +with_libos = ["as_std", "as_hostcall"] measure_mem = ["with_libos"] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] default = ["with_libos"] diff --git a/user/hello_world/src/lib.rs b/user/hello_world/src/lib.rs index 4cd4f95b..8cbc809e 100644 --- a/user/hello_world/src/lib.rs +++ b/user/hello_world/src/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(feature = "with_libos", no_std)] -use ms_std::args; +use as_std::args; cfg_if::cfg_if! { if #[cfg(feature = "with_libos")] { - use ms_std::{agent::FaaSFuncResult as Result, println}; + use as_std::{agent::FaaSFuncResult as Result, println}; extern crate alloc; } else { type Result = core::result::Result; @@ -20,8 +20,8 @@ pub fn main() -> Result<()> { println!("Hello, world! id: {}", id); #[cfg(feature = "measure_mem")] { - use ms_std::libos::MetricEvent::Mem; - ms_std::libos::metric(Mem); + use as_std::libos::MetricEvent::Mem; + as_std::libos::metric(Mem); } Ok(().into()) diff --git a/user/httpd/Cargo.toml b/user/httpd/Cargo.toml index 1f0a8987..0956eeba 100644 --- a/user/httpd/Cargo.toml +++ b/user/httpd/Cargo.toml @@ -10,8 +10,8 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["unwinding", "alloc_def"] } +as_std = { path = "../../as_std", features = ["unwinding", "alloc_def"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] \ No newline at end of file diff --git a/user/httpd/src/lib.rs b/user/httpd/src/lib.rs index fa6cf0b0..b9c4c911 100644 --- a/user/httpd/src/lib.rs +++ b/user/httpd/src/lib.rs @@ -4,7 +4,7 @@ extern crate alloc; use alloc::format; -use ms_std::{ +use as_std::{ agent::FaaSFuncResult as Result, net::{TcpListener, TcpStream}, println, }; diff --git a/user/load_all/Cargo.lock b/user/load_all/Cargo.lock index 6c56ed9c..8df6fd96 100644 --- a/user/load_all/Cargo.lock +++ b/user/load_all/Cargo.lock @@ -2,6 +2,39 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -83,9 +116,9 @@ dependencies = [ name = "load_all" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "cfg-if", - "ms_hostcall", - "ms_std", ] [[package]] @@ -104,39 +137,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" diff --git a/user/load_all/Cargo.toml b/user/load_all/Cargo.toml index 45faf71e..75f7a227 100644 --- a/user/load_all/Cargo.toml +++ b/user/load_all/Cargo.toml @@ -9,15 +9,15 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = [ +as_std = { path = "../../as_std", features = [ "alloc_def", "panic_def", ], optional = true } -ms_hostcall = { path = "../../ms_hostcall", optional = true } +as_hostcall = { path = "../../as_hostcall", optional = true } cfg-if = "1.0.0" [features] -with_libos = ["ms_std", "ms_hostcall"] +with_libos = ["as_std", "as_hostcall"] measure_mem = ["with_libos"] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = ["measure_mem"] diff --git a/user/load_all/src/lib.rs b/user/load_all/src/lib.rs index bf7eb7cb..2f3b60a9 100644 --- a/user/load_all/src/lib.rs +++ b/user/load_all/src/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(feature = "with_libos", no_std)] -use ms_std::args; +use as_std::args; cfg_if::cfg_if! { if #[cfg(feature = "with_libos")] { - use ms_std::{agent::FaaSFuncResult as Result, println, libos::libos}; + use as_std::{agent::FaaSFuncResult as Result, println, libos::libos}; extern crate alloc; } else { type Result = core::result::Result; diff --git a/user/mapper/Cargo.lock b/user/mapper/Cargo.lock index 853d7493..17f32aa4 100644 --- a/user/mapper/Cargo.lock +++ b/user/mapper/Cargo.lock @@ -2,6 +2,40 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", + "unwinding", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -121,11 +155,11 @@ dependencies = [ name = "mapper" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown", "heapless", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "serde", ] @@ -135,40 +169,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", - "unwinding", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "proc-macro2" version = "1.0.93" diff --git a/user/mapper/Cargo.toml b/user/mapper/Cargo.toml index df8e5ba9..de6486d4 100644 --- a/user/mapper/Cargo.toml +++ b/user/mapper/Cargo.toml @@ -9,9 +9,9 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "unwinding"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "unwinding"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } hashbrown = { version = "0.15.0", default-features = false, features = [ "default-hasher", @@ -21,8 +21,8 @@ heapless = { version = "0.8.0", default-features = false } serde = { version = "1.0.217", default-features = false, features = ["derive"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] -file-based = ["ms_std/file-based"] +file-based = ["as_std/file-based"] default = [] diff --git a/user/mapper/src/lib.rs b/user/mapper/src/lib.rs index 17ca2607..27b31b76 100644 --- a/user/mapper/src/lib.rs +++ b/user/mapper/src/lib.rs @@ -14,8 +14,8 @@ use hashbrown::HashMap; #[cfg(feature = "pkey_per_func")] use heapless::FnvIndexMap; -pub use ms_hostcall::Verify; -use ms_std::{ +pub use as_hostcall::Verify; +use as_std::{ agent::{DataBuffer, FaaSFuncResult as Result}, args, fs::File, @@ -23,7 +23,7 @@ use ms_std::{ println, time::{SystemTime}, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; #[allow(unused_imports)] use serde::{Deserialize, Serialize}; diff --git a/user/merger/Cargo.lock b/user/merger/Cargo.lock index 2e946e5a..5e1abc8b 100644 --- a/user/merger/Cargo.lock +++ b/user/merger/Cargo.lock @@ -2,6 +2,40 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", + "unwinding", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -111,47 +145,13 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" name = "merger" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "heapless", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "serde", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", - "unwinding", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" diff --git a/user/merger/Cargo.toml b/user/merger/Cargo.toml index b4b65c74..fb751112 100644 --- a/user/merger/Cargo.toml +++ b/user/merger/Cargo.toml @@ -9,15 +9,15 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "unwinding"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "unwinding"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } heapless = "0.8.0" serde = { version = "1.0.217", default-features = false, features = ["derive"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] -file-based = ["ms_std/file-based"] +file-based = ["as_std/file-based"] default = [] diff --git a/user/merger/src/lib.rs b/user/merger/src/lib.rs index 0277dbdb..c81ca151 100644 --- a/user/merger/src/lib.rs +++ b/user/merger/src/lib.rs @@ -1,12 +1,12 @@ #![no_std] use alloc::{format, vec::Vec}; -use ms_std::{ +use as_std::{ args, prelude::*, time::{SystemTime, UNIX_EPOCH}, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; #[allow(unused_imports)] use serde::{Deserialize, Serialize}; diff --git a/user/mmap_file/Cargo.toml b/user/mmap_file/Cargo.toml index 7b60fffa..a4b84596 100644 --- a/user/mmap_file/Cargo.toml +++ b/user/mmap_file/Cargo.toml @@ -9,9 +9,9 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "unwinding"] } -ms_hostcall = {path = "../../ms_hostcall"} +as_std = { path = "../../as_std", features = ["alloc_def", "unwinding"] } +as_hostcall = {path = "../../as_hostcall"} [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] \ No newline at end of file diff --git a/user/mmap_file/src/lib.rs b/user/mmap_file/src/lib.rs index 088ddc62..57daba94 100644 --- a/user/mmap_file/src/lib.rs +++ b/user/mmap_file/src/lib.rs @@ -1,6 +1,6 @@ #![no_std] use alloc::string::String; -use ms_std::{agent::FaaSFuncResult as Result, fs::File, mm::Mmap, println}; +use as_std::{agent::FaaSFuncResult as Result, fs::File, mm::Mmap, println}; extern crate alloc; diff --git a/user/never_stop/Cargo.toml b/user/never_stop/Cargo.toml index 56cd79e8..e3ff8992 100644 --- a/user/never_stop/Cargo.toml +++ b/user/never_stop/Cargo.toml @@ -9,15 +9,15 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = [ +as_std = { path = "../../as_std", features = [ "alloc_def", "panic_def", ], optional = true } -ms_hostcall = { path = "../../ms_hostcall", optional = true } +as_hostcall = { path = "../../as_hostcall", optional = true } cfg-if = "1.0.0" [features] -with_libos = ["ms_std", "ms_hostcall"] +with_libos = ["as_std", "as_hostcall"] measure_mem = ["with_libos"] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = ["measure_mem"] diff --git a/user/never_stop/src/lib.rs b/user/never_stop/src/lib.rs index 3158926f..d80cf3cc 100644 --- a/user/never_stop/src/lib.rs +++ b/user/never_stop/src/lib.rs @@ -2,11 +2,11 @@ use core::time::Duration; -use ms_std::time::sleep; +use as_std::time::sleep; cfg_if::cfg_if! { if #[cfg(feature = "with_libos")] { - use ms_std::{agent::FaaSFuncResult as Result}; + use as_std::{agent::FaaSFuncResult as Result}; extern crate alloc; } else { type Result = core::result::Result; diff --git a/user/nn_conv/_Cargo.toml b/user/nn_conv/_Cargo.toml index c8e8e1a8..47bef05d 100644 --- a/user/nn_conv/_Cargo.toml +++ b/user/nn_conv/_Cargo.toml @@ -9,9 +9,9 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "unwinding"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "unwinding"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } burn = { path = "/home/yjn/rust_project/burn/burn", default-features = false, features = [ "ndarray-no-std", @@ -20,5 +20,5 @@ serde = { version = "1.0.193", default-features = false, features = ["derive"] } thiserror-no-std = "2.0.2" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] \ No newline at end of file diff --git a/user/nn_conv/src/lib.rs b/user/nn_conv/src/lib.rs index ec4e99a5..4227bc88 100644 --- a/user/nn_conv/src/lib.rs +++ b/user/nn_conv/src/lib.rs @@ -10,12 +10,12 @@ use burn::{ record::{BinBytesRecorder, FullPrecisionSettings, Recorder, RecorderError}, tensor::{backend::Backend, Int, Tensor}, }; -use ms_hostcall::fdtab::FdtabError; -use ms_std::{ +use as_hostcall::fdtab::FdtabError; +use as_std::{ agent::{FaaSFuncError, FaaSFuncResult as Result}, println, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; use thiserror_no_std::Error; const NUM_CLASSES: usize = 10; diff --git a/user/reducer/Cargo.lock b/user/reducer/Cargo.lock index 87f7f4f8..af10bd7f 100644 --- a/user/reducer/Cargo.lock +++ b/user/reducer/Cargo.lock @@ -2,6 +2,40 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", + "unwinding", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -123,40 +157,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", - "unwinding", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "proc-macro2" version = "1.0.93" @@ -179,11 +179,11 @@ dependencies = [ name = "reducer" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown", "heapless", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "serde", ] diff --git a/user/reducer/Cargo.toml b/user/reducer/Cargo.toml index 52005665..ddeff3e7 100644 --- a/user/reducer/Cargo.toml +++ b/user/reducer/Cargo.toml @@ -9,9 +9,9 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "unwinding"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "unwinding"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } heapless = { version = "0.8.0", default-features = false } hashbrown = { version = "0.15", default-features = false, features = [ @@ -21,8 +21,8 @@ hashbrown = { version = "0.15", default-features = false, features = [ serde = { version = "1.0.217", default-features = false, features = ["derive"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] -file-based = ["ms_std/file-based"] +file-based = ["as_std/file-based"] default = [] diff --git a/user/reducer/src/lib.rs b/user/reducer/src/lib.rs index 6da233c1..dbfcacd8 100644 --- a/user/reducer/src/lib.rs +++ b/user/reducer/src/lib.rs @@ -9,13 +9,13 @@ use alloc::{ string::{String, ToString}, }; use hashbrown::HashMap; -pub use ms_hostcall::Verify; -use ms_std::{ +pub use as_hostcall::Verify; +use as_std::{ agent::{DataBuffer, FaaSFuncResult as Result}, args, println, time::{SystemTime, UNIX_EPOCH}, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; #[allow(unused_imports)] use serde::{Deserialize, Serialize}; diff --git a/user/should_panic/Cargo.toml b/user/should_panic/Cargo.toml index 4684baa0..c8a5b84d 100644 --- a/user/should_panic/Cargo.toml +++ b/user/should_panic/Cargo.toml @@ -10,8 +10,8 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "unwinding"] } +as_std = { path = "../../as_std", features = ["alloc_def", "unwinding"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] \ No newline at end of file diff --git a/user/should_panic/src/lib.rs b/user/should_panic/src/lib.rs index 73b11bba..163f68dc 100644 --- a/user/should_panic/src/lib.rs +++ b/user/should_panic/src/lib.rs @@ -1,7 +1,7 @@ #![no_std] -pub use ms_std; +pub use as_std; #[no_mangle] -pub fn main() -> ms_std::agent::FaaSFuncResult<()> { +pub fn main() -> as_std::agent::FaaSFuncResult<()> { panic!("should return err") } diff --git a/user/simple_file/Cargo.lock b/user/simple_file/Cargo.lock index 39a3004d..cb4b324a 100644 --- a/user/simple_file/Cargo.lock +++ b/user/simple_file/Cargo.lock @@ -2,6 +2,40 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", + "unwinding", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -107,40 +141,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", - "unwinding", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "proc-macro2" version = "1.0.93" @@ -222,9 +222,9 @@ dependencies = [ name = "simple_file" version = "0.1.0" dependencies = [ - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", + "as_hostcall", + "as_std", + "as_std_proc_macro", ] [[package]] diff --git a/user/simple_file/Cargo.toml b/user/simple_file/Cargo.toml index ac3d22f8..92ab5179 100644 --- a/user/simple_file/Cargo.toml +++ b/user/simple_file/Cargo.toml @@ -9,12 +9,12 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "unwinding"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "unwinding"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] default = [] diff --git a/user/simple_file/src/lib.rs b/user/simple_file/src/lib.rs index efd66425..2248815d 100644 --- a/user/simple_file/src/lib.rs +++ b/user/simple_file/src/lib.rs @@ -8,7 +8,7 @@ use alloc::{ }; #[allow(unused_imports)] -use ms_std::{ +use as_std::{ agent::FaaSFuncResult as Result, fs::File, io::{Read, Write}, diff --git a/user/simple_http/Cargo.lock b/user/simple_http/Cargo.lock index 20707ddf..4f94e930 100644 --- a/user/simple_http/Cargo.lock +++ b/user/simple_http/Cargo.lock @@ -2,6 +2,40 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", + "unwinding", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -107,40 +141,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", - "unwinding", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" @@ -222,7 +222,7 @@ dependencies = [ name = "simple_http" version = "0.1.0" dependencies = [ - "ms_std", + "as_std", ] [[package]] diff --git a/user/simple_http/Cargo.toml b/user/simple_http/Cargo.toml index 38752715..1c24c698 100644 --- a/user/simple_http/Cargo.toml +++ b/user/simple_http/Cargo.toml @@ -10,10 +10,10 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["unwinding", "alloc_def"] } +as_std = { path = "../../as_std", features = ["unwinding", "alloc_def"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] default = [] \ No newline at end of file diff --git a/user/simple_http/src/lib.rs b/user/simple_http/src/lib.rs index 03fff5c2..5c310536 100644 --- a/user/simple_http/src/lib.rs +++ b/user/simple_http/src/lib.rs @@ -1,7 +1,7 @@ #![no_std] #![allow(clippy::result_unit_err)] -use ms_std::{ +use as_std::{ io::{Read, Write}, net::TcpStream, prelude::*, diff --git a/user/sorter/Cargo.lock b/user/sorter/Cargo.lock index dbd0c349..f9375de7 100644 --- a/user/sorter/Cargo.lock +++ b/user/sorter/Cargo.lock @@ -2,6 +2,40 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", + "unwinding", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -107,40 +141,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", - "unwinding", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" @@ -222,10 +222,10 @@ dependencies = [ name = "sorter" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "heapless", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "serde", ] diff --git a/user/sorter/Cargo.toml b/user/sorter/Cargo.toml index cb7ab8a3..f31a7223 100644 --- a/user/sorter/Cargo.toml +++ b/user/sorter/Cargo.toml @@ -9,15 +9,15 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "unwinding"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "unwinding"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } heapless = "0.8.0" serde = { version = "1.0.217", default-features = false, features = ["derive"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] -file-based = ["ms_std/file-based"] +file-based = ["as_std/file-based"] default = [] diff --git a/user/sorter/src/lib.rs b/user/sorter/src/lib.rs index e918b388..bd9dd223 100644 --- a/user/sorter/src/lib.rs +++ b/user/sorter/src/lib.rs @@ -4,14 +4,14 @@ use alloc::{format, string::String, vec::Vec}; #[allow(unused_imports)] -use ms_std::{ +use as_std::{ args, fs::File, io::Read, prelude::*, time::{SystemTime, UNIX_EPOCH}, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; #[allow(unused_imports)] use serde::{Deserialize, Serialize}; diff --git a/user/splitter/Cargo.lock b/user/splitter/Cargo.lock index 1a6a5e07..1401cbbe 100644 --- a/user/splitter/Cargo.lock +++ b/user/splitter/Cargo.lock @@ -2,6 +2,40 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", + "unwinding", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -107,40 +141,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "serde", - "serde_json", - "spin", - "thiserror-no-std", - "unwinding", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proc-macro2" version = "1.0.93" @@ -240,10 +240,10 @@ dependencies = [ name = "splitter" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "heapless", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "serde", ] diff --git a/user/splitter/Cargo.toml b/user/splitter/Cargo.toml index 95ca6972..67f8527f 100644 --- a/user/splitter/Cargo.toml +++ b/user/splitter/Cargo.toml @@ -9,15 +9,15 @@ build = "../../build_user.rs" crate-type = ["dylib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["alloc_def", "unwinding"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["alloc_def", "unwinding"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } heapless = "0.8.0" serde = { version = "1.0.217", default-features = false, features = ["derive"] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] pkey_per_func = ["mpk"] -file-based = ["ms_std/file-based"] +file-based = ["as_std/file-based"] default = [] diff --git a/user/splitter/src/lib.rs b/user/splitter/src/lib.rs index c2b52e2d..ddd226ba 100644 --- a/user/splitter/src/lib.rs +++ b/user/splitter/src/lib.rs @@ -1,13 +1,13 @@ #![no_std] use alloc::{format, vec::Vec}; -use ms_std::{ +use as_std::{ args, prelude::*, println, time::{SystemTime, UNIX_EPOCH}, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; #[allow(unused_imports)] use serde::{Deserialize, Serialize}; diff --git a/user/wasmtime_checker/Cargo.lock b/user/wasmtime_checker/Cargo.lock index a2c98f72..71a650b7 100644 --- a/user/wasmtime_checker/Cargo.lock +++ b/user/wasmtime_checker/Cargo.lock @@ -26,6 +26,39 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -457,37 +490,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - [[package]] name = "naked-function" version = "0.1.5" @@ -506,7 +508,7 @@ checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -547,9 +549,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -565,9 +567,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -639,31 +641,32 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] name = "serde_json" -version = "1.0.109" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0652c533506ad7a2e353cce269330d6afd8bdfb6d75e0ace5b35aacbd7b9e9" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -743,9 +746,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -775,7 +778,7 @@ checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -910,7 +913,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -1008,7 +1011,7 @@ checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -1044,9 +1047,9 @@ dependencies = [ name = "wasmtime_checker" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "lazy_static", - "ms_hostcall", - "ms_std", "spin", "wasmtime_wasi_api", ] @@ -1055,11 +1058,11 @@ dependencies = [ name = "wasmtime_wasi_api" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown 0.14.5", "lazy_static", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "sjlj", "spin", "wasmtime", @@ -1190,5 +1193,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] diff --git a/user/wasmtime_checker/Cargo.toml b/user/wasmtime_checker/Cargo.toml index 158722d8..9b20a335 100644 --- a/user/wasmtime_checker/Cargo.toml +++ b/user/wasmtime_checker/Cargo.toml @@ -9,12 +9,12 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } spin = "0.9.8" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_checker/src/lib.rs b/user/wasmtime_checker/src/lib.rs index 6bb05484..9c1e3d72 100644 --- a/user/wasmtime_checker/src/lib.rs +++ b/user/wasmtime_checker/src/lib.rs @@ -6,8 +6,8 @@ use core::mem::forget; use alloc::{string::{String, ToString}, vec::Vec}; use spin::Mutex; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, println, libos::libos, time::{SystemTime, UNIX_EPOCH}}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, println, libos::libos, time::{SystemTime, UNIX_EPOCH}}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/user/wasmtime_cpython/Cargo.toml b/user/wasmtime_cpython/Cargo.toml index 77820e92..74b96acb 100755 --- a/user/wasmtime_cpython/Cargo.toml +++ b/user/wasmtime_cpython/Cargo.toml @@ -11,8 +11,8 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } @@ -20,4 +20,4 @@ spin = "0.9.8" sjlj = "0.1.3" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_cpython/src/lib.rs b/user/wasmtime_cpython/src/lib.rs index 859fd58c..97123d69 100755 --- a/user/wasmtime_cpython/src/lib.rs +++ b/user/wasmtime_cpython/src/lib.rs @@ -7,8 +7,8 @@ use alloc::{string::{String, ToString}, vec::Vec}; use spin::Mutex; use core::mem::forget; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, libos::libos, println, time::{SystemTime, UNIX_EPOCH},}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, libos::libos, println, time::{SystemTime, UNIX_EPOCH},}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/user/wasmtime_cpython_func/Cargo.toml b/user/wasmtime_cpython_func/Cargo.toml index 23b704c9..ed66e86f 100644 --- a/user/wasmtime_cpython_func/Cargo.toml +++ b/user/wasmtime_cpython_func/Cargo.toml @@ -11,8 +11,8 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } @@ -20,4 +20,4 @@ spin = "0.9.8" sjlj = "0.1.3" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_cpython_func/src/lib.rs b/user/wasmtime_cpython_func/src/lib.rs index 25b8989b..768ff75d 100755 --- a/user/wasmtime_cpython_func/src/lib.rs +++ b/user/wasmtime_cpython_func/src/lib.rs @@ -7,8 +7,8 @@ use alloc::{format, string::{String, ToString}, vec::Vec}; use spin::Mutex; use core::mem::forget; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, libos::libos, println, time::{SystemTime, UNIX_EPOCH},}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, libos::libos, println, time::{SystemTime, UNIX_EPOCH},}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/user/wasmtime_cpython_mapper/Cargo.toml b/user/wasmtime_cpython_mapper/Cargo.toml index 1ae3af2e..fc7db2ac 100644 --- a/user/wasmtime_cpython_mapper/Cargo.toml +++ b/user/wasmtime_cpython_mapper/Cargo.toml @@ -11,8 +11,8 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } @@ -20,4 +20,4 @@ spin = "0.9.8" sjlj = "0.1.3" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_cpython_mapper/src/lib.rs b/user/wasmtime_cpython_mapper/src/lib.rs index dacba5c3..21cc554b 100755 --- a/user/wasmtime_cpython_mapper/src/lib.rs +++ b/user/wasmtime_cpython_mapper/src/lib.rs @@ -7,8 +7,8 @@ use alloc::{format, string::{String, ToString}, vec::Vec}; use spin::Mutex; use core::mem::forget; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, libos::libos, println, time::{SystemTime, UNIX_EPOCH},}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, libos::libos, println, time::{SystemTime, UNIX_EPOCH},}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/user/wasmtime_cpython_parallel_sort/Cargo.lock b/user/wasmtime_cpython_parallel_sort/Cargo.lock index df901b80..0fd0d8de 100644 --- a/user/wasmtime_cpython_parallel_sort/Cargo.lock +++ b/user/wasmtime_cpython_parallel_sort/Cargo.lock @@ -26,6 +26,39 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.4.0" @@ -206,7 +239,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -457,37 +490,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", -] - [[package]] name = "naked-function" version = "0.1.5" @@ -506,7 +508,7 @@ checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -639,29 +641,29 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", @@ -744,9 +746,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -776,7 +778,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -911,7 +913,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -1009,7 +1011,7 @@ checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1045,9 +1047,9 @@ dependencies = [ name = "wasmtime_cpython_parallel_sort" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "lazy_static", - "ms_hostcall", - "ms_std", "sjlj", "spin", "wasmtime_wasi_api", @@ -1057,11 +1059,11 @@ dependencies = [ name = "wasmtime_wasi_api" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown 0.14.5", "lazy_static", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "sjlj", "spin", "wasmtime", @@ -1192,5 +1194,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] diff --git a/user/wasmtime_cpython_parallel_sort/Cargo.toml b/user/wasmtime_cpython_parallel_sort/Cargo.toml index d4fd38f9..54e09f96 100644 --- a/user/wasmtime_cpython_parallel_sort/Cargo.toml +++ b/user/wasmtime_cpython_parallel_sort/Cargo.toml @@ -11,8 +11,8 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } @@ -20,4 +20,4 @@ spin = "0.9.8" sjlj = "0.1.3" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_cpython_parallel_sort/src/lib.rs b/user/wasmtime_cpython_parallel_sort/src/lib.rs index 08515be3..5c8bf57b 100755 --- a/user/wasmtime_cpython_parallel_sort/src/lib.rs +++ b/user/wasmtime_cpython_parallel_sort/src/lib.rs @@ -7,8 +7,8 @@ use alloc::{format, string::{String, ToString}, vec::Vec}; use spin::Mutex; use core::mem::forget; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, libos::libos, println, time::{SystemTime, UNIX_EPOCH},}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, libos::libos, println, time::{SystemTime, UNIX_EPOCH},}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/user/wasmtime_cpython_reducer/Cargo.toml b/user/wasmtime_cpython_reducer/Cargo.toml index 9872a749..1475b771 100755 --- a/user/wasmtime_cpython_reducer/Cargo.toml +++ b/user/wasmtime_cpython_reducer/Cargo.toml @@ -11,8 +11,8 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } @@ -20,4 +20,4 @@ spin = "0.9.8" sjlj = "0.1.3" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_cpython_reducer/src/lib.rs b/user/wasmtime_cpython_reducer/src/lib.rs index 91b6e6b4..e0ed7072 100755 --- a/user/wasmtime_cpython_reducer/src/lib.rs +++ b/user/wasmtime_cpython_reducer/src/lib.rs @@ -7,8 +7,8 @@ use alloc::{format, string::{String, ToString}, vec::Vec}; use spin::Mutex; use core::mem::forget; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, libos::libos, println, time::{SystemTime, UNIX_EPOCH},}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, libos::libos, println, time::{SystemTime, UNIX_EPOCH},}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/user/wasmtime_cpython_wordcount/Cargo.lock b/user/wasmtime_cpython_wordcount/Cargo.lock index ff660e51..d386453a 100644 --- a/user/wasmtime_cpython_wordcount/Cargo.lock +++ b/user/wasmtime_cpython_wordcount/Cargo.lock @@ -26,6 +26,39 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.4.0" @@ -206,7 +239,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -457,37 +490,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", -] - [[package]] name = "naked-function" version = "0.1.5" @@ -506,7 +508,7 @@ checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -639,29 +641,29 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", @@ -744,9 +746,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -776,7 +778,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -911,7 +913,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -1009,7 +1011,7 @@ checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1045,9 +1047,9 @@ dependencies = [ name = "wasmtime_cpython_wordcount" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "lazy_static", - "ms_hostcall", - "ms_std", "sjlj", "spin", "wasmtime_wasi_api", @@ -1057,11 +1059,11 @@ dependencies = [ name = "wasmtime_wasi_api" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown 0.14.5", "lazy_static", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "sjlj", "spin", "wasmtime", @@ -1192,5 +1194,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] diff --git a/user/wasmtime_cpython_wordcount/Cargo.toml b/user/wasmtime_cpython_wordcount/Cargo.toml index 36736488..108a341e 100644 --- a/user/wasmtime_cpython_wordcount/Cargo.toml +++ b/user/wasmtime_cpython_wordcount/Cargo.toml @@ -11,8 +11,8 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } @@ -20,4 +20,4 @@ spin = "0.9.8" sjlj = "0.1.3" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_cpython_wordcount/src/lib.rs b/user/wasmtime_cpython_wordcount/src/lib.rs index fece0101..3bf2e446 100755 --- a/user/wasmtime_cpython_wordcount/src/lib.rs +++ b/user/wasmtime_cpython_wordcount/src/lib.rs @@ -11,8 +11,8 @@ use alloc::{ use core::mem::forget; use spin::Mutex; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, libos::libos}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, libos::libos}; use wasmtime::Store; use wasmtime_wasi_api::{wasmtime, LibosCtx}; diff --git a/user/wasmtime_hello/Cargo.toml b/user/wasmtime_hello/Cargo.toml index 0cf9fce0..950d57b2 100644 --- a/user/wasmtime_hello/Cargo.toml +++ b/user/wasmtime_hello/Cargo.toml @@ -9,8 +9,8 @@ build = "../../build_user.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall", features = ["signal"] } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall", features = ["signal"] } sjlj = { version="0.1.3" } wasmtime = { version = "=21.0.0", default-features = false, features = [ "runtime", @@ -19,6 +19,6 @@ wasmtime = { version = "=21.0.0", default-features = false, features = [ ] } [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] diff --git a/user/wasmtime_hello/src/capis.rs b/user/wasmtime_hello/src/capis.rs index 19d39f3b..9ea75676 100644 --- a/user/wasmtime_hello/src/capis.rs +++ b/user/wasmtime_hello/src/capis.rs @@ -3,9 +3,9 @@ extern crate sjlj; use core::ptr::{null, null_mut}; -use ms_hostcall::{mm::{MMResult, ProtFlags}, signal::{SigAction, SigInfo, Sigset, Ucontext}}; -use ms_std::libos::libos; -use ms_std::println; +use as_hostcall::{mm::{MMResult, ProtFlags}, signal::{SigAction, SigInfo, Sigset, Ucontext}}; +use as_std::libos::libos; +use as_std::println; use sjlj::{JumpBuf, longjmp, setjmp}; // Flags to either `wasmtime_mmap_{new,remap}` or `wasmtime_mprotect`. diff --git a/user/wasmtime_hello/src/lib.rs b/user/wasmtime_hello/src/lib.rs index 184e90b6..4e5d6107 100644 --- a/user/wasmtime_hello/src/lib.rs +++ b/user/wasmtime_hello/src/lib.rs @@ -1,7 +1,7 @@ #![no_std] use alloc::{string::ToString, vec::Vec}; -use ms_std::{agent::FaaSFuncResult as Result, args, println}; +use as_std::{agent::FaaSFuncResult as Result, args, println}; use wasmtime::{component::Func, Engine, Extern, Instance, Linker, Module, Store}; use wasmtime::{AsContext, Caller}; mod capis; diff --git a/user/wasmtime_longchain/Cargo.toml b/user/wasmtime_longchain/Cargo.toml index f02927ca..336dcfbf 100644 --- a/user/wasmtime_longchain/Cargo.toml +++ b/user/wasmtime_longchain/Cargo.toml @@ -9,13 +9,13 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } -ms_std_proc_macro = { path = "../../ms_std_proc_macro" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } +as_std_proc_macro = { path = "../../as_std_proc_macro" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } spin = "0.9.8" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_longchain/src/lib.rs b/user/wasmtime_longchain/src/lib.rs index 414b895b..786f34d8 100644 --- a/user/wasmtime_longchain/src/lib.rs +++ b/user/wasmtime_longchain/src/lib.rs @@ -6,9 +6,9 @@ use core::mem::forget; use alloc::{string::{String, ToString}, vec::Vec, borrow::ToOwned}; use spin::Mutex; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::{DataBuffer, FaaSFuncResult as Result}, args, println, libos::libos, time::{SystemTime, UNIX_EPOCH}}; -use ms_std_proc_macro::FaasData; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::{DataBuffer, FaaSFuncResult as Result}, args, println, libos::libos, time::{SystemTime, UNIX_EPOCH}}; +use as_std_proc_macro::FaasData; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/user/wasmtime_mapper/Cargo.lock b/user/wasmtime_mapper/Cargo.lock index cab80106..432e311e 100644 --- a/user/wasmtime_mapper/Cargo.lock +++ b/user/wasmtime_mapper/Cargo.lock @@ -26,6 +26,39 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.4.0" @@ -206,7 +239,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -457,37 +490,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", -] - [[package]] name = "naked-function" version = "0.1.5" @@ -506,7 +508,7 @@ checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -639,29 +641,29 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", @@ -744,9 +746,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -776,7 +778,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -911,7 +913,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -1009,7 +1011,7 @@ checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1045,9 +1047,9 @@ dependencies = [ name = "wasmtime_mapper" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "lazy_static", - "ms_hostcall", - "ms_std", "spin", "wasmtime_wasi_api", ] @@ -1056,11 +1058,11 @@ dependencies = [ name = "wasmtime_wasi_api" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown 0.14.5", "lazy_static", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "sjlj", "spin", "wasmtime", @@ -1191,5 +1193,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] diff --git a/user/wasmtime_mapper/Cargo.toml b/user/wasmtime_mapper/Cargo.toml index d5e5a8e2..e71d9d8c 100644 --- a/user/wasmtime_mapper/Cargo.toml +++ b/user/wasmtime_mapper/Cargo.toml @@ -10,8 +10,8 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall", features = ["signal"] } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall", features = ["signal"] } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } @@ -19,4 +19,4 @@ lazy_static = { version = "1.5.0", features = ["spin_no_std"] } spin = "0.9.8" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_mapper/src/lib.rs b/user/wasmtime_mapper/src/lib.rs index 66b1ee96..82d4fef5 100644 --- a/user/wasmtime_mapper/src/lib.rs +++ b/user/wasmtime_mapper/src/lib.rs @@ -6,8 +6,8 @@ use core::mem::forget; use alloc::{string::{String, ToString}, vec::Vec}; use spin::Mutex; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, libos::libos}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, libos::libos}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; diff --git a/user/wasmtime_merger/Cargo.lock b/user/wasmtime_merger/Cargo.lock index 8fccfc94..fbeff1f3 100644 --- a/user/wasmtime_merger/Cargo.lock +++ b/user/wasmtime_merger/Cargo.lock @@ -26,6 +26,39 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -457,37 +490,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - [[package]] name = "naked-function" version = "0.1.5" @@ -506,7 +508,7 @@ checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -547,9 +549,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -565,9 +567,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -639,31 +641,32 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] name = "serde_json" -version = "1.0.109" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0652c533506ad7a2e353cce269330d6afd8bdfb6d75e0ace5b35aacbd7b9e9" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -743,9 +746,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -775,7 +778,7 @@ checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -910,7 +913,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -1008,7 +1011,7 @@ checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -1044,9 +1047,9 @@ dependencies = [ name = "wasmtime_merger" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "lazy_static", - "ms_hostcall", - "ms_std", "spin", "wasmtime_wasi_api", ] @@ -1055,11 +1058,11 @@ dependencies = [ name = "wasmtime_wasi_api" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown 0.14.5", "lazy_static", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "sjlj", "spin", "wasmtime", @@ -1190,5 +1193,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] diff --git a/user/wasmtime_merger/Cargo.toml b/user/wasmtime_merger/Cargo.toml index 861399cd..43d57bf4 100644 --- a/user/wasmtime_merger/Cargo.toml +++ b/user/wasmtime_merger/Cargo.toml @@ -9,12 +9,12 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } spin = "0.9.8" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_merger/src/lib.rs b/user/wasmtime_merger/src/lib.rs index 5ce0fb2d..afe7c93a 100644 --- a/user/wasmtime_merger/src/lib.rs +++ b/user/wasmtime_merger/src/lib.rs @@ -6,8 +6,8 @@ use core::mem::forget; use alloc::{string::{String, ToString}, vec::Vec}; use spin::Mutex; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, println, libos::libos}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, println, libos::libos}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/user/wasmtime_reducer/Cargo.lock b/user/wasmtime_reducer/Cargo.lock index 801ddb4d..7eebb7db 100644 --- a/user/wasmtime_reducer/Cargo.lock +++ b/user/wasmtime_reducer/Cargo.lock @@ -26,6 +26,39 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.4.0" @@ -206,7 +239,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -457,37 +490,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", -] - [[package]] name = "naked-function" version = "0.1.5" @@ -506,7 +508,7 @@ checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -639,29 +641,29 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", @@ -744,9 +746,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -776,7 +778,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -911,7 +913,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -1009,7 +1011,7 @@ checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1045,9 +1047,9 @@ dependencies = [ name = "wasmtime_reducer" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "lazy_static", - "ms_hostcall", - "ms_std", "spin", "wasmtime_wasi_api", ] @@ -1056,11 +1058,11 @@ dependencies = [ name = "wasmtime_wasi_api" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown 0.14.5", "lazy_static", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "sjlj", "spin", "wasmtime", @@ -1191,5 +1193,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] diff --git a/user/wasmtime_reducer/Cargo.toml b/user/wasmtime_reducer/Cargo.toml index c73a8542..7e3160e8 100644 --- a/user/wasmtime_reducer/Cargo.toml +++ b/user/wasmtime_reducer/Cargo.toml @@ -10,12 +10,12 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall", features = ["signal"] } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall", features = ["signal"] } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } spin = "0.9.8" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_reducer/src/lib.rs b/user/wasmtime_reducer/src/lib.rs index dc4418de..967ecf0a 100644 --- a/user/wasmtime_reducer/src/lib.rs +++ b/user/wasmtime_reducer/src/lib.rs @@ -4,8 +4,8 @@ extern crate alloc; use alloc::{string::{String, ToString}, vec::Vec}; use spin::Mutex; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, libos::libos}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, libos::libos}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/user/wasmtime_sorter/Cargo.lock b/user/wasmtime_sorter/Cargo.lock index 2c12e2b3..264cbf8c 100644 --- a/user/wasmtime_sorter/Cargo.lock +++ b/user/wasmtime_sorter/Cargo.lock @@ -26,6 +26,39 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -457,37 +490,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - [[package]] name = "naked-function" version = "0.1.5" @@ -506,7 +508,7 @@ checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -547,9 +549,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -565,9 +567,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -639,31 +641,32 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] name = "serde_json" -version = "1.0.109" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0652c533506ad7a2e353cce269330d6afd8bdfb6d75e0ace5b35aacbd7b9e9" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -743,9 +746,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -775,7 +778,7 @@ checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -910,7 +913,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -1008,7 +1011,7 @@ checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -1044,9 +1047,9 @@ dependencies = [ name = "wasmtime_sorter" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "lazy_static", - "ms_hostcall", - "ms_std", "spin", "wasmtime_wasi_api", ] @@ -1055,11 +1058,11 @@ dependencies = [ name = "wasmtime_wasi_api" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown 0.14.5", "lazy_static", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "sjlj", "spin", "wasmtime", @@ -1190,5 +1193,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] diff --git a/user/wasmtime_sorter/Cargo.toml b/user/wasmtime_sorter/Cargo.toml index e838e1c6..84549096 100644 --- a/user/wasmtime_sorter/Cargo.toml +++ b/user/wasmtime_sorter/Cargo.toml @@ -9,12 +9,12 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } spin = "0.9.8" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_sorter/src/lib.rs b/user/wasmtime_sorter/src/lib.rs index 55a6a2b5..0628eddc 100644 --- a/user/wasmtime_sorter/src/lib.rs +++ b/user/wasmtime_sorter/src/lib.rs @@ -6,8 +6,8 @@ use core::mem::forget; use alloc::{string::{String, ToString}, vec::Vec}; use spin::Mutex; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, println, libos::libos, time::{SystemTime, UNIX_EPOCH}}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, println, libos::libos, time::{SystemTime, UNIX_EPOCH}}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/user/wasmtime_spliter/Cargo.lock b/user/wasmtime_spliter/Cargo.lock index 461c6e6a..bbd0289a 100644 --- a/user/wasmtime_spliter/Cargo.lock +++ b/user/wasmtime_spliter/Cargo.lock @@ -26,6 +26,39 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -457,37 +490,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - [[package]] name = "naked-function" version = "0.1.5" @@ -506,7 +508,7 @@ checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -547,9 +549,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -565,9 +567,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -639,31 +641,32 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] name = "serde_json" -version = "1.0.109" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0652c533506ad7a2e353cce269330d6afd8bdfb6d75e0ace5b35aacbd7b9e9" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -743,9 +746,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -775,7 +778,7 @@ checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -910,7 +913,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -1008,7 +1011,7 @@ checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -1044,9 +1047,9 @@ dependencies = [ name = "wasmtime_spliter" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "lazy_static", - "ms_hostcall", - "ms_std", "spin", "wasmtime_wasi_api", ] @@ -1055,11 +1058,11 @@ dependencies = [ name = "wasmtime_wasi_api" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown 0.14.5", "lazy_static", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "sjlj", "spin", "wasmtime", @@ -1190,5 +1193,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] diff --git a/user/wasmtime_spliter/Cargo.toml b/user/wasmtime_spliter/Cargo.toml index 37da7826..0da7a6cf 100644 --- a/user/wasmtime_spliter/Cargo.toml +++ b/user/wasmtime_spliter/Cargo.toml @@ -9,12 +9,12 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } spin = "0.9.8" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_spliter/src/lib.rs b/user/wasmtime_spliter/src/lib.rs index 9e351faf..d2abe1a8 100644 --- a/user/wasmtime_spliter/src/lib.rs +++ b/user/wasmtime_spliter/src/lib.rs @@ -6,8 +6,8 @@ use core::mem::forget; use alloc::{string::{String, ToString}, vec::Vec}; use spin::Mutex; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, println, libos::libos}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, println, libos::libos}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/user/wasmtime_trans_data/Cargo.toml b/user/wasmtime_trans_data/Cargo.toml index 79f49237..3c22a507 100644 --- a/user/wasmtime_trans_data/Cargo.toml +++ b/user/wasmtime_trans_data/Cargo.toml @@ -10,8 +10,8 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall", features = ["signal"] } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall", features = ["signal"] } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } @@ -19,4 +19,4 @@ lazy_static = { version = "1.5.0", features = ["spin_no_std"] } spin = "0.9.8" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] diff --git a/user/wasmtime_trans_data/src/lib.rs b/user/wasmtime_trans_data/src/lib.rs index 828dd8cc..97e91d24 100644 --- a/user/wasmtime_trans_data/src/lib.rs +++ b/user/wasmtime_trans_data/src/lib.rs @@ -6,8 +6,8 @@ use core::mem::forget; use alloc::{string::{String, ToString}, vec::Vec}; use spin::Mutex; -use ms_hostcall::types::{OpenFlags, OpenMode}; -use ms_std::{agent::FaaSFuncResult as Result, args, println, libos::libos, time::{SystemTime, UNIX_EPOCH}}; +use as_hostcall::types::{OpenFlags, OpenMode}; +use as_std::{agent::FaaSFuncResult as Result, args, println, libos::libos, time::{SystemTime, UNIX_EPOCH}}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; diff --git a/user/wasmtime_write/Cargo.toml b/user/wasmtime_write/Cargo.toml index 601c5e10..5a2138d6 100644 --- a/user/wasmtime_write/Cargo.toml +++ b/user/wasmtime_write/Cargo.toml @@ -9,14 +9,14 @@ build = "build.rs" crate-type = ["staticlib"] [dependencies] -ms_std = { path = "../../ms_std", features = ["panic_def", "alloc_def"] } -ms_hostcall = { path = "../../ms_hostcall" } +as_std = { path = "../../as_std", features = ["panic_def", "alloc_def"] } +as_hostcall = { path = "../../as_hostcall" } wasmtime_wasi_api = { path = "../../wasmtime_wasi_api" } lazy_static = { version = "1.5.0", features = ["spin_no_std"] } spin = "0.9.8" [features] -mpk = ["ms_std/mpk"] +mpk = ["as_std/mpk"] default = [] diff --git a/user/wasmtime_write/src/lib.rs b/user/wasmtime_write/src/lib.rs index ddcb18c0..1847ebea 100644 --- a/user/wasmtime_write/src/lib.rs +++ b/user/wasmtime_write/src/lib.rs @@ -4,7 +4,7 @@ extern crate alloc; use alloc::string::ToString; use spin::Mutex; -use ms_std::{agent::FaaSFuncResult as Result, args, println, libos::libos}; +use as_std::{agent::FaaSFuncResult as Result, args, println, libos::libos}; use wasmtime_wasi_api::{wasmtime, LibosCtx}; use wasmtime::Store; diff --git a/wasmtime_wasi_api/Cargo.toml b/wasmtime_wasi_api/Cargo.toml index e1f355c0..5fa2189e 100644 --- a/wasmtime_wasi_api/Cargo.toml +++ b/wasmtime_wasi_api/Cargo.toml @@ -6,11 +6,11 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -ms_std = { path = "../ms_std", default-features = false, features = [] } -ms_hostcall = { path = "../ms_hostcall", default-features = false, features = [ +as_std = { path = "../as_std", default-features = false, features = [] } +as_hostcall = { path = "../as_hostcall", default-features = false, features = [ "signal", ] } -ms_std_proc_macro = { path = "../ms_std_proc_macro" } +as_std_proc_macro = { path = "../as_std_proc_macro" } spin = "0.9.8" hashbrown = { version = "0.14", default-features = false, features = ["ahash"] } lazy_static = { version = "1.4.0", features = ["spin_no_std"] } diff --git a/wasmtime_wasi_api/src/capis.rs b/wasmtime_wasi_api/src/capis.rs index 19d39f3b..9ea75676 100644 --- a/wasmtime_wasi_api/src/capis.rs +++ b/wasmtime_wasi_api/src/capis.rs @@ -3,9 +3,9 @@ extern crate sjlj; use core::ptr::{null, null_mut}; -use ms_hostcall::{mm::{MMResult, ProtFlags}, signal::{SigAction, SigInfo, Sigset, Ucontext}}; -use ms_std::libos::libos; -use ms_std::println; +use as_hostcall::{mm::{MMResult, ProtFlags}, signal::{SigAction, SigInfo, Sigset, Ucontext}}; +use as_std::libos::libos; +use as_std::println; use sjlj::{JumpBuf, longjmp, setjmp}; // Flags to either `wasmtime_mmap_{new,remap}` or `wasmtime_mprotect`. diff --git a/wasmtime_wasi_api/src/data_buffer.rs b/wasmtime_wasi_api/src/data_buffer.rs index f557f64c..4ba6bc9a 100644 --- a/wasmtime_wasi_api/src/data_buffer.rs +++ b/wasmtime_wasi_api/src/data_buffer.rs @@ -2,13 +2,13 @@ extern crate alloc; use alloc::{string::String, vec::Vec}; -use ms_std::agent::DataBuffer; +use as_std::agent::DataBuffer; #[cfg(feature = "log")] -use ms_std::{ +use as_std::{ println, time::{SystemTime, UNIX_EPOCH}, }; -use ms_std_proc_macro::FaasData; +use as_std_proc_macro::FaasData; use wasmtime::Caller; use crate::LibosCtx; diff --git a/wasmtime_wasi_api/src/wasi.rs b/wasmtime_wasi_api/src/wasi.rs index 45909155..657106e5 100644 --- a/wasmtime_wasi_api/src/wasi.rs +++ b/wasmtime_wasi_api/src/wasi.rs @@ -5,7 +5,7 @@ extern crate alloc; use core::mem::forget; #[cfg(feature = "log")] -use ms_std::println; +use as_std::println; #[cfg(feature = "log")] use alloc::format; @@ -15,8 +15,8 @@ use sjlj::{longjmp, JumpBuf}; use spin::{Mutex, MutexGuard}; use wasmtime::Caller; -use ms_hostcall::{fdtab::FdtabResult, types::{DirEntry, Fd, OpenFlags, OpenMode, Stat}}; -use ms_std::{ +use as_hostcall::{fdtab::FdtabResult, types::{DirEntry, Fd, OpenFlags, OpenMode, Stat}}; +use as_std::{ libos::libos, time::{SystemTime, UNIX_EPOCH}, };