- badges + Mint, Call/Reply/ReplyRecv w/ gen-checked reply slot - cap transfer (1/msg, copy, needs Delegate, rechecked at delivery) - notifications: signal/wait/poll/bind, irq -> notification routing - WaitAny/WaitForInterrupt removed; a0=status, ErrorCode - libkos: single ecall primitive, compat wrappers + typed new api - fix: trap return clobbered user t0 on every trap - fix: wait queues FIFO, delegate keeps badge, fault cap checked - docs/ipc.md spec, ipc tests, ipc fuzz, kani ntfn + waitqueue
24 lines
615 B
Rust
24 lines
615 B
Rust
use super::*;
|
|
use types::bounded::CapSlot;
|
|
|
|
#[test]
|
|
fn empty_message_has_zeroed_words_and_no_cap() {
|
|
let msg = Message::empty();
|
|
assert_eq!(msg.words(), &[0; MAX_MESSAGE_WORDS]);
|
|
assert!(msg.cap().is_none());
|
|
}
|
|
|
|
#[test]
|
|
fn from_words_keeps_every_word() {
|
|
let msg = Message::from_words([10, 20, 30, 40]);
|
|
assert_eq!(msg.words(), &[10, 20, 30, 40]);
|
|
assert!(msg.cap().is_none());
|
|
}
|
|
|
|
#[test]
|
|
fn with_cap_attaches_one_capability() {
|
|
let msg = Message::from_words([1, 2, 3, 4]).with_cap(CapSlot::new(5).unwrap());
|
|
assert_eq!(msg.cap(), CapSlot::new(5));
|
|
assert_eq!(msg.word(3), 4);
|
|
}
|