summaryrefslogtreecommitdiff
path: root/Kernel/Memory
diff options
context:
space:
mode:
authorkleines Filmröllchen <filmroellchen@serenityos.org>2022-08-18 21:46:28 +0200
committerBrian Gianforcaro <b.gianfo@gmail.com>2022-08-19 20:26:47 -0700
commit4314c25cf2a60f7692821b10a6e759d24ae1a1b6 (patch)
tree8b6e9c7a58afdca56b7ae02d324433884b8687da /Kernel/Memory
parent4809dc8ec28b8573b250a112b9a7dae4cde10e86 (diff)
downloadserenity-4314c25cf2a60f7692821b10a6e759d24ae1a1b6.zip
Kernel: Require lock rank for Spinlock construction
All users which relied on the default constructor use a None lock rank for now. This will make it easier to in the future remove LockRank and actually annotate the ranks by searching for None.
Diffstat (limited to 'Kernel/Memory')
-rw-r--r--Kernel/Memory/AddressSpace.h2
-rw-r--r--Kernel/Memory/AnonymousVMObject.h2
-rw-r--r--Kernel/Memory/MemoryManager.h2
-rw-r--r--Kernel/Memory/PageDirectory.h2
-rw-r--r--Kernel/Memory/RegionTree.h3
-rw-r--r--Kernel/Memory/RingBuffer.h2
-rw-r--r--Kernel/Memory/SharedFramebufferVMObject.h2
-rw-r--r--Kernel/Memory/VMObject.h2
8 files changed, 9 insertions, 8 deletions
diff --git a/Kernel/Memory/AddressSpace.h b/Kernel/Memory/AddressSpace.h
index f32e260c8b..12b2212659 100644
--- a/Kernel/Memory/AddressSpace.h
+++ b/Kernel/Memory/AddressSpace.h
@@ -67,7 +67,7 @@ public:
private:
AddressSpace(NonnullRefPtr<PageDirectory>, VirtualRange total_range);
- mutable RecursiveSpinlock m_lock;
+ mutable RecursiveSpinlock m_lock { LockRank::None };
RefPtr<PageDirectory> m_page_directory;
diff --git a/Kernel/Memory/AnonymousVMObject.h b/Kernel/Memory/AnonymousVMObject.h
index 562b8caa76..5733235ce9 100644
--- a/Kernel/Memory/AnonymousVMObject.h
+++ b/Kernel/Memory/AnonymousVMObject.h
@@ -78,7 +78,7 @@ private:
void uncommit_one();
private:
- Spinlock m_lock;
+ Spinlock m_lock { LockRank::None };
CommittedPhysicalPageSet m_committed_pages;
};
diff --git a/Kernel/Memory/MemoryManager.h b/Kernel/Memory/MemoryManager.h
index 4828f9b159..010fae183b 100644
--- a/Kernel/Memory/MemoryManager.h
+++ b/Kernel/Memory/MemoryManager.h
@@ -89,7 +89,7 @@ struct PhysicalMemoryRange {
struct MemoryManagerData {
static ProcessorSpecificDataID processor_specific_data_id() { return ProcessorSpecificDataID::MemoryManager; }
- Spinlock m_quickmap_in_use;
+ Spinlock m_quickmap_in_use { LockRank::None };
u32 m_quickmap_prev_flags;
PhysicalAddress m_last_quickmap_pd;
diff --git a/Kernel/Memory/PageDirectory.h b/Kernel/Memory/PageDirectory.h
index 8aecc3c049..842519dd0f 100644
--- a/Kernel/Memory/PageDirectory.h
+++ b/Kernel/Memory/PageDirectory.h
@@ -72,7 +72,7 @@ private:
#else
RefPtr<PhysicalPage> m_directory_pages[4];
#endif
- RecursiveSpinlock m_lock;
+ RecursiveSpinlock m_lock { LockRank::None };
};
void activate_kernel_page_directory(PageDirectory const& pgd);
diff --git a/Kernel/Memory/RegionTree.h b/Kernel/Memory/RegionTree.h
index 93f6047bfb..aa5226d448 100644
--- a/Kernel/Memory/RegionTree.h
+++ b/Kernel/Memory/RegionTree.h
@@ -58,7 +58,8 @@ private:
ErrorOr<VirtualRange> allocate_range_specific(VirtualAddress base, size_t size);
ErrorOr<VirtualRange> allocate_range_randomized(size_t size, size_t alignment = PAGE_SIZE);
- RecursiveSpinlock mutable m_lock;
+ // FIXME: We need a Region rank, but we don't know where to put it.
+ RecursiveSpinlock mutable m_lock { LockRank::None };
IntrusiveRedBlackTree<&Region::m_tree_node> m_regions;
VirtualRange const m_total_range;
diff --git a/Kernel/Memory/RingBuffer.h b/Kernel/Memory/RingBuffer.h
index eb97c53253..2ea0811e3a 100644
--- a/Kernel/Memory/RingBuffer.h
+++ b/Kernel/Memory/RingBuffer.h
@@ -32,7 +32,7 @@ private:
RingBuffer(NonnullOwnPtr<Memory::Region> region, size_t capacity);
NonnullOwnPtr<Memory::Region> m_region;
- Spinlock m_lock;
+ Spinlock m_lock { LockRank::None };
size_t m_start_of_used {};
size_t m_num_used_bytes {};
size_t m_capacity_in_bytes {};
diff --git a/Kernel/Memory/SharedFramebufferVMObject.h b/Kernel/Memory/SharedFramebufferVMObject.h
index 90e195aa34..5fb43b1960 100644
--- a/Kernel/Memory/SharedFramebufferVMObject.h
+++ b/Kernel/Memory/SharedFramebufferVMObject.h
@@ -87,7 +87,7 @@ private:
RefPtr<FakeWritesFramebufferVMObject> m_fake_writes_framebuffer_vmobject;
RefPtr<RealWritesFramebufferVMObject> m_real_writes_framebuffer_vmobject;
bool m_writes_are_faked { false };
- mutable RecursiveSpinlock m_writes_state_lock;
+ mutable RecursiveSpinlock m_writes_state_lock { LockRank::None };
CommittedPhysicalPageSet m_committed_pages;
};
diff --git a/Kernel/Memory/VMObject.h b/Kernel/Memory/VMObject.h
index 557c107d54..186e2998f6 100644
--- a/Kernel/Memory/VMObject.h
+++ b/Kernel/Memory/VMObject.h
@@ -65,7 +65,7 @@ protected:
IntrusiveListNode<VMObject> m_list_node;
FixedArray<RefPtr<PhysicalPage>> m_physical_pages;
- mutable RecursiveSpinlock m_lock;
+ mutable RecursiveSpinlock m_lock { LockRank::None };
private:
VMObject& operator=(VMObject const&) = delete;