Skip to content
Snippets Groups Projects
Commit 5455856d authored by Kent McLeod's avatar Kent McLeod
Browse files

riscv: Correct Arch_checkIRQ

This function now returns an error when the IRQ number is outside of the
acceptable range. Previously it always succeeded due to a bad
conditional.
parent 7900b6dc
No related branches found
No related tags found
No related merge requests found
......@@ -23,11 +23,11 @@
exception_t Arch_checkIRQ(word_t irq)
{
if (irq > PLIC_MAX_IRQ && irq != irqInvalid) {
if (irq > PLIC_MAX_IRQ || irq == irqInvalid) {
current_syscall_error.type = seL4_RangeError;
current_syscall_error.rangeErrorMin = 1;
current_syscall_error.rangeErrorMax = maxIRQ;
userError("Rejecting request for IRQ %u. IRQ is greater than maxIRQ.", (int)irq);
userError("Rejecting request for IRQ %u. IRQ is out of range [1..maxIRQ].", (int)irq);
return EXCEPTION_SYSCALL_ERROR;
}
return EXCEPTION_NONE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment