1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:17:34 +00:00

Kernel: Move InterruptDisabler to the Interrupts subdirectory

This commit is contained in:
Liav A 2023-02-24 20:33:43 +02:00 committed by Jelle Raaijmakers
parent 927926b924
commit 336fb4f313
32 changed files with 31 additions and 31 deletions

View file

@ -6,8 +6,8 @@
#include <Kernel/Arch/InterruptManagement.h>
#include <Kernel/Debug.h>
#include <Kernel/InterruptDisabler.h>
#include <Kernel/Interrupts/IRQHandler.h>
#include <Kernel/Interrupts/InterruptDisabler.h>
namespace Kernel {

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;
};
}