From bcd2e546c2c959e71a9f75ff697d279060c6665f Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Fri, 15 Mar 2024 09:36:20 -0700 Subject: [PATCH] also check if posted --- sys/kern/src/syscalls.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/kern/src/syscalls.rs b/sys/kern/src/syscalls.rs index 90912073e3..1b744de967 100644 --- a/sys/kern/src/syscalls.rs +++ b/sys/kern/src/syscalls.rs @@ -855,12 +855,16 @@ fn irq_status( UsageError::NoIrq, )))?; - // Combine the status of all the IRQs in the notification set and return - // them to the caller. - let status = irqs.fold(IrqStatus::empty(), |status, irq| { + // Combine the platform-level status of all the IRQs in the notification set. + let mut status = irqs.fold(IrqStatus::empty(), |status, irq| { status | crate::arch::irq_status(irq.0) }); + // If any bits in the notification mask are set in the caller's notification + // set, then a notification has been posted to the task and not yet consumed. + let posted = tasks[caller].notifications & args.notification_bitmask != 0; + status.set(IrqStatus::POSTED, posted); + tasks[caller].save_mut().set_irq_status_result(status); // Continue running the same task.