Tests: - IPC tests: spawn thread B explicitly (CreateProcess no longer spawns threads since the boot logic fix) - Memory tests: RequestPages now returns Value(va) not Slot(cap) - MockPlatform: tracks VA→PA mappings for translate_va - ReleasePages test: ignored (RequestPages no longer creates regions — ReleasePages needs redesign) CapSlot::const_new(value): - const fn that panics at compile time for invalid values - Replaces CapSlot::new(N).unwrap() in init, echo, snake - Cap slot constants are now compile-time verified Also fixes handle_release_pages to use translate_va instead of treating VA as PA directly. 35 kernel tests pass, 1 ignored.
18 lines
315 B
Rust
18 lines
315 B
Rust
#![no_std]
|
|
#![no_main]
|
|
|
|
extern crate userspace_rt;
|
|
|
|
use types::bounded::CapSlot;
|
|
use userspace::syscall;
|
|
|
|
#[unsafe(no_mangle)]
|
|
extern "C" fn main() {
|
|
let ep = CapSlot::const_new(0);
|
|
|
|
let (w0, w1, w2, w3) = syscall::receive(ep);
|
|
syscall::send(ep, w0.wrapping_add(1), w1, w2, w3);
|
|
|
|
syscall::exit();
|
|
}
|