From 1767d390fbf3d0c65389de46caf0b6d43ef3b6ad Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Fri, 10 Jul 2026 11:24:56 +0800 Subject: 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. --- na/mm/slab.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'na/mm/slab.cc') 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 { -- cgit v1.2.3