summaryrefslogtreecommitdiffhomepage
path: root/src/kernel/KernelKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-25 16:55:35 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-03-25 16:55:35 +0100
commit5bea01d881c3335ed6901f17ba9b8fff860ef356 (patch)
tree52316d5d25b651fc830052a079a948dfa939cffa /src/kernel/KernelKit
parent3f4dff513d9393009e7067237646f11b1fc527c4 (diff)
[CHORE] Kernel: Hardening HeapMgr and fix warnings in Semaphore API.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/kernel/KernelKit')
-rw-r--r--src/kernel/KernelKit/Semaphore.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kernel/KernelKit/Semaphore.h b/src/kernel/KernelKit/Semaphore.h
index 4dc9a454..13f3eadb 100644
--- a/src/kernel/KernelKit/Semaphore.h
+++ b/src/kernel/KernelKit/Semaphore.h
@@ -29,7 +29,7 @@ using SemaphoreArr = UInt64[kSemaphoreCount];
/// @brief Checks if the semaphore is valid.
inline bool rtl_sem_is_valid(const SemaphoreArr& sem, const UInt64& owner = 0) {
- if (!sem) return false;
+ //if (!sem) return false;
return sem[kSemaphoreOwnerIndex] == owner && sem[kSemaphoreCountIndex] > 0;
}
@@ -37,7 +37,7 @@ inline bool rtl_sem_is_valid(const SemaphoreArr& sem, const UInt64& owner = 0) {
/// @param sem
/// @return
inline bool rtl_sem_release(SemaphoreArr& sem) {
- if (!sem) return false;
+ //if (!sem) return false;
sem[kSemaphoreOwnerIndex] = 0;
sem[kSemaphoreCountIndex] = 0;
@@ -50,7 +50,7 @@ inline bool rtl_sem_release(SemaphoreArr& sem) {
/// @param owner the owner to set, could be anything identifitable.
/// @return
inline bool rtl_sem_acquire(SemaphoreArr& sem, const UInt64& owner) {
- if (!sem) return false;
+ //if (!sem) return false;
if (!owner) {
err_global_get() = kErrorInvalidData;
@@ -70,7 +70,7 @@ inline bool rtl_sem_acquire(SemaphoreArr& sem, const UInt64& owner) {
/// @return
inline bool rtl_sem_wait(SemaphoreArr& sem, const UInt64& owner, const UInt64& timeout,
bool& condition) {
- if (!sem) return false;
+ //if (!sem) return false;
if (!rtl_sem_is_valid(sem, owner)) {
return false;