summaryrefslogtreecommitdiff
path: root/na/test/test_slab.cc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-05-13 16:29:29 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-05-13 16:29:29 +0800
commitfb4512afbec76e91cfaf8725d2d39a11c3969943 (patch)
tree1b9a72a864ea3c3b3544026eb86f2b8e66973ed5 /na/test/test_slab.cc
parent25fa7f331d6772f5b2cfee50c581db1c5aa71a1e (diff)
downloadlume-fb4512afbec76e91cfaf8725d2d39a11c3969943.tar.gz
lume-fb4512afbec76e91cfaf8725d2d39a11c3969943.tar.xz
feat: update PMM self-test to use page terminology and improve clarity
Diffstat (limited to 'na/test/test_slab.cc')
-rw-r--r--na/test/test_slab.cc12
1 files changed, 6 insertions, 6 deletions
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<uint64>(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++) {