mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 09:07:44 +00:00
Kernel: Move SMAP disabler RAII helper to its own file
Added this in a new directory called Kernel/Arch/x86/ where stuff that applies to both i386 and x86_64 can live.
This commit is contained in:
parent
8f70528f30
commit
8129f3da52
9 changed files with 59 additions and 19 deletions
|
@ -1137,22 +1137,4 @@ ALWAYS_INLINE void clac()
|
|||
: "cc");
|
||||
}
|
||||
|
||||
class SmapDisabler {
|
||||
public:
|
||||
ALWAYS_INLINE SmapDisabler()
|
||||
{
|
||||
m_flags = cpu_flags();
|
||||
stac();
|
||||
}
|
||||
|
||||
ALWAYS_INLINE ~SmapDisabler()
|
||||
{
|
||||
if (!(m_flags & 0x40000))
|
||||
clac();
|
||||
}
|
||||
|
||||
private:
|
||||
u32 m_flags;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue