diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-13 08:27:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-13 08:27:07 +0200 |
| commit | 126cc73bb933cd1b550c8c5b97d8621717fb1e6b (patch) | |
| tree | f67922ba36b8a4847b0f1854f77da4466e64f7e6 /dev/kernel/HALKit/AMD64 | |
| parent | 799327413742309ab5def75d310df28576aefc7e (diff) | |
| parent | f30470c40229806a33c914ebdd1dbdf037c9698d (diff) | |
Merge pull request #17 from amlel-el-mahrouss/dev
dev, scheduler, ahci, dev: Refactor scheduler, and fix minor mistakes.
Diffstat (limited to 'dev/kernel/HALKit/AMD64')
| -rw-r--r-- | dev/kernel/HALKit/AMD64/HalKernelMain.cc | 2 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc | 2 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 20 |
3 files changed, 4 insertions, 20 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalKernelMain.cc b/dev/kernel/HALKit/AMD64/HalKernelMain.cc index cc346b5c..cc3c8e93 100644 --- a/dev/kernel/HALKit/AMD64/HalKernelMain.cc +++ b/dev/kernel/HALKit/AMD64/HalKernelMain.cc @@ -22,7 +22,7 @@ STATIC Kernel::Void hal_init_scheduler_team() { for (Kernel::SizeT i = 0U; i < Kernel::UserProcessScheduler::The().CurrentTeam().AsArray().Count(); ++i) { - Kernel::UserProcessScheduler::The().CurrentTeam().AsArray()[i] = Kernel::UserProcess(); + Kernel::UserProcessScheduler::The().CurrentTeam().AsArray()[i] = Kernel::Process(); Kernel::UserProcessScheduler::The().CurrentTeam().AsArray()[i].Status = Kernel::ProcessStatusKind::kKilled; } } diff --git a/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc b/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc index dea3b3d4..ba5710e3 100644 --- a/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc +++ b/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc @@ -14,7 +14,7 @@ namespace Kernel /// @param /***********************************************************************************/ - EXTERN_C Void __zka_pure_call(UserProcess* process) + EXTERN_C Void __zka_pure_call(Process* process) { if (process) process->Crash(); diff --git a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index f0893e2d..728b20ed 100644 --- a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -66,22 +66,6 @@ STATIC Int32 drv_find_cmd_slot_ahci(HbaPort* port) noexcept; STATIC Void drv_compute_disk_ahci() noexcept; -namespace AHCI::Detail -{ - template <typename RetType> - STATIC RetType* ahci_align_address(RetType* address, Int32 alignement) - { - if (!address) - return nullptr; - - UIntPtr addr = (UIntPtr)address; - - UIntPtr aligned_addr = (addr + alignement - 1) & (~alignement - 1); - - return (RetType*)aligned_addr; - } -} // namespace AHCI::Detail - STATIC Void drv_compute_disk_ahci() noexcept { kSATASectorCount = 0UL; @@ -90,18 +74,18 @@ STATIC Void drv_compute_disk_ahci() noexcept const UInt16 kSzIdent = 512; /// Push it to the stack - UInt16* identify_data = AHCI::Detail::ahci_align_address<UInt16>(new UInt16[kSzIdent], kib_cast(1)); + UInt16* identify_data = new UInt16[kSzIdent]; /// Send AHCI command for identification. drv_std_input_output_ahci<NO, YES, YES>(0, (UInt8*)identify_data, kAHCISectorSize, kSzIdent); /// Extract 48-bit LBA. - UInt64 lba48_sectors = 0; lba48_sectors |= (UInt64)identify_data[100]; lba48_sectors |= (UInt64)identify_data[101] << 16; lba48_sectors |= (UInt64)identify_data[102] << 32; + /// Now verify if lba48 if (lba48_sectors == 0) kSATASectorCount = (identify_data[61] << 16) | identify_data[60]; else |
