mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
398d271a46
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.
32 lines
724 B
C++
32 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);
|
|
}
|
|
|
|
}
|