From 4e61e22c3da59b259741e57298725330791aed3e Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 21 Jul 2025 08:51:41 +0100 Subject: feat: NeKernel Semaphore API. includes: - New semaphore API for the kernel, we also make use of the HardwareTimer class here. - Defined header only for now. - New HAL HW Timer API in AMD64. Signed-off-by: Amlal El Mahrouss --- dev/kernel/KernelKit/KPC.h | 1 + 1 file changed, 1 insertion(+) (limited to 'dev/kernel/KernelKit/KPC.h') diff --git a/dev/kernel/KernelKit/KPC.h b/dev/kernel/KernelKit/KPC.h index a3b13de6..26d1b113 100644 --- a/dev/kernel/KernelKit/KPC.h +++ b/dev/kernel/KernelKit/KPC.h @@ -65,6 +65,7 @@ inline constexpr KPCError kErrorFileLocked = 64; inline constexpr KPCError kErrorDiskIsTooTiny = 65; inline constexpr KPCError kErrorDmaExhausted = 66; inline constexpr KPCError kErrorOutOfBitMapMemory = 67; +inline constexpr KPCError kErrorNetworkTimeout = 68; /// Generic errors. inline constexpr KPCError kErrorUnimplemented = -1; -- cgit v1.2.3 From c7e9d01d331d966a92efdc7ad6fb76ac96d0943e Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 21 Jul 2025 21:19:33 +0100 Subject: fix: KPC: Fix duplicate of kErrorNetworkTimeout. Signed-off-by: Amlal El Mahrouss --- dev/kernel/KernelKit/KPC.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dev/kernel/KernelKit/KPC.h') diff --git a/dev/kernel/KernelKit/KPC.h b/dev/kernel/KernelKit/KPC.h index 26d1b113..836be458 100644 --- a/dev/kernel/KernelKit/KPC.h +++ b/dev/kernel/KernelKit/KPC.h @@ -65,7 +65,7 @@ inline constexpr KPCError kErrorFileLocked = 64; inline constexpr KPCError kErrorDiskIsTooTiny = 65; inline constexpr KPCError kErrorDmaExhausted = 66; inline constexpr KPCError kErrorOutOfBitMapMemory = 67; -inline constexpr KPCError kErrorNetworkTimeout = 68; +inline constexpr KPCError kErrorTimeout = 68; /// Generic errors. inline constexpr KPCError kErrorUnimplemented = -1; -- cgit v1.2.3 From ca7b843f1c15dd479d287f93221cd23e74d94385 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 23 Jul 2025 08:32:09 +0100 Subject: feat: new 'kErrorAccessDenied' type for semaphore api. Signed-off-by: Amlal El Mahrouss --- dev/kernel/KernelKit/KPC.h | 3 ++- dev/kernel/KernelKit/Semaphore.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'dev/kernel/KernelKit/KPC.h') diff --git a/dev/kernel/KernelKit/KPC.h b/dev/kernel/KernelKit/KPC.h index 836be458..b55d98fc 100644 --- a/dev/kernel/KernelKit/KPC.h +++ b/dev/kernel/KernelKit/KPC.h @@ -65,7 +65,8 @@ inline constexpr KPCError kErrorFileLocked = 64; inline constexpr KPCError kErrorDiskIsTooTiny = 65; inline constexpr KPCError kErrorDmaExhausted = 66; inline constexpr KPCError kErrorOutOfBitMapMemory = 67; -inline constexpr KPCError kErrorTimeout = 68; +inline constexpr KPCError kErrorTimeout = 68; +inline constexpr KPCError kErrorAccessDenied = 69; /// Generic errors. inline constexpr KPCError kErrorUnimplemented = -1; diff --git a/dev/kernel/KernelKit/Semaphore.h b/dev/kernel/KernelKit/Semaphore.h index 7957ce31..6905c8cc 100644 --- a/dev/kernel/KernelKit/Semaphore.h +++ b/dev/kernel/KernelKit/Semaphore.h @@ -75,7 +75,7 @@ inline BOOL rtl_sem_wait(Semaphore& sem, UInt64 owner, UInt64 timeout, BOOL* con if (!condition || *condition) { if (sem[kSemaphoreCountIndex] == 0) { - err_global_get() = kErrorTimeout; + err_global_get() = kErrorAccessDenied; return FALSE; } @@ -91,7 +91,7 @@ inline BOOL rtl_sem_wait(Semaphore& sem, UInt64 owner, UInt64 timeout, BOOL* con if (ret) { if (!condition || *condition) { if (sem[kSemaphoreCountIndex] == 0) { - err_global_get() = kErrorTimeout; + err_global_get() = kErrorAccessDenied; return FALSE; } -- cgit v1.2.3 From 6d16db11d91c5fdf302af54e8e797dcbed8c9c71 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 23 Jul 2025 08:33:49 +0100 Subject: feat: new 'kErrorUnavailable' type and semaphore API breaking changes. Signed-off-by: Amlal El Mahrouss --- dev/kernel/KernelKit/KPC.h | 1 + dev/kernel/KernelKit/Semaphore.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'dev/kernel/KernelKit/KPC.h') diff --git a/dev/kernel/KernelKit/KPC.h b/dev/kernel/KernelKit/KPC.h index b55d98fc..794197e2 100644 --- a/dev/kernel/KernelKit/KPC.h +++ b/dev/kernel/KernelKit/KPC.h @@ -67,6 +67,7 @@ inline constexpr KPCError kErrorDmaExhausted = 66; inline constexpr KPCError kErrorOutOfBitMapMemory = 67; inline constexpr KPCError kErrorTimeout = 68; inline constexpr KPCError kErrorAccessDenied = 69; +inline constexpr KPCError kErrorUnavailable = 70; /// Generic errors. inline constexpr KPCError kErrorUnimplemented = -1; diff --git a/dev/kernel/KernelKit/Semaphore.h b/dev/kernel/KernelKit/Semaphore.h index 6905c8cc..df410208 100644 --- a/dev/kernel/KernelKit/Semaphore.h +++ b/dev/kernel/KernelKit/Semaphore.h @@ -75,7 +75,7 @@ inline BOOL rtl_sem_wait(Semaphore& sem, UInt64 owner, UInt64 timeout, BOOL* con if (!condition || *condition) { if (sem[kSemaphoreCountIndex] == 0) { - err_global_get() = kErrorAccessDenied; + err_global_get() = kErrorUnavailable; return FALSE; } @@ -91,7 +91,7 @@ inline BOOL rtl_sem_wait(Semaphore& sem, UInt64 owner, UInt64 timeout, BOOL* con if (ret) { if (!condition || *condition) { if (sem[kSemaphoreCountIndex] == 0) { - err_global_get() = kErrorAccessDenied; + err_global_get() = kErrorUnavailable; return FALSE; } -- cgit v1.2.3