From fb4512afbec76e91cfaf8725d2d39a11c3969943 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Wed, 13 May 2026 16:29:29 +0800 Subject: feat: update PMM self-test to use page terminology and improve clarity --- na/test/test_slab.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'na/test/test_slab.cc') diff --git a/na/test/test_slab.cc b/na/test/test_slab.cc index e3ac72d..2ba1a5d 100644 --- a/na/test/test_slab.cc +++ b/na/test/test_slab.cc @@ -174,7 +174,7 @@ void selftest_slab() } st_pass(); - st_begin("slab: empty page reclamation (verifiable by frame availability)"); + st_begin("slab: empty page reclamation (verifiable by page availability)"); { // Allocate 128-byte objects until we hit the start of a completely new page. void* base_ptr = nullptr; @@ -201,18 +201,18 @@ void selftest_slab() // At this point, we completely own all 32 objects of this slab page. uint64 page_pa = va_to_pa(virt_addr(reinterpret_cast(base_ptr))).raw; - Frame* f = pa_to_frame(phys_addr(page_pa)); + Page* page = pa_to_page(phys_addr(page_pa)); - ST_ASSERT(f->state == FrameState::Slab); - ST_ASSERT(f->slab.obj_count == 32); + ST_ASSERT(page->state == PageState::Slab); + ST_ASSERT(page->slab.obj_count == 32); // Free all items in this isolated slab page for (int i = 0; i < 32; i++) { kfree(ptrs[i]); } - // The frame MUST have been returned to the PMM (either global Free or Per-CPU Cached). - ST_ASSERT(f->state == FrameState::Free || f->state == FrameState::PcpCached); + // The page MUST have been returned to the PMM (either global Free or Per-CPU Cached). + ST_ASSERT(page->state == PageState::Free || page->state == PageState::PcpCached); // Clean up the drain array for (int i = 0; i < drain_count; i++) { -- cgit v1.2.3