diff options
Diffstat (limited to 'dev/kernel/HALKit/AMD64')
5 files changed, 17 insertions, 13 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc index 3d0cee00..0791b28f 100644 --- a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc +++ b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc @@ -5,11 +5,11 @@ ------------------------------------------- */ #include <modules/ACPI/ACPIFactoryInterface.h> -#include <KernelKit/UserProcessScheduler.h> +#include <KernelKit/ProcessScheduler.h> #include <HALKit/AMD64/Processor.h> #include <ArchKit/ArchKit.h> #include <KernelKit/BinaryMutex.h> -#include <KernelKit/UserProcessScheduler.h> +#include <KernelKit/ProcessScheduler.h> #include <KernelKit/Timer.h> #include <modules/CoreGfx/TextMgr.h> #include <NewKit/KernelPanic.h> diff --git a/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc index b1fa95a4..273ea96b 100644 --- a/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc +++ b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc @@ -5,7 +5,7 @@ ------------------------------------------- */ #include <ArchKit/ArchKit.h> -#include <KernelKit/UserProcessScheduler.h> +#include <KernelKit/ProcessScheduler.h> #include <NewKit/KString.h> #include <SignalKit/Signals.h> diff --git a/dev/kernel/HALKit/AMD64/HalKernelMain.cc b/dev/kernel/HALKit/AMD64/HalKernelMain.cc index 30463f5d..8b092509 100644 --- a/dev/kernel/HALKit/AMD64/HalKernelMain.cc +++ b/dev/kernel/HALKit/AMD64/HalKernelMain.cc @@ -6,7 +6,7 @@ #include <StorageKit/AHCI.h> #include <ArchKit/ArchKit.h> -#include <KernelKit/UserProcessScheduler.h> +#include <KernelKit/ProcessScheduler.h> #include <KernelKit/HardwareThreadScheduler.h> #include <KernelKit/CodeMgr.h> #include <modules/ACPI/ACPIFactoryInterface.h> diff --git a/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc b/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc index 6b287060..cb766477 100644 --- a/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc +++ b/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitivesAMD64.cc @@ -5,7 +5,7 @@ ------------------------------------------- */ #include <HALKit/AMD64/Processor.h> -#include <KernelKit/UserProcessScheduler.h> +#include <KernelKit/ProcessScheduler.h> namespace Kernel { diff --git a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index 2ef2fda7..38a1742b 100644 --- a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -17,7 +17,7 @@ #include <KernelKit/DeviceMgr.h> #include <KernelKit/DriveMgr.h> -#include <KernelKit/UserProcessScheduler.h> +#include <KernelKit/ProcessScheduler.h> #include <KernelKit/KPC.h> #include <FirmwareKit/EPM.h> #include <StorageKit/AHCI.h> @@ -133,9 +133,9 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz } /// prepare command header. - volatile HbaCmdHeader* command_header = ((HbaCmdHeader*)(((UInt64)kSATAHba->Ports[kSATAIndex].Clb))); + volatile HbaCmdHeader* command_header = ((volatile HbaCmdHeader*)(((UInt64)kSATAHba->Ports[kSATAIndex].Clb))); - /// jump to found slot. + /// Offset to specific command slot. command_header += slot; MUST_PASS(command_header); @@ -144,9 +144,9 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz command_header->Write = Write; command_header->Prdtl = (UInt16)((size_buffer - 1) / 8); - HbaCmdTbl* command_table = (HbaCmdTbl*)((VoidPtr)((UInt64)command_header->Ctba)); + volatile HbaCmdTbl* command_table = (volatile HbaCmdTbl*)((VoidPtr)((UInt64)command_header->Ctba)); - rt_set_memory(command_table, 0, sizeof(HbaCmdTbl) + (command_header->Prdtl - 1) * sizeof(HbaPrdtEntry)); + rt_set_memory((HbaCmdTbl*)command_table, 0, sizeof(HbaCmdTbl) + (command_header->Prdtl - 1) * sizeof(HbaPrdtEntry)); MUST_PASS(command_table); @@ -154,7 +154,7 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz UInt16 prd_i = 0; - for (; prd_i < (command_header->Prdtl - 1); prd_i++) + for (; prd_i < (command_header->Prdtl - 1); ++prd_i) { command_table->Prdt[prd_i].Dbc = ((command_header->Prdtl - 1) / 8); command_table->Prdt[prd_i].Dba = ((UInt32)(UInt64)buffer_phys); @@ -164,11 +164,13 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz buffer_phys += command_table->Prdt[prd_i].Dbc; } - FisRegH2D* h2d_fis = (FisRegH2D*)(&command_table->Cfis); + volatile FisRegH2D* h2d_fis = (volatile FisRegH2D*)(&command_table->Cfis); + + rt_set_memory((FisRegH2D*)h2d_fis, 0, sizeof(FisRegH2D)); h2d_fis->FisType = kFISTypeRegH2D; h2d_fis->CmdOrCtrl = CommandOrCTRL; - h2d_fis->Command = Identify ? (kAHCICmdIdentify) : (Write ? kAHCICmdWriteDmaEx : kAHCICmdReadDmaEx); + h2d_fis->Command = (Identify ? (kAHCICmdIdentify) : (Write ? kAHCICmdWriteDmaEx : kAHCICmdReadDmaEx)); h2d_fis->Lba0 = (lba)&0xFF; h2d_fis->Lba1 = (lba >> 8) & 0xFF; @@ -213,6 +215,8 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz err_global_get() = kErrorDiskIsCorrupted; return; } + + err_global_get() = kErrorSuccess; } /*** |
