summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2019-07-22 14:30:45 -0400
committerFrans Kaashoek <[email protected]>2019-07-22 14:30:45 -0400
commit5eab649255edc210c1e05ae62d2cb6fd0f328d8c (patch)
tree23ae0a66f44ea1d892cf4725d1b5d229408d376f /kernel
parentc5d48db0456472d4edb3ac47763b23141839ca47 (diff)
downloadxv6-labs-5eab649255edc210c1e05ae62d2cb6fd0f328d8c.tar.gz
xv6-labs-5eab649255edc210c1e05ae62d2cb6fd0f328d8c.tar.bz2
xv6-labs-5eab649255edc210c1e05ae62d2cb6fd0f328d8c.zip
Allocate 2 pages per proc, with the top one unmapped.
The page below the last proc is unmapped by default (because the kernel doesn't map anything right below the kernel stacks).
Diffstat (limited to 'kernel')
-rw-r--r--kernel/memlayout.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/memlayout.h b/kernel/memlayout.h
index 13d1705..ef5c1e1 100644
--- a/kernel/memlayout.h
+++ b/kernel/memlayout.h
@@ -53,4 +53,4 @@
// map the trampoline page to the highest address,
// in both user and kernel space.
#define TRAMPOLINE (MAXVA - PGSIZE)
-#define KSTACK(p) ((TRAMPOLINE-PGSIZE)-p*2*PGSIZE)
+#define KSTACK(p) (TRAMPOLINE - (p+1)* 2*PGSIZE)