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
Notes: sideshowbarker 2024-07-17 02:29:11 +09:00
9 changed files with 7 additions and 45 deletions

View file

@ -11,8 +11,8 @@
#include <AK/Noncopyable.h>
#ifdef KERNEL
# include <Kernel/Arch/Processor.h>
# include <Kernel/Arch/ScopedCritical.h>
# include <Kernel/Locking/SpinlockProtected.h>
# include <Kernel/ScopedCritical.h>
#elif defined(AK_OS_WINDOWS)
// Forward declare to avoid pulling Windows.h into every file in existence.
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/Processor.h>
#include <Kernel/Arch/SafeMem.h>
#include <Kernel/Arch/ScopedCritical.h>
#include <Kernel/Arch/TrapFrame.h>
#include <Kernel/Arch/x86_64/CPUID.h>
#include <Kernel/Arch/x86_64/MSR.h>
#include <Kernel/Arch/x86_64/ProcessorInfo.h>
#include <Kernel/ScopedCritical.h>
#include <Kernel/Memory/PageDirectory.h>
#include <Kernel/Memory/ScopedAddressSpaceSwitcher.h>

View file

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

View file

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

View file

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

View file

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

View file

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