summaryrefslogtreecommitdiff
path: root/proc.h
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2010-08-26 08:03:18 -0400
committerFrans Kaashoek <[email protected]>2010-08-26 08:03:18 -0400
commitd55b2fac074ac23e30c337014f40ae2156b31b60 (patch)
treebb9885972bf8929e7957f9ea512a8befaf06b11c /proc.h
parentd87f51c5a1c5e7a2a3ba111b1052a297f4f96fb0 (diff)
parent789b508d538e6faf635e49f268a4f1f9e9b65f05 (diff)
downloadxv6-labs-d55b2fac074ac23e30c337014f40ae2156b31b60.tar.gz
xv6-labs-d55b2fac074ac23e30c337014f40ae2156b31b60.tar.bz2
xv6-labs-d55b2fac074ac23e30c337014f40ae2156b31b60.zip
Merge commit 'origin/page' into page
Diffstat (limited to 'proc.h')
-rw-r--r--proc.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/proc.h b/proc.h
index ebc42f1..7d97dfa 100644
--- a/proc.h
+++ b/proc.h
@@ -3,8 +3,8 @@
#define SEG_KCODE 1 // kernel code
#define SEG_KDATA 2 // kernel data+stack
#define SEG_KCPU 3 // kernel per-cpu data
-#define SEG_UCODE 4
-#define SEG_UDATA 5
+#define SEG_UCODE 4 // user code
+#define SEG_UDATA 5 // user data+stack
#define SEG_TSS 6 // this process's task state
#define NSEGS 7
@@ -16,7 +16,7 @@
// Contexts are stored at the bottom of the stack they
// describe; the stack pointer is the address of the context.
// The layout of the context matches the layout of the stack in swtch.S
-// at "Switch stacks" comment. Switch itself doesn't save eip explicitly,
+// at the "Switch stacks" comment. Switch doesn't save eip explicitly,
// but it is on the stack and allocproc() manipulates it.
struct context {
uint edi;
@@ -31,7 +31,7 @@ enum procstate { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE };
// Per-process state
struct proc {
uint sz; // Size of process memory (bytes)
- pde_t* pgdir; // linear address of proc's pgdir
+ pde_t* pgdir; // Linear address of proc's pgdir
char *kstack; // Bottom of kernel stack for this process
enum procstate state; // Process state
volatile int pid; // Process ID
@@ -48,6 +48,7 @@ struct proc {
// Process memory is laid out contiguously, low addresses first:
// text
// original data and bss
+// invalid page
// fixed-size stack
// expandable heap