struct Coprocessor : Thread { alwaysinline auto step(uint clocks) -> void; alwaysinline auto synchronizeCPU() -> void; }; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include auto Coprocessor::step(uint clocks) -> void { clock += clocks * (uint64)cpu.frequency; } auto Coprocessor::synchronizeCPU() -> void { if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread); }