From be11411ae7c2f6a2eda84abf56521d38a8b80b7e Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 4 Sep 2025 10:15:05 +0200 Subject: feat&fix: Kernel improvements and fixes, introduced `special` trees. fix: Protective measures against affinity `zero` processes. wip: WIP introduce `CFDictionary` object inside CF. fix: public tooling fixes. Signed-off-by: Amlal El Mahrouss --- dev/kernel/src/FS/HeFS+FileSystemParser.cc | 5 +++-- dev/kernel/src/UserProcessScheduler.cc | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'dev/kernel/src') diff --git a/dev/kernel/src/FS/HeFS+FileSystemParser.cc b/dev/kernel/src/FS/HeFS+FileSystemParser.cc index f1531b4c..86f929c0 100644 --- a/dev/kernel/src/FS/HeFS+FileSystemParser.cc +++ b/dev/kernel/src/FS/HeFS+FileSystemParser.cc @@ -88,7 +88,8 @@ namespace Detail { /// @brief Simple algorithm to hash directory entries for INDs. /// @param path the directory path. /// @return The hashed path. - STATIC UInt64 hefsi_hash_64(const Utf8Char* path) { + template + STATIC UInt64 hefsi_hash_64(const CharT* path) { if (!path || *path == 0) return 0; const UInt64 kFnvBaseOffset = 0xcbf29ce484222325ULL; @@ -97,7 +98,7 @@ namespace Detail { UInt64 hash = kFnvBaseOffset; while (*path) { - hash ^= (Utf8Char) (*path++); + hash ^= (CharT) (*path++); hash *= kFnvPrimeNumber; } diff --git a/dev/kernel/src/UserProcessScheduler.cc b/dev/kernel/src/UserProcessScheduler.cc index 15da4431..174862a4 100644 --- a/dev/kernel/src/UserProcessScheduler.cc +++ b/dev/kernel/src/UserProcessScheduler.cc @@ -587,6 +587,7 @@ ErrorOr UserProcessHelper::TheCurrentPID() { /// @retval false cannot be schedulded. Bool UserProcessHelper::CanBeScheduled(const USER_PROCESS& process) { if (process.Status != ProcessStatusKind::kRunning) return No; + if (process.Affinity == AffinityKind::kInvalid) return No; if (process.StackSize > kSchedMaxStackSz) return No; if (!process.Name[0]) return No; -- cgit v1.2.3