summaryrefslogtreecommitdiffhomepage
path: root/Kernel/Sources/KernelHeap.cxx
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-06-29 23:52:17 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-06-29 23:52:17 +0200
commit397b03fd02a851abc70e750daf340966914e4239 (patch)
tree20c597eccfe7c390431938a58cdfacff9c68400a /Kernel/Sources/KernelHeap.cxx
parent0558e8040c0d9628858ddd85ce573b9c80941a1f (diff)
New err_ kernel API (with err_bug_check)
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/Sources/KernelHeap.cxx')
-rw-r--r--Kernel/Sources/KernelHeap.cxx38
1 files changed, 19 insertions, 19 deletions
diff --git a/Kernel/Sources/KernelHeap.cxx b/Kernel/Sources/KernelHeap.cxx
index 875e00fb..770e11da 100644
--- a/Kernel/Sources/KernelHeap.cxx
+++ b/Kernel/Sources/KernelHeap.cxx
@@ -87,11 +87,11 @@ namespace NewOS
if (((IntPtr)heapPtr - kBadPtr) < 0)
return -kErrorInternal;
- Detail::HeapInformationBlockPtr virtualAddress =
+ Detail::HeapInformationBlockPtr heapInfoBlk =
reinterpret_cast<Detail::HeapInformationBlockPtr>(
(UIntPtr)heapPtr - sizeof(Detail::HeapInformationBlock));
- virtualAddress->fPagePtr = 1;
+ heapInfoBlk->fPagePtr = 1;
return 0;
}
@@ -108,34 +108,34 @@ namespace NewOS
if (((IntPtr)heapPtr - kBadPtr) < 0)
return -kErrorInternal;
- Detail::HeapInformationBlockPtr virtualAddress =
+ Detail::HeapInformationBlockPtr heapInfoBlk =
reinterpret_cast<Detail::HeapInformationBlockPtr>(
(UIntPtr)heapPtr - sizeof(Detail::HeapInformationBlock));
- if (virtualAddress && virtualAddress->fMagic == kKernelHeapMagic)
+ if (heapInfoBlk && heapInfoBlk->fMagic == kKernelHeapMagic)
{
- if (!virtualAddress->fPresent)
+ if (!heapInfoBlk->fPresent)
{
return -kErrorHeapNotPresent;
}
- if (virtualAddress->fCRC32 != 0)
+ if (heapInfoBlk->fCRC32 != 0)
{
- if (virtualAddress->fCRC32 !=
- ke_calculate_crc32((Char*)virtualAddress->fTargetPtr,
- virtualAddress->fTargetPtrSize))
+ if (heapInfoBlk->fCRC32 !=
+ ke_calculate_crc32((Char*)heapInfoBlk->fTargetPtr,
+ heapInfoBlk->fTargetPtrSize))
{
ke_stop(RUNTIME_CHECK_POINTER);
}
}
- virtualAddress->fTargetPtrSize = 0UL;
- virtualAddress->fPresent = false;
- virtualAddress->fTargetPtr = 0;
- virtualAddress->fCRC32 = 0;
- virtualAddress->fMagic = 0;
+ heapInfoBlk->fTargetPtrSize = 0UL;
+ heapInfoBlk->fPresent = false;
+ heapInfoBlk->fTargetPtr = 0;
+ heapInfoBlk->fCRC32 = 0;
+ heapInfoBlk->fMagic = 0;
- PTEWrapper pageWrapper(false, false, false, (UIntPtr)virtualAddress);
+ PTEWrapper pageWrapper(false, false, false, reinterpret_cast<UIntPtr>(heapInfoBlk));
Ref<PTEWrapper*> pteAddress{&pageWrapper};
kHeapPageManager.Free(pteAddress);
@@ -177,14 +177,14 @@ namespace NewOS
{
if (heapPtr)
{
- Detail::HeapInformationBlockPtr virtualAddress =
+ Detail::HeapInformationBlockPtr heapInfoBlk =
reinterpret_cast<Detail::HeapInformationBlockPtr>(
(UIntPtr)heapPtr - sizeof(Detail::HeapInformationBlock));
- if (virtualAddress->fPresent && kKernelHeapMagic == virtualAddress->fMagic)
+ if (heapInfoBlk->fPresent && kKernelHeapMagic == heapInfoBlk->fMagic)
{
- virtualAddress->fCRC32 =
- ke_calculate_crc32((Char*)virtualAddress->fTargetPtr, virtualAddress->fTargetPtrSize);
+ heapInfoBlk->fCRC32 =
+ ke_calculate_crc32((Char*)heapInfoBlk->fTargetPtr, heapInfoBlk->fTargetPtrSize);
return true;
}