Serenity Operating System
at master 25 lines 674 B view raw
1/* 2 * Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com> 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7#include <Kernel/Arch/Processor.h> 8 9namespace Kernel { 10 11// FIXME: Move the InterruptsState related functions inside the Processor class, when we have a generic Processor base class. 12InterruptsState processor_interrupts_state() 13{ 14 return Processor::are_interrupts_enabled() ? InterruptsState::Enabled : InterruptsState::Disabled; 15} 16 17void restore_processor_interrupts_state(InterruptsState interrupts_state) 18{ 19 if (interrupts_state == InterruptsState::Enabled) 20 Processor::enable_interrupts(); 21 else 22 Processor::disable_interrupts(); 23} 24 25}