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:
parent
927926b924
commit
336fb4f313
32 changed files with 31 additions and 31 deletions
|
@ -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 {
|
||||
|
||||
|
|
32
Kernel/Interrupts/InterruptDisabler.h
Normal file
32
Kernel/Interrupts/InterruptDisabler.h
Normal 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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue