Update queued spinlock guard naming
All checks were successful
Builds / ExectOS (amd64, debug) (push) Successful in 34s
Builds / ExectOS (i686, release) (push) Successful in 39s
Builds / ExectOS (i686, debug) (push) Successful in 33s
Builds / ExectOS (amd64, release) (push) Successful in 41s

This commit is contained in:
2026-06-25 18:54:44 +02:00
parent 6184e9e73d
commit f2168e8c55
8 changed files with 18 additions and 17 deletions

View File

@@ -12,17 +12,18 @@
#include <xtos.hh> #include <xtos.hh>
#include <ke/spinlock.hh> #include <ke/spinlock.hh>
/* Kernel Library */ /* Kernel Library */
namespace KE namespace KE
{ {
class QueuedSpinLockGuard class SystemQueuedSpinLockGuard
{ {
private: private:
KSPIN_LOCK_QUEUE_LEVEL QueuedLockLevel; KSPIN_LOCK_QUEUE_LEVEL QueuedLockLevel;
BOOLEAN Owned; BOOLEAN Owned;
public: public:
QueuedSpinLockGuard(IN OUT KSPIN_LOCK_QUEUE_LEVEL LockLevel, SystemQueuedSpinLockGuard(IN OUT KSPIN_LOCK_QUEUE_LEVEL LockLevel,
IN BOOLEAN Acquire = TRUE) IN BOOLEAN Acquire = TRUE)
{ {
QueuedLockLevel = LockLevel; QueuedLockLevel = LockLevel;
@@ -33,7 +34,7 @@ namespace KE
} }
} }
~QueuedSpinLockGuard() ~SystemQueuedSpinLockGuard()
{ {
if(Owned) if(Owned)
{ {
@@ -41,8 +42,8 @@ namespace KE
} }
} }
QueuedSpinLockGuard(const QueuedSpinLockGuard&) = delete; SystemQueuedSpinLockGuard(const SystemQueuedSpinLockGuard&) = delete;
QueuedSpinLockGuard& operator=(const QueuedSpinLockGuard&) = delete; SystemQueuedSpinLockGuard& operator=(const SystemQueuedSpinLockGuard&) = delete;
}; };
class SpinLockGuard class SpinLockGuard

View File

@@ -57,7 +57,7 @@ KE::KThread::AttachThread(IN OUT PKTHREAD Thread)
Thread->UserIdealProcessor = (UCHAR)IdealProcessor; Thread->UserIdealProcessor = (UCHAR)IdealProcessor;
/* Acquire the dispatcher database lock */ /* Acquire the dispatcher database lock */
KE::QueuedSpinLockGuard DispatcherGuard(DispatcherLock); KE::SystemQueuedSpinLockGuard DispatcherGuard(DispatcherLock);
/* Insert the thread into the process's active thread list */ /* Insert the thread into the process's active thread list */
RTL::LinkedList::InsertTailList(&Process->ThreadListHead, &Thread->ThreadListEntry); RTL::LinkedList::InsertTailList(&Process->ThreadListHead, &Thread->ThreadListEntry);

View File

@@ -125,7 +125,7 @@ KE::Scheduler::ReadyThread(IN PKTHREAD Thread)
{ {
/* Raise runlevel to SYNC level and acquire the dispatcher database lock */ /* Raise runlevel to SYNC level and acquire the dispatcher database lock */
KE::RaiseRunLevel RunLevel(SYNC_LEVEL); KE::RaiseRunLevel RunLevel(SYNC_LEVEL);
KE::QueuedSpinLockGuard DispatcherGuard(DispatcherLock); KE::SystemQueuedSpinLockGuard DispatcherGuard(DispatcherLock);
/* Evaluate residency and queue the thread */ /* Evaluate residency and queue the thread */
ProcessReadyThread(Thread); ProcessReadyThread(Thread);

View File

@@ -46,7 +46,7 @@ MM::Allocator::AllocateNonPagedPoolPages(IN PFN_COUNT Pages,
{ {
/* Acquire the Non-Paged pool lock and raise runlevel to DISPATCH level */ /* Acquire the Non-Paged pool lock and raise runlevel to DISPATCH level */
KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL);
KE::QueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock); KE::SystemQueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock);
/* Iterate through the free lists */ /* Iterate through the free lists */
do do
@@ -124,10 +124,10 @@ MM::Allocator::AllocateNonPagedPoolPages(IN PFN_COUNT Pages,
/* Acquire the Non-Paged pool lock and raise runlevel to DISPATCH level */ /* Acquire the Non-Paged pool lock and raise runlevel to DISPATCH level */
KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL);
KE::QueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock); KE::SystemQueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock);
/* Acquire the PFN database lock */ /* Acquire the PFN database lock */
KE::QueuedSpinLockGuard PfnSpinLock(PfnLock); KE::SystemQueuedSpinLockGuard PfnSpinLock(PfnLock);
/* Check if there are enough available physical pages to back the allocation */ /* Check if there are enough available physical pages to back the allocation */
if(Pages >= MM::Pfn::GetAvailablePages()) if(Pages >= MM::Pfn::GetAvailablePages())
@@ -798,7 +798,7 @@ MM::Allocator::FreeNonPagedPoolPages(IN PVOID VirtualAddress,
/* Acquire the Non-Paged pool lock and raise runlevel to DISPATCH level */ /* Acquire the Non-Paged pool lock and raise runlevel to DISPATCH level */
KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL);
KE::QueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock); KE::SystemQueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock);
/* Denote allocation boundaries */ /* Denote allocation boundaries */
FirstPfn->u3.e1.ReadInProgress = 0; FirstPfn->u3.e1.ReadInProgress = 0;

