[Kernel] Add evalReschedule function

This commit is contained in:
wheremyfoodat 2023-08-02 19:18:15 +03:00
parent 60de6a65f5
commit 3d5f1ea517
3 changed files with 10 additions and 4 deletions

View file

@ -172,6 +172,13 @@ public:
void requireReschedule() { needReschedule = true; }
void evalReschedule() {
if (needReschedule) {
needReschedule = false;
rescheduleThreads();
}
}
Handle makeObject(KernelObjectType type) {
if (handleCounter > KernelHandles::Max) [[unlikely]] {
Helpers::panic("Hlep we somehow created enough kernel objects to overflow this thing");

View file

@ -62,10 +62,7 @@ void Kernel::serviceSVC(u32 svc) {
default: Helpers::panic("Unimplemented svc: %X @ %08X", svc, regs[15]); break;
}
if (needReschedule) {
needReschedule = false;
rescheduleThreads();
}
evalReschedule();
}
void Kernel::setVersion(u8 major, u8 minor) {

View file

@ -357,6 +357,8 @@ void Emulator::run() {
hid.updateInputs(cpu.getTicks());
}
// TODO: Should this be uncommented?
// kernel.evalReschedule();
// Update inputs in the HID module
SDL_GL_SwapWindow(window);