summaryrefslogtreecommitdiff
path: root/memlayout.h
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2019-06-04 14:20:37 -0400
committerRobert Morris <[email protected]>2019-06-04 14:20:37 -0400
commita82772594e1807632b3650bff111108f250de3b7 (patch)
tree98581a6fa9bfd5ecbabe8052b112c4166c7f9e9e /memlayout.h
parentcff3ce6e04ce4a353324630df788df21566807a6 (diff)
downloadxv6-labs-a82772594e1807632b3650bff111108f250de3b7.tar.gz
xv6-labs-a82772594e1807632b3650bff111108f250de3b7.tar.bz2
xv6-labs-a82772594e1807632b3650bff111108f250de3b7.zip
timer interrupts -> supervisor software interrupt
Diffstat (limited to 'memlayout.h')
-rw-r--r--memlayout.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/memlayout.h b/memlayout.h
index db233f7..db7c076 100644
--- a/memlayout.h
+++ b/memlayout.h
@@ -1,7 +1,10 @@
// Physical memory layout
-// qemu -machine virt is set up like this:
+// qemu -machine virt is set up like this,
+// based on qemu's hw/riscv/virt.c:
+//
// 00001000 -- boot ROM, provided by qemu
+// 02000000 -- CLINT
// 0C000000 -- PLIC
// 10000000 -- uart0 registers
// 80000000 -- boot ROM jumps here in machine mode
@@ -18,10 +21,16 @@
#define UART0 0x10000000L
#define UART0_IRQ 10
+// local interrupt controller, which contains the timer.
+#define CLINT 0x2000000L
+#define CLINT_MSIP0 (CLINT + 0x0)
+#define CLINT_MTIMECMP0 (CLINT + 0x4000)
+#define CLINT_MTIME (CLINT + 0xBFF8)
+
// qemu puts programmable interrupt controller here.
#define PLIC 0x0c000000L
-#define RAMDISK 0x88000000
+#define RAMDISK 0x88000000L
// the kernel expects there to be RAM
// for use by the kernel and user pages