Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


*** empty log message ***
[palacios.git] / palacios / src / devices / 8259a.c
index 1608c28..7db595f 100644 (file)
@@ -180,12 +180,19 @@ static int pic_get_intr_number(void * private_data) {
 }
 
 
-
-
-
+/* The IRQ number is the number returned by pic_get_intr_number(), not the pin number */
 static int pic_begin_irq(void * private_data, int irq) {
   struct pic_internal * state = (struct pic_internal*)private_data;
 
+  if ((irq >= state->master_icw2) && (irq <= state->master_icw2 + 7)) {
+    irq &= 0x7;
+  } else if ((irq >= state->slave_icw2) && (irq <= state->slave_icw2 + 7)) {
+    irq &= 0x7;
+    irq += 8;
+  } else {
+    return -1;
+  }
+
   if (irq <= 7) {
     if (((state->master_irr & ~(state->master_imr)) >> irq) == 0x01) {
       state->master_isr |= (0x1 << irq);