feat(kernel): WatchDeath + SetTimer events as notification signals; adapter wakes at earliest deadline

This commit is contained in:
2026-10-27 16:06:04 +01:00
parent a4f467f45d
commit 817a38993b
25 changed files with 517 additions and 21 deletions

View File

@@ -56,3 +56,22 @@ pub fn ack_interrupt(irq: CapSlot) -> Result<()> {
)
.map(|_| ())
}
/// Signals `notification` when the process behind `process` dies.
pub fn watch_death(process: CapSlot, notification: CapSlot) -> Result<()> {
raw(
SYS_WATCH_DEATH,
[process.value() as usize, notification.value() as usize, 0, 0, 0, 0],
)
.map(|_| ())
}
/// Signals `notification` once `get_time()` reaches `deadline`; replaces
/// this process's timer. A zero deadline cancels it.
pub fn set_timer(notification: CapSlot, deadline: types::time::Ticks) -> Result<()> {
raw(
SYS_SET_TIMER,
[notification.value() as usize, deadline.raw() as usize, 0, 0, 0, 0],
)
.map(|_| ())
}