From de9d72c9086ec935d5b2b889f50ff611135f80fa Mon Sep 17 00:00:00 2001
From: Robert Morris <rtm@csail.mit.edu>
Date: Thu, 13 Jun 2019 06:49:02 -0400
Subject: virtio disk driver

---
 kernel/plic.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'kernel/plic.c')

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;
 }
 
-- 
cgit v1.2.3