feat(server-framework): add Server trait, Encode/Decode, async executor, syscall wrappers, and mock arch for host testing
This commit is contained in:
19
crates/userspace/src/arch/mock.rs
Normal file
19
crates/userspace/src/arch/mock.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
pub fn syscall0(_nr: usize) -> usize {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn syscall1(_nr: usize, _a0: usize) -> usize {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn syscall2(_nr: usize, _a0: usize, _a1: usize) -> usize {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn syscall5(_nr: usize, _a0: usize, _a1: usize, _a2: usize, _a3: usize, _a4: usize) -> usize {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn syscall_receive(_nr: usize, _a0: usize) -> (usize, usize, usize, usize) {
|
||||
(0, 0, 0, 0)
|
||||
}
|
||||
@@ -1,14 +1,9 @@
|
||||
#[cfg(target_arch = "riscv64")]
|
||||
#[cfg(all(target_arch = "riscv64", target_os = "none"))]
|
||||
mod riscv;
|
||||
#[cfg(target_arch = "riscv64")]
|
||||
#[cfg(all(target_arch = "riscv64", target_os = "none"))]
|
||||
pub use riscv::*;
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
mod arm;
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
pub use arm::*;
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
mod x86;
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub use x86::*;
|
||||
#[cfg(not(target_os = "none"))]
|
||||
mod mock;
|
||||
#[cfg(not(target_os = "none"))]
|
||||
pub use mock::*;
|
||||
|
||||
Reference in New Issue
Block a user