Permalink
Browse files

Debugger: Add commands to allow manual raising and lowering IRQ signals

  • Loading branch information...
joncampbell123 committed Mar 16, 2018
1 parent f1a4b33 commit 6ad9f8a3bf0cbb15af53898eae5ae4cce90d39e2
Showing with 22 additions and 0 deletions.
  1. +13 −0 src/debug/debug.cpp
  2. +9 −0 src/hardware/pic.cpp
View
@@ -1402,6 +1402,7 @@ bool ParseCommand(char* str) {
}
if (command == "PIC") { // interrupt controller state/controls
void DEBUG_PICSignal(int irq,bool raise);
void DEBUG_PICMask(int irq,bool mask);
void DEBUG_PICAck(int irq);
void DEBUG_LogPIC(void);
@@ -1426,6 +1427,18 @@ bool ParseCommand(char* str) {
int irq = atoi(what.c_str());
DEBUG_PICAck(irq);
}
else if (command == "LOWERIRQ") { /* manually lower an IRQ signal */
std::string what;
stream >> what;
int irq = atoi(what.c_str());
DEBUG_PICSignal(irq,false);
}
else if (command == "RAISEIRQ") { /* manually raise an IRQ signal */
std::string what;
stream >> what;
int irq = atoi(what.c_str());
DEBUG_PICSignal(irq,true);
}
else {
DEBUG_LogPIC();
}
View
@@ -478,6 +478,15 @@ void PIC_SetIRQMask(Bitu irq, bool masked) {
pic->set_imr(newmask);
}
void DEBUG_PICSignal(int irq,bool raise) {
if (irq >= 0 && irq <= 15) {
if (raise)
PIC_ActivateIRQ(irq);
else
PIC_DeActivateIRQ(irq);
}
}
void DEBUG_PICAck(int irq) {
if (irq >= 0 && irq <= 15) {
PIC_Controller * pic=&pics[irq>7 ? 1 : 0];

0 comments on commit 6ad9f8a

Please sign in to comment.