diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-16 20:18:37 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-16 20:18:37 +0100 |
| commit | 3f7a25c913bdda5bd94e4849e328d31280552a75 (patch) | |
| tree | ee4410cb55e455d7fdc144ac4f9bec6d477110e7 /dev/kernel/HALKit/AMD64/Storage | |
| parent | 7e94770e21f520580caf9994b6b88416a6ac9511 (diff) | |
feat: bug: chk.efi breaks ne_kernel on AHCI.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit/AMD64/Storage')
| -rw-r--r-- | dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index 1acfac0e..673d9338 100644 --- a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -294,8 +294,7 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz goto ahci_io_end; } else { kout << "ahci: Disk still busy after command completion!\r"; - while (kSATAHba->Ports[kSATAIndex].Tfd & (kSATASRBsy | kSATASRDrq)) - ; + while (kSATAHba->Ports[kSATAIndex].Tfd & (kSATASRBsy | kSATASRDrq)); } ahci_io_end: @@ -308,13 +307,15 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz @brief Gets the number of sectors inside the drive. @return Sector size in bytes. */ -STATIC ATTRIBUTE(unused) SizeT drv_get_sector_count_ahci() { +STATIC ATTRIBUTE(unused) +SizeT drv_get_sector_count_ahci() { return kSATASectorCount; } /// @brief Get the drive size. /// @return Disk size in bytes. -STATIC ATTRIBUTE(unused) SizeT drv_get_size_ahci() { +STATIC ATTRIBUTE(unused) +SizeT drv_get_size_ahci() { return drv_std_get_sector_count() * kAHCISectorSize; } @@ -456,11 +457,9 @@ STATIC Bool drv_std_init_ahci(UInt16& pi, BOOL& atapi) { success_hba_fetch: if (ahci_enable_and_probe()) { err_global_get() = kErrorSuccess; - - return YES; } - return NO; + return err_global_get() == kErrorSuccess; } /// @brief Checks if an AHCI device is detected. @@ -546,8 +545,7 @@ namespace Detail { /// @brief Read AHCI device. /// @param self device /// @param mnt mounted disk. - STATIC Void sk_io_read_ahci(DeviceInterface<IMountpoint*>* self, - IMountpoint* mnt) { + STATIC Void sk_io_read_ahci(DeviceInterface<IMountpoint*>* self, IMountpoint* mnt) { AHCIDeviceInterface* dev = (AHCIDeviceInterface*) self; err_global_get() = kErrorDisk; @@ -568,8 +566,7 @@ namespace Detail { /// @brief Write AHCI device. /// @param self device /// @param mnt mounted disk. - STATIC Void sk_io_write_ahci(DeviceInterface<IMountpoint*>* self, - IMountpoint* mnt) { + STATIC Void sk_io_write_ahci(DeviceInterface<IMountpoint*>* self, IMountpoint* mnt) { AHCIDeviceInterface* dev = (AHCIDeviceInterface*) self; err_global_get() = kErrorDisk; |
