diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-11 17:51:19 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-11 17:51:19 +0200 |
| commit | c3856eddb5a8146751dac82ad1ba4433f5ca6d6d (patch) | |
| tree | a74bdf6f87d07a24496effbc157f74d379d25007 /dev/kernel/HALKit/AMD64/Storage | |
| parent | 9da6a352ecf70a1f5be99058a880b20db1b57940 (diff) | |
tweak kernel, boot: use -Wall, -Werror, -Wpedantic now.
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 | 13 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc | 5 |
2 files changed, 9 insertions, 9 deletions
diff --git a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index a1a9a164..f0893e2d 100644 --- a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -76,7 +76,7 @@ namespace AHCI::Detail UIntPtr addr = (UIntPtr)address; - UIntPtr aligned_addr = (addr + alignement - 1) & ~alignement - 1; + UIntPtr aligned_addr = (addr + alignement - 1) & (~alignement - 1); return (RetType*)aligned_addr; } @@ -107,6 +107,8 @@ STATIC Void drv_compute_disk_ahci() noexcept else kSATASectorCount = lba48_sectors; + (Void)(kout << "Device: " << kCurrentDiskModel << kendl); + delete[] identify_data; identify_data = nullptr; } @@ -141,7 +143,7 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz slot = drv_find_cmd_slot_ahci(&kSATAHba->Ports[kSATAIndex]); - if (slot == ~0) + if (slot == ~0UL) { err_global_get() = kErrorDisk; return; @@ -166,11 +168,8 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz /// check for command header. MUST_PASS(command_header); - /// 4kb per PRD. - constexpr const UInt32 kMaxPRDSize = kib_cast(4); - - command_header->Cfl = sizeof(FisRegH2D) / sizeof(UInt32); - command_header->Write = Write; + command_header->Struc.Cfl = sizeof(FisRegH2D) / sizeof(UInt32); + command_header->Struc.Write = Write; command_header->Prdtl = 1; auto ctba_phys = ((UInt64)command_header->Ctbau << 32) | command_header->Ctba; diff --git a/dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc index fc608e94..cc8c92d8 100644 --- a/dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc +++ b/dev/kernel/HALKit/AMD64/Storage/PIO+Generic.cc @@ -28,7 +28,6 @@ using namespace Kernel::HAL; #define kATADataLen 256 STATIC Boolean kATADetected = false; -STATIC Int32 kATADeviceType = kATADeviceCount; STATIC UInt16 kATAIdentifyData[kATADataLen] = {0}; STATIC Char kATADiskModel[50] = {"GENERIC PIO"}; @@ -67,6 +66,8 @@ Boolean drv_pio_std_init(UInt16 Bus, UInt8 Drive, UInt16& OutBus, UInt8& OutMast { UInt16 IO = Bus; + NE_UNUSED(Drive); + drv_pio_std_select(IO); // Bus init, NEIN bit. @@ -107,7 +108,7 @@ ATAInit_Retry: kATADiskModel[40] = '\0'; - kout << "Drive Model: " << kATADiskModel << kendl; + (void)(kout << "Drive Model: " << kATADiskModel << kendl); return true; } |
