/* * Copyright (c) 2018-2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include namespace Kernel { SmapDisabler::SmapDisabler() : m_flags(cpu_flags()) { stac(); } SmapDisabler::~SmapDisabler() { if (!(m_flags & 0x40000)) clac(); } }