summaryrefslogtreecommitdiff
path: root/swtch.S
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 /swtch.S
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 'swtch.S')
-rw-r--r--swtch.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/swtch.S b/swtch.S
index 786e9ac..8aa4c2e 100644
--- a/swtch.S
+++ b/swtch.S
@@ -16,10 +16,14 @@ swtch:
movl %esi, 20(%eax)
movl %edi, 24(%eax)
movl %ebp, 28(%eax)
+ movl %ss, %ebx
+ movl %ebx, 32(%eax)
# Load new registers
movl 4(%esp), %eax # not 8(%esp) - popped return address above
+ movl 32(%eax), %ebx
+ movl %ebx, %ss
movl 28(%eax), %ebp
movl 24(%eax), %edi
movl 20(%eax), %esi