feat(kernel): WatchDeath + SetTimer events as notification signals; adapter wakes at earliest deadline
This commit is contained in:
@@ -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(|_| ())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user