summaryrefslogtreecommitdiff
path: root/na/mm/slab.cc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-07-10 11:24:56 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-07-10 11:24:56 +0800
commit1767d390fbf3d0c65389de46caf0b6d43ef3b6ad (patch)
tree0f5e01cd7c7a05abb6b1c7472d7f00f49caf02cc /na/mm/slab.cc
parent63dc025705f6533b91fb1a7d26e6ed864efd9900 (diff)
downloadlume-1767d390fbf3d0c65389de46caf0b6d43ef3b6ad.tar.gz
lume-1767d390fbf3d0c65389de46caf0b6d43ef3b6ad.tar.xz
feat: establish bootable new architecture checkpoint
Replace the compressed boot path with a relocatable higher-half RISC-V entry, expand memory and SMP support, and add the driver, TTY, VFS, exec, signal, syscall, initramfs, and self-test infrastructure needed for a bootable kernel checkpoint.
Diffstat (limited to 'na/mm/slab.cc')
-rw-r--r--na/mm/slab.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/na/mm/slab.cc b/na/mm/slab.cc
index e9b06cc..43d8c4a 100644
--- a/na/mm/slab.cc
+++ b/na/mm/slab.cc
@@ -79,7 +79,7 @@ Page* KmemCache::new_slab()
if (!page)
return nullptr;
- page->state = PageState::Slab;
+ page->type = PageType::Slab;
page->slab.cache = this;
page->slab.obj_count = 0;
@@ -197,7 +197,7 @@ void KmemCache::free(void* obj)
uint64 page_pa = obj_pa & ~(kPageSize - 1);
Page* page = pa_to_page(phys_addr(page_pa));
- if (page->state != PageState::Slab || page->slab.cache != this)
+ if (page->type != PageType::Slab || page->slab.cache != this)
kernel_panic("slab free: object does not belong to this cache");
bool was_on = arch::cpu::intr_enabled();
@@ -274,12 +274,12 @@ void kfree(void* ptr)
uint64 page_pa = pa & ~(kPageSize - 1);
Page* page = pa_to_page(phys_addr(page_pa));
- if (page->state == PageState::Slab) {
+ if (page->type == PageType::Slab) {
KmemCache* cache = page->slab.cache;
if (!cache)
kernel_panic("kfree: slab page has null cache");
cache->free(ptr);
- } else if (page->state == PageState::Allocated) {
+ } else if (page->type == PageType::Allocated) {
/* Large allocation — return directly to PMM */
pmm_free_pages(page, page->order);
} else {