From f5f62b145d472a2a2c388c385be9d1c4e5b5d84c Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 13 May 2025 08:46:49 +0200 Subject: feat(kernel): see below for the commit's details. what? - UserProcessScheduler and CoreProcessScheduler have been extended for FILE_TREE and also HEAP_TREE structures. - DDK device's API will use dk_ calls instead of sk_ calls. - SIGTRAP and Interrupt handlers have been fixed to handle when no process is being run, and the kernel is instead raising the interrupt. - Add file for HeFS formating in DiskImage.fwrk - Replace generic handler with breakpoint handler in int 3. why? - These changes are bug fixes and improvements. Signed-off-by: Amlal El Mahrouss --- dev/kernel/KernelKit/CoreProcessScheduler.h | 59 +++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'dev/kernel/KernelKit/CoreProcessScheduler.h') diff --git a/dev/kernel/KernelKit/CoreProcessScheduler.h b/dev/kernel/KernelKit/CoreProcessScheduler.h index 643c5479..830f17f9 100644 --- a/dev/kernel/KernelKit/CoreProcessScheduler.h +++ b/dev/kernel/KernelKit/CoreProcessScheduler.h @@ -24,6 +24,65 @@ class USER_PROCESS; class KERNEL_TASK; class UserProcessTeam; +enum { + kInvalidTreeKind = 0U, + kRedTreeKind = 100U, + kBlackTreeKind = 101U, + kTreeKindCount = 2U, +}; + +template +struct PROCESS_HEAP_TREE { + static constexpr auto kPtr = true; + static constexpr auto kFD = false; + + T Entry{nullptr}; + SizeT EntrySize{0UL}; + SizeT EntryPad{0UL}; + + UInt32 Color{kBlackTreeKind}; + + struct PROCESS_HEAP_TREE* Parent { + nullptr + }; + struct PROCESS_HEAP_TREE* Child { + nullptr + }; + + struct PROCESS_HEAP_TREE* Prev { + nullptr + }; + struct PROCESS_HEAP_TREE* Next { + nullptr + }; +}; + +template +struct PROCESS_FILE_TREE { + static constexpr auto kPtr = false; + static constexpr auto kFD = true; + + T Entry{nullptr}; + SizeT EntrySize{0UL}; + SizeT EntryPad{0UL}; + + UInt32 Color{kBlackTreeKind}; + + struct PROCESS_FILE_TREE* Parent { + nullptr + }; + struct PROCESS_FILE_TREE* Child { + nullptr + }; + + struct PROCESS_FILE_TREE* Prev { + nullptr + }; + struct PROCESS_FILE_TREE* Next { + nullptr + }; +}; + /***********************************************************************************/ /// @brief Subsystem enum type. /***********************************************************************************/ -- cgit v1.2.3