mirror of https://github.com/l4ka/pistachio.git
- Added a function to perform an iret to the current code location (e.g., to
re-enable NMIs).
This commit is contained in:
parent
8199813781
commit
862df7e18e
|
@ -32,6 +32,20 @@
|
|||
#ifndef __ARCH__X86__X32__CPU_H__
|
||||
#define __ARCH__X86__X32__CPU_H__
|
||||
|
||||
INLINE void x86_iret_self()
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"pushf \n\t"
|
||||
"push %[kcs] \n\t"
|
||||
"pushl $1f \n\t"
|
||||
"iret \n\t"
|
||||
"1: \n\t"
|
||||
: /* No ooutput */
|
||||
: [kds] "r" ((word_t) X86_KDS),
|
||||
[kcs] "r" ((word_t) X86_KCS)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
INLINE bool ia32_has_cpuid()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue