summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal <amlal@el-mahrouss-logic.com>2024-09-13 11:05:27 +0200
committerAmlal <amlal@el-mahrouss-logic.com>2024-09-13 11:05:27 +0200
commit3abbf8f6676a415aaca873b3f9d04929d6fe6ce7 (patch)
tree249b4c6feaad888a78df04672ec25e04c45aa57b
parent69d628dd02df81e64dfd9a2e730a44c5c5a0e5a8 (diff)
ZKA:HalBMPMGr.cxx: Fixed bit map allocator.
CoreCG:WindowRenderer.hxx: Fixed function signature. Next step is to add back the page mapping function. Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
-rw-r--r--dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx10
-rw-r--r--dev/ZKA/Modules/CoreCG/WindowRenderer.hxx2
2 files changed, 6 insertions, 6 deletions
diff --git a/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx b/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx
index bdca5c9f..ce6bd42c 100644
--- a/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx
+++ b/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx
@@ -73,11 +73,11 @@ namespace Kernel
/// @return The new address which was found.
auto FindBitMap(VoidPtr base_ptr, SizeT size, Bool rw, Bool user) -> VoidPtr
{
- auto base = reinterpret_cast<UIntPtr>(base_ptr);
+ VoidPtr base = base_ptr + kPageSize;
- while (base_ptr && size)
+ while (base && size)
{
- UIntPtr* ptr_bit_set = reinterpret_cast<UIntPtr*>(base_ptr);
+ UIntPtr* ptr_bit_set = reinterpret_cast<UIntPtr*>(base);
if (ptr_bit_set[cBitMapMagIdx] == cBitMpMagic)
{
@@ -107,9 +107,9 @@ namespace Kernel
return (VoidPtr)ptr_bit_set;
}
- base_ptr = reinterpret_cast<VoidPtr>(reinterpret_cast<UIntPtr>(base_ptr) + (ptr_bit_set[0] != cBitMpMagic ? size : ptr_bit_set[1]));
+ base = reinterpret_cast<VoidPtr>(reinterpret_cast<UIntPtr>(base_ptr) + (ptr_bit_set[0] != cBitMpMagic ? size : ptr_bit_set[1]));
- if ((UIntPtr)base_ptr < ((base) + kHandoverHeader->f_BitMapSize))
+ if ((UIntPtr)base_ptr < (reinterpret_cast<UIntPtr>(base) + kHandoverHeader->f_BitMapSize))
return nullptr;
}
diff --git a/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx b/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx
index 8dab7925..775b80c0 100644
--- a/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx
+++ b/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx
@@ -54,7 +54,7 @@ namespace CG
typedef struct UI_WINDOW_STRUCT UI_WINDOW_STRUCT;
/// \brief Draw background (either image or solid color)
- inline Void CGDrawBackground(UInt32* raw_bmp, SizeT width, SizeT height) noexcept
+ inline Void CGDrawBackground(UInt32* raw_bmp = nullptr, SizeT width = 0, SizeT height = 0) noexcept
{
CGInit();