diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-20 14:47:08 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-20 14:47:08 +0100 |
| commit | 4ba02280f19b8a2beb1ad8445be7df6b7f9e1805 (patch) | |
| tree | 4928e93b6463dcce6e0d74120882a6ec572bae5c /Private/KernelKit/UserHeap.hpp | |
| parent | 055a896406af227e03708fa20a728259cace704a (diff) | |
kernel: Reworking kernel to support virtual memory.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/KernelKit/UserHeap.hpp')
| -rw-r--r-- | Private/KernelKit/UserHeap.hpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Private/KernelKit/UserHeap.hpp b/Private/KernelKit/UserHeap.hpp new file mode 100644 index 00000000..d66eb356 --- /dev/null +++ b/Private/KernelKit/UserHeap.hpp @@ -0,0 +1,40 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include <NewKit/Array.hpp> +#include <NewKit/ArrayList.hpp> +#include <NewKit/ErrorOr.hpp> +#include <NewKit/PageManager.hpp> +#include <NewKit/Ref.hpp> +#include <NewKit/Pmm.hpp> + +/// @version 5/11/23 +/// @file UserHeap.hpp +/// @brief memory heap for user programs. + +#define kUserHeapMaxSz (4096) +#define kUserHeapMag (0x5500A1) + +namespace HCore { +typedef enum { + kUserHeapHypervisor = 0x2, + kUserHeapShared = 0x4, + kUserHeapUser = 0x6, + kUserHeapRw = 0x8, +} kUserHeapFlags; + +/// @brief Allocate a process heap, no zero out is done here. +/// @param flags +/// @return The process's heap. +VoidPtr rt_new_heap(Int32 flags); + +/// @brief Frees the process heap. +/// @param pointer The process heap pointer. +/// @return +Int32 rt_free_heap(voidPtr pointer); +} // namespace HCore |
