1
Fork 0
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:
James Mintram 2021-10-16 22:41:09 +01:00 committed by Brian Gianforcaro
parent 418d69c0ad
commit e35222a76e
3 changed files with 2 additions and 2 deletions

View 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();
}
}