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.synchronizing()) co_switch(cpu.thread); }