Skip to content

Commit

Permalink
also check if posted
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Mar 15, 2024
1 parent 3f37f88 commit bcd2e54
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sys/kern/src/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bcd2e54

Please sign in to comment.