From 34611ac2fca2eaf5107512ec0bb7dbf0e896c4b4 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 19 Mar 2025 06:31:43 +0100 Subject: refactor(kernel): Standardize DMA and AHCI interfaces and enhance GIC handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace ambiguous WordLength templates with DataKind in `ke_dma_read/write`. - Streamline AHCI driver initialization by directly assigning port implementations. - Rename AHCI methods for clarity (`SetPi` → `SetPortsImplemented`). - Standardize MMIO access by replacing `hal_mmio_read/write` with unified `ke_dma_read/write`. - Improve GIC interrupt handler on ARM64 by explicitly handling scheduler interrupts and ensuring interrupts are ended correctly. - Add debug breakpoint in infinite loop within AP setup for improved debugging. Signed-off-by: Amlal El Mahrouss --- dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'dev/Kernel/HALKit/AMD64') diff --git a/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index cfbeeeb2..51db8054 100644 --- a/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -244,8 +244,7 @@ STATIC Bool drv_std_init_ahci(UInt16& pi, BOOL atapi) UInt32 ports_implemented = mem_ahci->Pi; UInt16 ahci_index = 0; - kSATAPortsImplemented = ports_implemented; - pi = kSATAPortsImplemented; + pi = ports_implemented; const UInt16 kMaxPortsImplemented = kSATAPortCnt; const UInt32 kSATASignature = kSATASig; @@ -309,6 +308,8 @@ namespace NeOS UInt16 pi = 0; return drv_std_init_ahci(pi, atapi); + kSATAPortsImplemented = pi; + return pi; } @@ -330,7 +331,7 @@ namespace NeOS }, nullptr); - device.SetPi(kSATAPortsImplemented); + device.SetPortsImplemented(kSATAPortsImplemented); device.SetIndex(drv_index); return ErrorOr(device); -- cgit v1.2.3