From de4ba1f39b2c6db213bc499abcb5060ca05300bb Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 13 Jul 2021 23:17:02 +0200 Subject: Kernel: Remove some friendships and make some classes non-copy/moveable --- Kernel/VM/MemoryManager.h | 3 --- Kernel/VM/PhysicalPage.h | 5 +++-- Kernel/VM/PhysicalRegion.h | 5 ++++- Kernel/VM/PhysicalZone.h | 5 ++++- 4 files changed, 11 insertions(+), 7 deletions(-) (limited to 'Kernel/VM') diff --git a/Kernel/VM/MemoryManager.h b/Kernel/VM/MemoryManager.h index d52f665aae..52615a9e90 100644 --- a/Kernel/VM/MemoryManager.h +++ b/Kernel/VM/MemoryManager.h @@ -105,9 +105,6 @@ extern RecursiveSpinLock s_mm_lock; class MemoryManager { AK_MAKE_ETERNAL - friend class PageDirectory; - friend class PhysicalPage; - friend class PhysicalRegion; friend class AnonymousVMObject; friend class Region; friend class VMObject; diff --git a/Kernel/VM/PhysicalPage.h b/Kernel/VM/PhysicalPage.h index 2b3cd4eb51..f91277070a 100644 --- a/Kernel/VM/PhysicalPage.h +++ b/Kernel/VM/PhysicalPage.h @@ -12,9 +12,10 @@ namespace Kernel { class PhysicalPage { + AK_MAKE_NONCOPYABLE(PhysicalPage); + AK_MAKE_NONMOVABLE(PhysicalPage); + friend class MemoryManager; - friend class PageDirectory; - friend class VMObject; public: PhysicalAddress paddr() const; diff --git a/Kernel/VM/PhysicalRegion.h b/Kernel/VM/PhysicalRegion.h index 4ec98bb487..769ca35f30 100644 --- a/Kernel/VM/PhysicalRegion.h +++ b/Kernel/VM/PhysicalRegion.h @@ -13,7 +13,10 @@ namespace Kernel { class PhysicalRegion { - AK_MAKE_ETERNAL + AK_MAKE_ETERNAL; + AK_MAKE_NONCOPYABLE(PhysicalRegion); + AK_MAKE_NONMOVABLE(PhysicalRegion); + public: static OwnPtr try_create(PhysicalAddress lower, PhysicalAddress upper) { diff --git a/Kernel/VM/PhysicalZone.h b/Kernel/VM/PhysicalZone.h index 6b6a980ba8..bd3bba924e 100644 --- a/Kernel/VM/PhysicalZone.h +++ b/Kernel/VM/PhysicalZone.h @@ -17,7 +17,10 @@ namespace Kernel { // The allocator uses a buddy block scheme internally. class PhysicalZone { - AK_MAKE_ETERNAL + AK_MAKE_ETERNAL; + AK_MAKE_NONCOPYABLE(PhysicalZone); + AK_MAKE_NONMOVABLE(PhysicalZone); + public: static constexpr size_t ZONE_CHUNK_SIZE = PAGE_SIZE / 2; using ChunkIndex = i16; -- cgit v1.2.3