1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:17:35 +00:00

Kernel: Move ScopedCritical.cpp to Kernel base directory

This file does not contain any architecture specific implementations,
so we can move it to the Kernel base directory. Also update the relevant
include paths.
This commit is contained in:
Timon Kruiper 2022-10-25 22:17:57 +02:00 committed by Andrew Kaster
parent 496a3cdcd3
commit b18a7297c5
9 changed files with 7 additions and 45 deletions

View file

@ -11,8 +11,8 @@
#include <AK/Noncopyable.h> #include <AK/Noncopyable.h>
#ifdef KERNEL #ifdef KERNEL
# include <Kernel/Arch/Processor.h> # include <Kernel/Arch/Processor.h>
# include <Kernel/Arch/ScopedCritical.h>
# include <Kernel/Locking/SpinlockProtected.h> # include <Kernel/Locking/SpinlockProtected.h>
# include <Kernel/ScopedCritical.h>
#elif defined(AK_OS_WINDOWS) #elif defined(AK_OS_WINDOWS)
// Forward declare to avoid pulling Windows.h into every file in existence. // Forward declare to avoid pulling Windows.h into every file in existence.
extern "C" __declspec(dllimport) void __stdcall Sleep(unsigned long); extern "C" __declspec(dllimport) void __stdcall Sleep(unsigned long);

View file

@ -1,37 +0,0 @@
/*
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Arch/ScopedCritical.h>
#include <Kernel/Arch/Processor.h>
namespace Kernel {
ScopedCritical::ScopedCritical() = default;
ScopedCritical::~ScopedCritical() = default;
ScopedCritical::ScopedCritical(ScopedCritical&& /*from*/)
{
TODO_AARCH64();
}
ScopedCritical& ScopedCritical::operator=(ScopedCritical&& /*from*/)
{
TODO_AARCH64();
return *this;
}
void ScopedCritical::leave()
{
TODO_AARCH64();
}
void ScopedCritical::enter()
{
TODO_AARCH64();
}
}

View file

@ -24,11 +24,11 @@
#include <Kernel/Arch/Interrupts.h> #include <Kernel/Arch/Interrupts.h>
#include <Kernel/Arch/Processor.h> #include <Kernel/Arch/Processor.h>
#include <Kernel/Arch/SafeMem.h> #include <Kernel/Arch/SafeMem.h>
#include <Kernel/Arch/ScopedCritical.h>
#include <Kernel/Arch/TrapFrame.h> #include <Kernel/Arch/TrapFrame.h>
#include <Kernel/Arch/x86_64/CPUID.h> #include <Kernel/Arch/x86_64/CPUID.h>
#include <Kernel/Arch/x86_64/MSR.h> #include <Kernel/Arch/x86_64/MSR.h>
#include <Kernel/Arch/x86_64/ProcessorInfo.h> #include <Kernel/Arch/x86_64/ProcessorInfo.h>
#include <Kernel/ScopedCritical.h>
#include <Kernel/Memory/PageDirectory.h> #include <Kernel/Memory/PageDirectory.h>
#include <Kernel/Memory/ScopedAddressSpaceSwitcher.h> #include <Kernel/Memory/ScopedAddressSpaceSwitcher.h>

View file

@ -260,6 +260,7 @@ set(KERNEL_SOURCES
ProcessProcFSTraits.cpp ProcessProcFSTraits.cpp
Random.cpp Random.cpp
Scheduler.cpp Scheduler.cpp
ScopedCritical.cpp
StdLib.cpp StdLib.cpp
Syscalls/anon_create.cpp Syscalls/anon_create.cpp
Syscalls/alarm.cpp Syscalls/alarm.cpp
@ -390,7 +391,6 @@ if ("${SERENITY_ARCH}" STREQUAL "x86_64")
Arch/x86_64/VGA/IOArbiter.cpp Arch/x86_64/VGA/IOArbiter.cpp
Arch/x86_64/RTC.cpp Arch/x86_64/RTC.cpp
Arch/x86_64/ScopedCritical.cpp
Arch/x86_64/Shutdown.cpp Arch/x86_64/Shutdown.cpp
Arch/x86_64/SmapDisabler.cpp Arch/x86_64/SmapDisabler.cpp
@ -466,7 +466,6 @@ elseif("${SERENITY_ARCH}" STREQUAL "aarch64")
Arch/aarch64/Panic.cpp Arch/aarch64/Panic.cpp
Arch/aarch64/Processor.cpp Arch/aarch64/Processor.cpp
Arch/aarch64/SafeMem.cpp Arch/aarch64/SafeMem.cpp
Arch/aarch64/ScopedCritical.cpp
Arch/aarch64/SmapDisabler.cpp Arch/aarch64/SmapDisabler.cpp
Arch/aarch64/vector_table.S Arch/aarch64/vector_table.S
) )

View file

@ -16,7 +16,7 @@
#include <Kernel/Library/NonnullLockRefPtr.h> #include <Kernel/Library/NonnullLockRefPtr.h>
#ifdef KERNEL #ifdef KERNEL
# include <Kernel/Arch/Processor.h> # include <Kernel/Arch/Processor.h>
# include <Kernel/Arch/ScopedCritical.h> # include <Kernel/ScopedCritical.h>
#endif #endif
#define LOCKREFPTR_SCRUB_BYTE 0xa0 #define LOCKREFPTR_SCRUB_BYTE 0xa0

View file

@ -11,8 +11,8 @@
#include <AK/AtomicRefCounted.h> #include <AK/AtomicRefCounted.h>
#include <AK/StdLibExtras.h> #include <AK/StdLibExtras.h>
#include <Kernel/Arch/Processor.h> #include <Kernel/Arch/Processor.h>
#include <Kernel/Arch/ScopedCritical.h>
#include <Kernel/Library/LockRefPtr.h> #include <Kernel/Library/LockRefPtr.h>
#include <Kernel/ScopedCritical.h>
namespace AK { namespace AK {

View file

@ -14,7 +14,7 @@
#include <AK/Types.h> #include <AK/Types.h>
#ifdef KERNEL #ifdef KERNEL
# include <Kernel/Arch/Processor.h> # include <Kernel/Arch/Processor.h>
# include <Kernel/Arch/ScopedCritical.h> # include <Kernel/ScopedCritical.h>
#endif #endif
#define NONNULLLOCKREFPTR_SCRUB_BYTE 0xa1 #define NONNULLLOCKREFPTR_SCRUB_BYTE 0xa1

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <Kernel/Arch/ScopedCritical.h> #include <Kernel/ScopedCritical.h>
#include <Kernel/Arch/Processor.h> #include <Kernel/Arch/Processor.h>