aboutsummaryrefslogtreecommitdiff
path: root/kernel/memlayout.h
diff options
context:
space:
mode:
authorFrans Kaashoek <kaashoek@mit.edu>2022-09-19 17:19:32 -0400
committerFrans Kaashoek <kaashoek@mit.edu>2022-09-19 17:19:32 -0400
commitb1083ee059a2aa0e018676f4f3790cb3bafaa1c5 (patch)
treecfacff0e94df41b092fcfda9cdabd854b5b38945 /kernel/memlayout.h
parent4b46c0c6eb464782faa36d158246ba4e3238c970 (diff)
downloadxv6-labs-2022-origin/pgtbl.tar.xz
xv6-labs-2022-origin/pgtbl.zip
Diffstat (limited to 'kernel/memlayout.h')
-rw-r--r--kernel/memlayout.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/memlayout.h b/kernel/memlayout.h
index 776f98c..74d2fd4 100644
--- a/kernel/memlayout.h
+++ b/kernel/memlayout.h
@@ -25,6 +25,10 @@
#define VIRTIO0 0x10001000
#define VIRTIO0_IRQ 1
+#ifdef LAB_NET
+#define E1000_IRQ 33
+#endif
+
// core local interruptor (CLINT), which contains the timer.
#define CLINT 0x2000000L
#define CLINT_MTIMECMP(hartid) (CLINT + 0x4000 + 8*(hartid))
@@ -53,7 +57,7 @@
// map kernel stacks beneath the trampoline,
// each surrounded by invalid guard pages.
-#define KSTACK(p) (TRAMPOLINE - ((p)+1)* 2*PGSIZE)
+#define KSTACK(p) (TRAMPOLINE - (p)*2*PGSIZE - 3*PGSIZE)
// User memory layout.
// Address zero first:
@@ -62,6 +66,14 @@
// fixed-size stack
// expandable heap
// ...
+// USYSCALL (shared with kernel)
// TRAPFRAME (p->trapframe, used by the trampoline)
// TRAMPOLINE (the same page as in the kernel)
#define TRAPFRAME (TRAMPOLINE - PGSIZE)
+#ifdef LAB_PGTBL
+#define USYSCALL (TRAPFRAME - PGSIZE)
+
+struct usyscall {
+ int pid; // Process ID
+};
+#endif