1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:27:35 +00:00

Kernel: Move InterruptDisabler out of Arch directory

The code in this file is not architecture specific, so it can be moved
to the base Kernel directory.
This commit is contained in:
Timon Kruiper 2022-10-05 19:27:36 +02:00 committed by Gunnar Beutner
parent 8b5b42f667
commit 9827c11d8b
30 changed files with 29 additions and 29 deletions

View file

@ -0,0 +1,32 @@
/*
* Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Types.h>
#include <Kernel/Arch/Processor.h>
namespace Kernel {
class InterruptDisabler {
public:
InterruptDisabler()
: m_interrupts_were_enabled(Processor::are_interrupts_enabled())
{
Processor::disable_interrupts();
}
~InterruptDisabler()
{
if (m_interrupts_were_enabled)
Processor::enable_interrupts();
}
private:
bool m_interrupts_were_enabled;
};
}