From 60a7d7409c91216a11c13abee53066b260edb17a Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Wed, 13 May 2026 15:48:53 +0800 Subject: feat: update slab allocator to use Page descriptors instead of Frame --- na/include/lume/slab.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 na/include/lume/slab.h (limited to 'na/include') diff --git a/na/include/lume/slab.h b/na/include/lume/slab.h new file mode 100644 index 0000000..4ebade1 --- /dev/null +++ b/na/include/lume/slab.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* Copyright (C) 2026 Richard Qin */ + +#pragma once + +/* + * SLUB public API + * + * This header exposes the allocator entry points to the rest of the kernel. + * Implementation details stay in mm/slab.h and mm/slab.cc. + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initialize global slab caches. */ +void slab_init(); + +/* Allocate/free kernel memory. */ +void* kmalloc(uint32 size); +void kfree(void* ptr); + +#ifdef __cplusplus +} +#endif -- cgit v1.2.3