feat: support for USB mass storage devices, hotplugging
This commit is contained in:
@@ -105,9 +105,6 @@ namespace Timekeeping {
|
||||
if (Drivers::Net::E1000E::RequiresPolling()) {
|
||||
Drivers::Net::E1000E::Poll();
|
||||
}
|
||||
if (Drivers::USB::Xhci::HasDeferredWork()) {
|
||||
Drivers::USB::Xhci::ProcessDeferredWork();
|
||||
}
|
||||
Drivers::USB::HidKeyboard::Tick();
|
||||
}
|
||||
|
||||
@@ -246,6 +243,15 @@ namespace Timekeeping {
|
||||
|
||||
void IdleOnce(bool hasMwait, volatile uint64_t* monitorAddr) {
|
||||
auto* cpu = Smp::GetCurrentCpuData();
|
||||
|
||||
// Drain USB hot-plug deferred work from any idle core, not just the BSP.
|
||||
// ProcessDeferredWork uses an atomic CAS so only one core runs it at a
|
||||
// time; the rest return immediately. This keeps hot-plug latency bounded
|
||||
// by *any* core's idle gap instead of being pinned to BSP idle.
|
||||
if (Drivers::USB::Xhci::HasDeferredWork()) {
|
||||
Drivers::USB::Xhci::ProcessDeferredWork();
|
||||
}
|
||||
|
||||
if (cpu == nullptr || cpu->cpuIndex != 0 || !g_schedEnabled || g_ticksPerMs == 0) {
|
||||
Hal::CpuIdle::Wait(BSP_TICK_INTERVAL_MS, hasMwait, monitorAddr);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user