View File

@@ -129,7 +129,7 @@ MM::Pfn::InitializePfnDatabase(VOID)
/* Raise runlevel and acquire the PFN lock */ /* Raise runlevel and acquire the PFN lock */
KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL);
KE::QueuedSpinLockGuard SpinLock(SystemSpaceLock); KE::SystemQueuedSpinLockGuard SpinLock(SystemSpaceLock);
/* Get the kernel initialization block */ /* Get the kernel initialization block */
InitializationBlock = KE::BootInformation::GetInitializationBlock(); InitializationBlock = KE::BootInformation::GetInitializationBlock();

View File

@@ -51,7 +51,7 @@ MM::Pfn::InitializePfnDatabase(VOID)
/* Raise runlevel and acquire PFN lock */ /* Raise runlevel and acquire PFN lock */
KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL);
KE::QueuedSpinLockGuard SpinLock(SystemSpaceLock); KE::SystemQueuedSpinLockGuard SpinLock(SystemSpaceLock);
/* Get the kernel initialization block */ /* Get the kernel initialization block */
InitializationBlock = KE::BootInformation::GetInitializationBlock(); InitializationBlock = KE::BootInformation::GetInitializationBlock();

View File

@@ -57,7 +57,7 @@ MM::KernelPool::AllocateKernelStack(OUT PVOID *Stack,
/* Acquire the PFN database lock and raise runlevel to DISPATCH_LEVEL */ /* Acquire the PFN database lock and raise runlevel to DISPATCH_LEVEL */
KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL);
KE::QueuedSpinLockGuard SpinLock(SystemSpaceLock); KE::SystemQueuedSpinLockGuard SpinLock(SystemSpaceLock);
/* Start iterating from the base of the reserved PTE block */ /* Start iterating from the base of the reserved PTE block */
PointerPte = StackPte; PointerPte = StackPte;
@@ -155,7 +155,7 @@ MM::KernelPool::FreeKernelStack(IN PVOID Stack,
/* Start a guarded code block */ /* Start a guarded code block */
{ {
/* Acquire the PFN database lock */ /* Acquire the PFN database lock */
KE::QueuedSpinLockGuard SpinLock(SystemSpaceLock); KE::SystemQueuedSpinLockGuard SpinLock(SystemSpaceLock);
/* Loop through each page of the stack that needs to be freed */ /* Loop through each page of the stack that needs to be freed */
for(Index = 0; Index < StackPages; Index++) for(Index = 0; Index < StackPages; Index++)

View File

@@ -365,7 +365,7 @@ MM::Pte::ReleaseSystemPtes(IN PMMPTE StartingPte,
/* Raise runlevel and acquire lock to protect the PTE pool */ /* Raise runlevel and acquire lock to protect the PTE pool */
KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL);
KE::QueuedSpinLockGuard SpinLock(SystemSpaceLock); KE::SystemQueuedSpinLockGuard SpinLock(SystemSpaceLock);
/* Increment the total number of available PTEs in this pool */ /* Increment the total number of available PTEs in this pool */
TotalSystemFreePtes[SystemPtePoolType] += NumberOfPtes; TotalSystemFreePtes[SystemPtePoolType] += NumberOfPtes;
@@ -478,7 +478,7 @@ MM::Pte::ReserveSystemPtes(IN PFN_COUNT NumberOfPtes,
/* Raise runlevel and acquire lock to protect the PTE pool */ /* Raise runlevel and acquire lock to protect the PTE pool */
KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL);
KE::QueuedSpinLockGuard SpinLock(SystemSpaceLock); KE::SystemQueuedSpinLockGuard SpinLock(SystemSpaceLock);
/* Find a free PTE cluster large enough for the request */ /* Find a free PTE cluster large enough for the request */
if(!FindFreeCluster(NumberOfPtes, SystemPtePoolType, &NextPte, &PreviousPte)) if(!FindFreeCluster(NumberOfPtes, SystemPtePoolType, &NextPte, &PreviousPte))