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

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.
This commit is contained in:
kleines Filmröllchen 2022-08-18 21:46:28 +02:00 committed by Brian Gianforcaro
parent 4809dc8ec2
commit 4314c25cf2
59 changed files with 87 additions and 78 deletions

View file

@ -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;

View file

@ -78,7 +78,7 @@ private:
void uncommit_one();
private:
Spinlock m_lock;
Spinlock m_lock { LockRank::None };
CommittedPhysicalPageSet m_committed_pages;
};

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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 {};

View file

@ -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;
};

View file

@ -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;