summaryrefslogtreecommitdiff
path: root/Kernel/VM
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-13 23:17:02 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-13 23:19:00 +0200
commitde4ba1f39b2c6db213bc499abcb5060ca05300bb (patch)
tree2959074b8577e722dc7d7d9d1e86ba12f21e2fac /Kernel/VM
parent424afdd72b9546872a2e72a97f32f9727f388c83 (diff)
downloadserenity-de4ba1f39b2c6db213bc499abcb5060ca05300bb.zip
Kernel: Remove some friendships and make some classes non-copy/moveable
Diffstat (limited to 'Kernel/VM')
-rw-r--r--Kernel/VM/MemoryManager.h3
-rw-r--r--Kernel/VM/PhysicalPage.h5
-rw-r--r--Kernel/VM/PhysicalRegion.h5
-rw-r--r--Kernel/VM/PhysicalZone.h5
4 files changed, 11 insertions, 7 deletions
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<PhysicalRegion> 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;