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).
This commit is contained in:
Frans Kaashoek 2019-07-22 14:30:45 -04:00
parent c5d48db045
commit 5eab649255

View file

@ -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)