mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
![kleines Filmröllchen](/assets/img/avatar_default.png)
About half of the Processor code is common across architectures, so let's share it with a templated base class. Also, other code that can be shared in some ways, like FPUState and TrapFrame functions, is adjusted here. Functions which cannot be shared trivially (without internal refactoring) are left alone for now.
33 lines
724 B
C++
33 lines
724 B
C++
/*
|
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
|
* Copyright (c) 2023, Idan Horowitz <idan.horowitz@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <Kernel/Arch/Processor.h>
|
|
#include <Kernel/Arch/TrapFrame.h>
|
|
#include <Kernel/Interrupts/InterruptDisabler.h>
|
|
|
|
namespace Kernel {
|
|
|
|
extern "C" void enter_trap_no_irq(TrapFrame* trap)
|
|
{
|
|
InterruptDisabler disable;
|
|
Processor::current().enter_trap(*trap, false);
|
|
}
|
|
|
|
extern "C" void enter_trap(TrapFrame* trap)
|
|
{
|
|
InterruptDisabler disable;
|
|
Processor::current().enter_trap(*trap, true);
|
|
}
|
|
|
|
extern "C" void exit_trap(TrapFrame* trap)
|
|
{
|
|
InterruptDisabler disable;
|
|
return Processor::current().exit_trap(*trap);
|
|
}
|
|
|
|
}
|