feat: disconnect Bluetooth devices, flush disks on shutdown/reboot, display progress in login.elf window
This commit is contained in:
1 parent
5a34376ce5
commit
f0943d675f
24 files changed
+418
-12
No files matched your search
@@ -665,6 +665,9 @@ namespace Drivers::Storage::Nvme {
|
||||
bdev.WriteSectors = [](void* ctx, uint64_t lba, uint32_t count, const void* buffer) -> bool {
|
||||
return WriteSectors((int)(uintptr_t)ctx, lba, count, buffer);
|
||||
};
|
||||
bdev.Flush = [](void* ctx) -> bool {
|
||||
return Flush((int)(uintptr_t)ctx);
|
||||
};
|
||||
bdev.Ctx = (void*)(uintptr_t)i;
|
||||
bdev.SectorCount = g_namespaces[i].SectorCount;
|
||||
bdev.SectorSize = (uint16_t)g_namespaces[i].SectorSize;
|
||||
@@ -770,6 +773,22 @@ namespace Drivers::Storage::Nvme {
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool Flush(int ns) {
|
||||
if (!g_initialized || ns < 0 || ns >= g_nsCount || !g_namespaces[ns].Active) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// NVM Flush: commits the namespace's volatile write cache to media.
|
||||
SqEntry cmd = {};
|
||||
cmd.Opcode = IO_CMD_FLUSH;
|
||||
cmd.Nsid = g_namespaces[ns].Nsid;
|
||||
|
||||
SubmitIoCommand(cmd);
|
||||
|
||||
CqEntry cqe;
|
||||
return WaitIoCompletion(cqe);
|
||||
}
|
||||
|
||||
bool WriteSectors(int ns, uint64_t lba, uint32_t count, const void* buffer) {
|
||||
if (!g_initialized || ns < 0 || ns >= g_nsCount || !g_namespaces[ns].Active) {
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user