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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user