mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:38:10 +00:00
Kernel: Convert the PhysicalPage bool parameter to an enum
This commit is contained in:
parent
399be9bcc3
commit
d879709ec7
6 changed files with 18 additions and 13 deletions
|
@ -11,6 +11,11 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
enum class MayReturnToFreeList : bool {
|
||||
No,
|
||||
Yes
|
||||
};
|
||||
|
||||
class PhysicalPage {
|
||||
AK_MAKE_NONCOPYABLE(PhysicalPage);
|
||||
AK_MAKE_NONMOVABLE(PhysicalPage);
|
||||
|
@ -31,7 +36,7 @@ public:
|
|||
free_this();
|
||||
}
|
||||
|
||||
static NonnullRefPtr<PhysicalPage> create(PhysicalAddress, bool may_return_to_freelist = true);
|
||||
static NonnullRefPtr<PhysicalPage> create(PhysicalAddress, MayReturnToFreeList may_return_to_freelist = MayReturnToFreeList::Yes);
|
||||
|
||||
u32 ref_count() const { return m_ref_count.load(AK::memory_order_consume); }
|
||||
|
||||
|
@ -39,13 +44,13 @@ public:
|
|||
bool is_lazy_committed_page() const;
|
||||
|
||||
private:
|
||||
explicit PhysicalPage(bool may_return_to_freelist = true);
|
||||
explicit PhysicalPage(MayReturnToFreeList may_return_to_freelist);
|
||||
~PhysicalPage() = default;
|
||||
|
||||
void free_this();
|
||||
|
||||
Atomic<u32> m_ref_count { 1 };
|
||||
bool m_may_return_to_freelist { true };
|
||||
MayReturnToFreeList m_may_return_to_freelist { MayReturnToFreeList::Yes };
|
||||
};
|
||||
|
||||
struct PhysicalPageEntry {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue