Interrupt zero is borked.

Not sure if that's a Linux thing, the PLIC implementation being broken, or something else entirely. Just reserve it for now.
This commit is contained in:
Florian Nücke
2020-12-14 14:02:08 +01:00
parent b53f85cca2
commit 61b45aa351
2 changed files with 3 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ public final class ManagedInterruptAllocator implements InterruptAllocator {
throw new IllegalStateException();
}
if (interrupt < 0 || interrupt >= R5PlatformLevelInterruptController.INTERRUPT_COUNT) {
if (interrupt < 1 || interrupt >= R5PlatformLevelInterruptController.INTERRUPT_COUNT) {
throw new IllegalArgumentException();
}

View File

@@ -31,6 +31,7 @@ public final class VirtualMachineDeviceBusAdapter {
public VirtualMachineDeviceBusAdapter(final Board board) {
this.board = board;
this.claimedInterrupts.set(0);
}
public int claimInterrupt() {
@@ -38,7 +39,7 @@ public final class VirtualMachineDeviceBusAdapter {
}
public int claimInterrupt(final int interrupt) {
if (interrupt < 0 || interrupt >= R5PlatformLevelInterruptController.INTERRUPT_COUNT) {
if (interrupt < 1 || interrupt >= R5PlatformLevelInterruptController.INTERRUPT_COUNT) {
throw new IllegalArgumentException();
}