NeKernel dev
Loading...
Searching...
No Matches
HeapMgr.h
Go to the documentation of this file.
1/* ========================================
2
3 Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
4
5======================================== */
6
7#ifndef INC_KERNEL_HEAP_H
8#define INC_KERNEL_HEAP_H
9
13
14#include <KernelKit/KPC.h>
15#include <NeKit/KernelPanic.h>
16#include <hint/CompilerHint.h>
17
18namespace Kernel {
22Int32 mm_free_ptr(VoidPtr heap_ptr);
23
28
34VoidPtr mm_alloc_ptr(SizeT sz, Bool wr, Bool user, SizeT pad_amount = 0);
35
40
44Int32 mm_make_page(VoidPtr heap_ptr);
45
49Int32 mm_set_ptr_flags(VoidPtr heap_ptr, UInt64 flags);
50
54} // namespace Kernel
55
56#include <KernelKit/HeapMgr.inl>
57
58#endif // !INC_KERNEL_HEAP_H
Kernel Procedure Code.
UPS inline definitions.
Definition Device.h:12
Boolean mm_protect_ptr(VoidPtr heap_ptr)
Protect the heap with a CRC value.
Definition HeapMgr.cc:243
Int32 mm_make_page(VoidPtr heap_ptr)
Makes a Kernel page.
Definition HeapMgr.cc:138
Int32 mm_set_ptr_flags(VoidPtr heap_ptr, UInt64 flags)
Overwrites and set the flags of a heap header.
Definition HeapMgr.cc:158
__SIZE_TYPE__ SizeT
Definition Config.h:60
Int32 mm_free_ptr(VoidPtr heap_ptr)
Declare pointer as free.
Definition HeapMgr.cc:187
Boolean mm_is_valid_ptr(VoidPtr heap_ptr)
Check if pointer is a valid Kernel pointer.
Definition HeapMgr.cc:228
void * VoidPtr
Definition Config.h:33
__INT32_TYPE__ Int32
Definition Config.h:38
UInt64 mm_get_ptr_flags(VoidPtr heap_ptr)
Gets the flags of a heap header.
Definition HeapMgr.cc:174
VoidPtr mm_alloc_ptr(SizeT sz, Bool wr, Bool user, SizeT pad_amount=0)
Allocate chunk of memory.
Definition HeapMgr.cc:101
bool Boolean
Definition Config.h:49
__UINT64_TYPE__ UInt64
Definition Config.h:48
bool Bool
Definition Config.h:50