Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ jobs:
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18 && rm llvm.sh
- name: Test
run: |
cargo build --features=stub-syscalls
make test
21 changes: 17 additions & 4 deletions src/syscalls/stub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//! an impl of SyscallImpls trait.

use crate::{
ckb_constants::{CellField, HeaderField, InputField, Source},
ckb_constants::{CellField, HeaderField, InputField, Place, Source},
error::SysError,
syscalls::traits::SyscallImpls,
syscalls::traits::{Bounds, SyscallImpls},
};
use alloc::{boxed::Box, string::String, vec::Vec};
use core::ffi::CStr;
Expand Down Expand Up @@ -48,7 +48,13 @@ pub fn debug(s: String) {
}

pub fn exec(index: usize, source: Source, place: usize, bounds: usize, argv: &[&CStr]) -> u64 {
let result = get().exec(index, source, place, bounds, argv);
let result = get().exec(
index,
source,
Place::try_from(place as u64).unwrap(),
Bounds::from(bounds as u64),
argv,
);
match result {
Ok(_) => 0,
Err(e) => e.into(),
Expand Down Expand Up @@ -236,7 +242,14 @@ pub fn spawn(
i += 1;
}
}
let process_id = get().spawn(index, source, place, bounds, &argv, &fds)?;
let process_id = get().spawn(
index,
source,
Place::try_from(place as u64).unwrap(),
Bounds::from(bounds as u64),
&argv,
&fds,
)?;
unsafe { spgs.process_id.write(process_id) }
Ok(process_id)
}
Expand Down