summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKAKit/HALKit
diff options
context:
space:
mode:
authorAmlal EL Mahrouss. <113760121+amlel-el-mahrouss@users.noreply.github.com>2024-11-26 15:41:56 +0100
committerGitHub <noreply@github.com>2024-11-26 15:41:56 +0100
commitf05ac8c656f3dccd79e7b3a276c86f08be2bb9f7 (patch)
tree8d9307c53d6ba28d321f3469cf933bf076d92d23 /dev/ZKAKit/HALKit
parentf71dee9aae7f590caf77d226e694b8224c9c1e22 (diff)
parent476e896ba9169b4b71c1e80d3e44dd006934b3e5 (diff)
Merge pull request #4 from ELMH-Group/unstable
Unstable
Diffstat (limited to 'dev/ZKAKit/HALKit')
-rw-r--r--dev/ZKAKit/HALKit/AMD64/Storage/AHCI-DMA.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/dev/ZKAKit/HALKit/AMD64/Storage/AHCI-DMA.cc b/dev/ZKAKit/HALKit/AMD64/Storage/AHCI-DMA.cc
index e3bf1c12..e201f0fb 100644
--- a/dev/ZKAKit/HALKit/AMD64/Storage/AHCI-DMA.cc
+++ b/dev/ZKAKit/HALKit/AMD64/Storage/AHCI-DMA.cc
@@ -31,6 +31,8 @@
#define HBA_PxCMD_FR 0x4000
#define HBA_PxCMD_CR 0x8000
+#define AHCI_LBA_MODE (1 << 6)
+
#define kMaxAhciPoll (100000U)
#define kCmdOrCtrlCmd 1
@@ -219,13 +221,13 @@ Kernel::Void drv_std_read(Kernel::UInt64 lba, Kernel::Char* buffer, Kernel::Size
for (int i = 0; i < cmd_hdr->Prdtl - 1; i++)
{
cmd_tbl->PrdtEntries[i].Dba = (Kernel::UInt32)(Kernel::UInt64)buffer;
- cmd_tbl->PrdtEntries[i].Dba = (Kernel::UInt32)((Kernel::UInt64)(buffer) >> 32);
+ cmd_tbl->PrdtEntries[i].Dbau = (Kernel::UInt32)((Kernel::UInt64)(buffer) >> 32);
cmd_tbl->PrdtEntries[i].Dbc = size_buffer - 1; // 8K bytes (this value should always be set to 1 less than the actual value)
cmd_tbl->PrdtEntries[i].InterruptBit = 1;
}
cmd_tbl->PrdtEntries[i].Dba = (Kernel::UInt32)(Kernel::UInt64)buffer;
- cmd_tbl->PrdtEntries[i].Dba = (Kernel::UInt32)((Kernel::UInt64)(buffer) >> 32);
+ cmd_tbl->PrdtEntries[i].Dbau = (Kernel::UInt32)((Kernel::UInt64)(buffer) >> 32);
cmd_tbl->PrdtEntries[i].Dbc = size_buffer - 1; // 8K bytes (this value should always be set to 1 less than the actual value)
cmd_tbl->PrdtEntries[i].InterruptBit = 1;
@@ -238,7 +240,7 @@ Kernel::Void drv_std_read(Kernel::UInt64 lba, Kernel::Char* buffer, Kernel::Size
cmd_fis->Lba0 = (Kernel::UInt8)(Kernel::UInt32)lba & 0xFF;
cmd_fis->Lba1 = (Kernel::UInt8)((Kernel::UInt32)lba >> 8);
cmd_fis->Lba2 = (Kernel::UInt8)((Kernel::UInt32)lba >> 16);
- cmd_fis->Device = (1 << 6); // LBA mode
+ cmd_fis->Device = AHCI_LBA_MODE; // LBA mode
cmd_fis->Lba3 = (Kernel::UInt8)((Kernel::UInt32)lba >> 24);
cmd_fis->Lba4 = (Kernel::UInt8)(lba >> 32);
@@ -300,4 +302,4 @@ Kernel::SizeT drv_get_size()
return drv_get_sector_count() * kAHCISectorSize;
}
-#endif // ifdef __AHCI__ \ No newline at end of file
+#endif // ifdef __AHCI__