feat: make kernel architecture-agnostic; primitive work on arm port
This commit is contained in:
1 parent
dab7d5427b
commit
1bae77ec84
164 files changed
+3664
-1641
No files matched your search
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "Nvme.hpp"
|
||||
#include <Arch/Cpu.hpp>
|
||||
#include "BlockDevice.hpp"
|
||||
#include <Pci/Pci.hpp>
|
||||
#include <Terminal/Terminal.hpp>
|
||||
@@ -13,7 +14,7 @@
|
||||
#include <Memory/Paging.hpp>
|
||||
#include <Memory/PageFrameAllocator.hpp>
|
||||
#include <Libraries/Memory.hpp>
|
||||
#include <Timekeeping/ApicTimer.hpp>
|
||||
#include <Timekeeping/Timer.hpp>
|
||||
|
||||
using namespace Kt;
|
||||
|
||||
@@ -191,7 +192,7 @@ namespace Drivers::Storage::Nvme {
|
||||
if ((spins & 0x3FFF) == 0 &&
|
||||
Timekeeping::GetMilliseconds() - start >= kTimeoutMs) break;
|
||||
if (spins >= kMaxSpins) break;
|
||||
asm volatile("pause" ::: "memory");
|
||||
Arch::Pause();
|
||||
}
|
||||
|
||||
KernelLogStream(ERROR, "NVMe") << "Command " << base::dec << (uint64_t)cmdId
|
||||
@@ -254,7 +255,7 @@ namespace Drivers::Storage::Nvme {
|
||||
if (!(csts & CSTS_RDY)) {
|
||||
return true;
|
||||
}
|
||||
asm volatile("" ::: "memory");
|
||||
Arch::CompilerBarrier();
|
||||
}
|
||||
|
||||
KernelLogStream(ERROR, "NVMe") << "Controller disable timeout";
|
||||
@@ -280,7 +281,7 @@ namespace Drivers::Storage::Nvme {
|
||||
if (csts & CSTS_RDY) {
|
||||
return true;
|
||||
}
|
||||
asm volatile("" ::: "memory");
|
||||
Arch::CompilerBarrier();
|
||||
}
|
||||
|
||||
KernelLogStream(ERROR, "NVMe") << "Controller enable timeout";
|
||||
|
||||
Reference in new issue
Block a user