summaryrefslogtreecommitdiff
path: root/kernel/plic.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/plic.c')
-rw-r--r--kernel/plic.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/plic.c b/kernel/plic.c
index 0f19ab0..cc9a97e 100644
--- a/kernel/plic.c
+++ b/kernel/plic.c
@@ -11,8 +11,9 @@
void
plicinit(void)
{
- // set uart's priority to be non-zero (otherwise disabled).
+ // set desired IRQ priorities non-zero (otherwise disabled).
*(uint32*)(PLIC + UART0_IRQ*4) = 1;
+ *(uint32*)(PLIC + VIRTIO_IRQ*4) = 1;
}
void
@@ -21,11 +22,9 @@ plicinithart(void)
int hart = cpuid();
// set uart's enable bit for this hart's S-mode.
- //*(uint32*)(PLIC + 0x2080)= (1 << UART0_IRQ);
- *(uint32*)PLIC_SENABLE(hart)= (1 << UART0_IRQ);
+ *(uint32*)PLIC_SENABLE(hart)= (1 << UART0_IRQ) | (1 << VIRTIO_IRQ);
// set this hart's S-mode priority threshold to 0.
- //*(uint32*)(PLIC + 0x201000) = 0;
*(uint32*)PLIC_SPRIORITY(hart) = 0;
}