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.


fixed command register handler bug
[palacios.git] / palacios / src / devices / apic.c
index 0bb591a..6e036a5 100644 (file)
@@ -280,6 +280,8 @@ static int activate_apic_irq(struct apic_state * apic, uint32_t irq_num) {
 static int apic_do_eoi(struct apic_state * apic) {
     int i = 0, j = 0;
 
+    PrintDebug("Received APIC EOI\n");
+
     // We iterate backwards to find the highest priority
     for (i = 31; i >= 0; i--) {
        uchar_t  * svc_major = apic->int_svc_reg + i;
@@ -289,6 +291,12 @@ static int apic_do_eoi(struct apic_state * apic) {
                uchar_t flag = 0x1 << j;
                if ((*svc_major) & flag) {
                    *svc_major &= ~flag;
+
+#ifdef CRAY_XT
+                   if (((i * 8) + j) == 238) {
+                       V3_ACK_IRQ(238);
+                   }
+#endif
                    return 0;
                }
            }
@@ -739,14 +747,13 @@ static int apic_write(addr_t guest_addr, void * src, uint_t length, void * priv_
    
 
            // Action Registers
+       case EOI_OFFSET:
+           // do eoi
+           apic_do_eoi(apic);
+           break;
+
        case INT_CMD_LO_OFFSET:
        case INT_CMD_HI_OFFSET:
-       case EOI_OFFSET:
-           {
-               // do eoi
-               apic_do_eoi(apic);
-               break;
-           }
            // Unhandled Registers
        case EXT_INT_LOC_VEC_TBL_OFFSET0:
        case EXT_INT_LOC_VEC_TBL_OFFSET1:
@@ -836,6 +843,12 @@ static int apic_begin_irq(void * private_data, int irq) {
     *svc_location |= flag;
     *req_location &= ~flag;
 
+#ifdef CRAY_XT
+    if ((irq == 238) || (irq == 239)) {
+       PrintError("APIC: Begin IRQ %d (ISR=%x), (IRR=%x)\n", irq, *svc_location, *req_location);
+    }
+#endif
+
     return 0;
 }