Skip to content

Commit

Permalink
Merge pull request #1579 from tebartsch/plic-threshold-masking
Browse files Browse the repository at this point in the history
PLIC: Implement threshold masking
  • Loading branch information
aswaterman committed Apr 29, 2024
2 parents 0d1c346 + e53f9cb commit bfe1d76
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions riscv/plic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ uint32_t plic_t::context_best_pending(const plic_context_t *c)
}
}

/*
From Spec 1.0.0: 6. Priority Thresholds
The PLIC will mask all PLIC interrupts of a priority less than or equal to
threshold.
*/
if (best_id_prio <= c->priority_threshold) {
return 0;
}

return best_id;
}

Expand Down

0 comments on commit bfe1d76

Please sign in to comment.