summaryrefslogtreecommitdiff
path: root/proc.h
diff options
context:
space:
mode:
authorrsc <rsc>2007-09-27 19:39:10 +0000
committerrsc <rsc>2007-09-27 19:39:10 +0000
commit39c3fb1b157927058f24b72d43be6f15c1d422b7 (patch)
treef02c00516eebdedd22e0ba59a2011c29398a5fc9 /proc.h
parent8c8b748a2f0f10188c1a58c529239fff3a3b1b01 (diff)
downloadxv6-labs-39c3fb1b157927058f24b72d43be6f15c1d422b7.tar.gz
xv6-labs-39c3fb1b157927058f24b72d43be6f15c1d422b7.tar.bz2
xv6-labs-39c3fb1b157927058f24b72d43be6f15c1d422b7.zip
overkill: use segments to catch stack overflow (delete before next year)
Diffstat (limited to 'proc.h')
-rw-r--r--proc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/proc.h b/proc.h
index 57fb4d9..285f6bf 100644
--- a/proc.h
+++ b/proc.h
@@ -4,7 +4,9 @@
#define SEG_UCODE 3
#define SEG_UDATA 4
#define SEG_TSS 5 // this process's task state
-#define NSEGS 6
+#define SEG_CPUSTACK 6
+#define SEG_PROCSTACK 7
+#define NSEGS 8
// Saved registers for kernel context switches.
// Don't need to save all the %fs etc. segment registers,
@@ -22,6 +24,7 @@ struct context {
int esi;
int edi;
int ebp;
+ int ss;
};
enum proc_state { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE };