summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2018-09-29 09:05:25 -0400
committerFrans Kaashoek <[email protected]>2018-09-29 09:05:25 -0400
commit572e106e6f4916deae4d2809623f20771fff1d39 (patch)
tree2f81a44f6cf0e30105e25c4526c66d3bdb42387c
parent3bfcaeaf015ffe0d92937c023e9a0086909a0161 (diff)
downloadxv6-labs-572e106e6f4916deae4d2809623f20771fff1d39.tar.gz
xv6-labs-572e106e6f4916deae4d2809623f20771fff1d39.tar.bz2
xv6-labs-572e106e6f4916deae4d2809623f20771fff1d39.zip
x
-rw-r--r--trapasm.S7
1 files changed, 5 insertions, 2 deletions
diff --git a/trapasm.S b/trapasm.S
index d160ff2..fc71336 100644
--- a/trapasm.S
+++ b/trapasm.S
@@ -1,6 +1,9 @@
#include "param.h"
#include "x86.h"
#include "mmu.h"
+
+# the offset of cs in trapframe (i.e., tf->cs - tf)
+#define CSOFF 144
# vectors.S sends all traps here.
.globl alltraps
@@ -22,7 +25,7 @@ alltraps:
push %rbx
push %rax
- cmpw $KCSEG, 144(%rsp) # compare to saved cs
+ cmpw $KCSEG, CSOFF(%rsp) # compare to saved cs
jz 1f
swapgs
@@ -33,7 +36,7 @@ alltraps:
.globl trapret
trapret:
cli
- cmpw $KCSEG, 144(%rsp) # compare to saved cs
+ cmpw $KCSEG, CSOFF(%rsp) # compare to saved cs
jz 1f
swapgs