kernel: use FLAGS_IF enum for 0x200 (#105)

This commit is contained in:
Robin authored and GitHub committed 2022-02-16 10:54:28 +08:00
1 parent 4892e84bae
commit 78b167e4f3
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -415,7 +415,7 @@ func syscallInit() {
// write syscall selector
wrmsr(_MSR_STAR, 8<<32)
// clear IF when enter syscall
wrmsr(_MSR_FSTAR, 0x200)
wrmsr(_MSR_FSTAR, _FLAGS_IF)
// set syscall entry
wrmsr(_MSR_LSTAR, sys.FuncPC(syscallEntry))
+2 -2
View File
@@ -317,9 +317,9 @@ func pickup(pidx *int) *Thread {
//go:nosplit
func switchto(t *Thread) {
begin := nanosecond()
// assert interrupt is enableds
// assert that interrupt is enabled
// TODO: enable check
if t.tf != nil && t.tf.FLAGS&0x200 == 0 {
if t.tf != nil && t.tf.FLAGS&_FLAGS_IF == 0 {
throw("bad eflags")
}
setMythread(t)