diff --git a/xtoskrnl/includes/ke/guard.hh b/xtoskrnl/includes/ke/guard.hh index f6bb041..186f963 100644 --- a/xtoskrnl/includes/ke/guard.hh +++ b/xtoskrnl/includes/ke/guard.hh @@ -12,17 +12,18 @@ #include #include + /* Kernel Library */ namespace KE { - class QueuedSpinLockGuard + class SystemQueuedSpinLockGuard { private: KSPIN_LOCK_QUEUE_LEVEL QueuedLockLevel; BOOLEAN Owned; public: - QueuedSpinLockGuard(IN OUT KSPIN_LOCK_QUEUE_LEVEL LockLevel, + SystemQueuedSpinLockGuard(IN OUT KSPIN_LOCK_QUEUE_LEVEL LockLevel, IN BOOLEAN Acquire = TRUE) { QueuedLockLevel = LockLevel; @@ -33,7 +34,7 @@ namespace KE } } - ~QueuedSpinLockGuard() + ~SystemQueuedSpinLockGuard() { if(Owned) { @@ -41,8 +42,8 @@ namespace KE } } - QueuedSpinLockGuard(const QueuedSpinLockGuard&) = delete; - QueuedSpinLockGuard& operator=(const QueuedSpinLockGuard&) = delete; + SystemQueuedSpinLockGuard(const SystemQueuedSpinLockGuard&) = delete; + SystemQueuedSpinLockGuard& operator=(const SystemQueuedSpinLockGuard&) = delete; }; class SpinLockGuard diff --git a/xtoskrnl/ke/kthread.cc b/xtoskrnl/ke/kthread.cc index 7fb4aab..dc373ab 100644 --- a/xtoskrnl/ke/kthread.cc +++ b/xtoskrnl/ke/kthread.cc @@ -57,7 +57,7 @@ KE::KThread::AttachThread(IN OUT PKTHREAD Thread) Thread->UserIdealProcessor = (UCHAR)IdealProcessor; /* Acquire the dispatcher database lock */ - KE::QueuedSpinLockGuard DispatcherGuard(DispatcherLock); + KE::SystemQueuedSpinLockGuard DispatcherGuard(DispatcherLock); /* Insert the thread into the process's active thread list */ RTL::LinkedList::InsertTailList(&Process->ThreadListHead, &Thread->ThreadListEntry); diff --git a/xtoskrnl/ke/schedule.cc b/xtoskrnl/ke/schedule.cc index 320acad..5ebf8ad 100644 --- a/xtoskrnl/ke/schedule.cc +++ b/xtoskrnl/ke/schedule.cc @@ -125,7 +125,7 @@ KE::Scheduler::ReadyThread(IN PKTHREAD Thread) { /* Raise runlevel to SYNC level and acquire the dispatcher database lock */ KE::RaiseRunLevel RunLevel(SYNC_LEVEL); - KE::QueuedSpinLockGuard DispatcherGuard(DispatcherLock); + KE::SystemQueuedSpinLockGuard DispatcherGuard(DispatcherLock); /* Evaluate residency and queue the thread */ ProcessReadyThread(Thread); diff --git a/xtoskrnl/mm/alloc.cc b/xtoskrnl/mm/alloc.cc index 44b26fe..d818cf2 100644 --- a/xtoskrnl/mm/alloc.cc +++ b/xtoskrnl/mm/alloc.cc @@ -46,7 +46,7 @@ MM::Allocator::AllocateNonPagedPoolPages(IN PFN_COUNT Pages, { /* Acquire the Non-Paged pool lock and raise runlevel to DISPATCH level */ KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); - KE::QueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock); + KE::SystemQueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock); /* Iterate through the free lists */ do @@ -124,10 +124,10 @@ MM::Allocator::AllocateNonPagedPoolPages(IN PFN_COUNT Pages, /* Acquire the Non-Paged pool lock and raise runlevel to DISPATCH level */ KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); - KE::QueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock); + KE::SystemQueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock); /* 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 */ 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 */ KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); - KE::QueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock); + KE::SystemQueuedSpinLockGuard NonPagedPoolSpinLock(NonPagedPoolLock); /* Denote allocation boundaries */ FirstPfn->u3.e1.ReadInProgress = 0; diff --git a/xtoskrnl/mm/amd64/pfn.cc b/xtoskrnl/mm/amd64/pfn.cc index 130d849..eaa4d5d 100644 --- a/xtoskrnl/mm/amd64/pfn.cc +++ b/xtoskrnl/mm/amd64/pfn.cc @@ -129,7 +129,7 @@ MM::Pfn::InitializePfnDatabase(VOID) /* Raise runlevel and acquire the PFN lock */ KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); - KE::QueuedSpinLockGuard SpinLock(SystemSpaceLock); + KE::SystemQueuedSpinLockGuard SpinLock(SystemSpaceLock); /* Get the kernel initialization block */ InitializationBlock = KE::BootInformation::GetInitializationBlock(); diff --git a/xtoskrnl/mm/i686/pfn.cc b/xtoskrnl/mm/i686/pfn.cc index 34d5ae2..cebe5e8 100644 --- a/xtoskrnl/mm/i686/pfn.cc +++ b/xtoskrnl/mm/i686/pfn.cc @@ -51,7 +51,7 @@ MM::Pfn::InitializePfnDatabase(VOID) /* Raise runlevel and acquire PFN lock */ KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); - KE::QueuedSpinLockGuard SpinLock(SystemSpaceLock); + KE::SystemQueuedSpinLockGuard SpinLock(SystemSpaceLock); /* Get the kernel initialization block */ InitializationBlock = KE::BootInformation::GetInitializationBlock(); diff --git a/xtoskrnl/mm/kpool.cc b/xtoskrnl/mm/kpool.cc index 0c49dfd..e083063 100644 --- a/xtoskrnl/mm/kpool.cc +++ b/xtoskrnl/mm/kpool.cc @@ -57,7 +57,7 @@ MM::KernelPool::AllocateKernelStack(OUT PVOID *Stack, /* Acquire the PFN database lock and raise runlevel to 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 */ PointerPte = StackPte; @@ -155,7 +155,7 @@ MM::KernelPool::FreeKernelStack(IN PVOID Stack, /* Start a guarded code block */ { /* 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 */ for(Index = 0; Index < StackPages; Index++) diff --git a/xtoskrnl/mm/pte.cc b/xtoskrnl/mm/pte.cc index 15e5c13..48b196c 100644 --- a/xtoskrnl/mm/pte.cc +++ b/xtoskrnl/mm/pte.cc @@ -365,7 +365,7 @@ MM::Pte::ReleaseSystemPtes(IN PMMPTE StartingPte, /* Raise runlevel and acquire lock to protect the PTE pool */ KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); - KE::QueuedSpinLockGuard SpinLock(SystemSpaceLock); + KE::SystemQueuedSpinLockGuard SpinLock(SystemSpaceLock); /* Increment the total number of available PTEs in this pool */ TotalSystemFreePtes[SystemPtePoolType] += NumberOfPtes; @@ -478,7 +478,7 @@ MM::Pte::ReserveSystemPtes(IN PFN_COUNT NumberOfPtes, /* Raise runlevel and acquire lock to protect the PTE pool */ KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL); - KE::QueuedSpinLockGuard SpinLock(SystemSpaceLock); + KE::SystemQueuedSpinLockGuard SpinLock(SystemSpaceLock); /* Find a free PTE cluster large enough for the request */ if(!FindFreeCluster(NumberOfPtes, SystemPtePoolType, &NextPte, &PreviousPte))