summaryrefslogtreecommitdiff
path: root/Kernel/Arch/Processor.cpp
blob: f3bb93ad3a35e5573a56d94e0bfab4688108714b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <Kernel/Arch/Processor.h>

namespace Kernel {

// FIXME: Move the InterruptsState related functions inside the Processor class, when we have a generic Processor base class.
InterruptsState processor_interrupts_state()
{
    return Processor::are_interrupts_enabled() ? InterruptsState::Enabled : InterruptsState::Disabled;
}

void restore_processor_interrupts_state(InterruptsState interrupts_state)
{
    if (interrupts_state == InterruptsState::Enabled)
        Processor::enable_interrupts();
    else
        Processor::disable_interrupts();
}

}