x
This commit is contained in:
parent
3bfcaeaf01
commit
572e106e6f
|
@ -2,6 +2,9 @@
|
|||
#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
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue