From 0674da032568d1fa62040471b6effcef52e96d98 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 23 Nov 2023 15:41:24 -0500 Subject: [PATCH] Flip IRQ priority. --- Machines/PCCompatible/PIC.hpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Machines/PCCompatible/PIC.hpp b/Machines/PCCompatible/PIC.hpp index c89d4a157..513129869 100644 --- a/Machines/PCCompatible/PIC.hpp +++ b/Machines/PCCompatible/PIC.hpp @@ -114,13 +114,11 @@ class PIC { int acknowledge() { awaiting_eoi_ = true; - // TODO: there's bound to be a better solution than this search? - // TODO: is this the right priority order? - in_service_ = 0x80; - int id = 7; - while(!(in_service_ & requests_)) { - in_service_ >>= 1; - --id; + in_service_ = 0x01; + int id = 0; + while(!(in_service_ & requests_) && in_service_) { + in_service_ <<= 1; + ++id; } if(in_service_) {