mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:27:43 +00:00
Kernel: Move ScopedCritical + SmapDisabler CPP files into x86 common
This commit is contained in:
parent
418d69c0ad
commit
e35222a76e
3 changed files with 2 additions and 2 deletions
25
Kernel/Arch/x86/common/SmapDisabler.cpp
Normal file
25
Kernel/Arch/x86/common/SmapDisabler.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/Arch/SmapDisabler.h>
|
||||
|
||||
#include <Kernel/Arch/x86/ASM_wrapper.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
SmapDisabler::SmapDisabler()
|
||||
: m_flags(cpu_flags())
|
||||
{
|
||||
stac();
|
||||
}
|
||||
|
||||
SmapDisabler::~SmapDisabler()
|
||||
{
|
||||
if (!(m_flags & 0x40000))
|
||||
clac();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue