Fix previous mode detection by reading CS from the trap frame
This commit is contained in:
@@ -111,7 +111,7 @@ _Ar\Type\Vector\()Start:
|
||||
|
||||
/* Test previous mode and swap GS if needed */
|
||||
movl $0, TrapPreviousMode(%ebp)
|
||||
mov %cs, %ax
|
||||
mov TrapSegCs(%ebp), %ax
|
||||
and $3, %al
|
||||
mov %al, TrapPreviousMode(%ebp)
|
||||
jz KernelMode\Type\Vector
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define TrapSegFs 40
|
||||
#define TrapSegGs 42
|
||||
#define TrapVector 72
|
||||
#define TrapSegCs 84
|
||||
#define TrapEsp 92
|
||||
#define TrapSegSs 96
|
||||
|
||||
|
||||
Reference in New Issue
Block a user