软中断处理机制

This commit is contained in:
fslongjin
2022-04-08 20:04:12 +08:00
parent d887f9a0f7
commit 9828aff985
12 changed files with 202 additions and 25 deletions

View File

@ -393,3 +393,14 @@ ul rdmsr(ul address)
: "memory");
return ((ul)tmp0 << 32) | tmp1;
}
uint64_t get_rflags()
{
unsigned long tmp = 0;
__asm__ __volatile__ ("pushfq \n\t"
"movq (%%rsp), %0 \n\t"
"popfq \n\t"
:"=r"(tmp)::"memory");
return tmp;
}