summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel
diff options
context:
space:
mode:
Diffstat (limited to 'dev/Kernel')
-rw-r--r--dev/Kernel/HALKit/AMD64/Storage/AHCI.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/dev/Kernel/HALKit/AMD64/Storage/AHCI.cc b/dev/Kernel/HALKit/AMD64/Storage/AHCI.cc
index f2e0fda5..f36b8e28 100644
--- a/dev/Kernel/HALKit/AMD64/Storage/AHCI.cc
+++ b/dev/Kernel/HALKit/AMD64/Storage/AHCI.cc
@@ -20,6 +20,8 @@
#include <KernelKit/UserProcessScheduler.h>
#include <KernelKit/LPC.h>
+#include <FirmwareKit/EPM.h>
+
#include <Mod/ATA/ATA.h>
#include <Mod/AHCI/AHCI.h>
#include <KernelKit/PCI/Iterator.h>
@@ -138,9 +140,9 @@ STATIC Void drv_std_input_output(UInt64 lba, UInt8* buffer, SizeT sector_sz, Siz
for (; i < (command_header->Prdtl - 1); i++)
{
- command_table->Prdt[i].Dba = ((UInt32)(UInt64)buffer_phys);
- command_table->Prdt[i].Dbau = (((UInt64)(buffer_phys) >> 32));
command_table->Prdt[i].Dbc = ((size_buffer / command_header->Prdtl - 1) - 1);
+ command_table->Prdt[i].Dba = ((UInt32)(UInt64)buffer_phys + (i * command_table->Prdt[i].Dbc));
+ command_table->Prdt[i].Dbau = (((UInt64)(buffer_phys) >> 32) + (i * command_table->Prdt[i].Dbc));
command_table->Prdt[i].Ie = YES;
}