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.


debugging update
[palacios.git] / palacios / src / devices / apic.c
index 0bb591a..5afe31d 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,18 @@ 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) || 
+                       (((i * 8) + j) == 239)) {
+                       PrintError("Acking IRQ %d\n", ((i * 8) + j));
+                   }
+                   
+                   if (((i * 8) + j) == 238) {
+                       V3_ACK_IRQ(238);
+                   }
+#endif
                    return 0;
                }
            }
@@ -739,14 +753,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 +849,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;
 }
 
@@ -905,7 +924,7 @@ static void apic_update_time(ullong_t cpu_cycles, ullong_t cpu_freq, void * priv
     }
 
     tmr_ticks = cpu_cycles >> shift_num;
-    //  PrintDebug("Timer Ticks: %p\n", (void *)tmr_ticks);
+    PrintDebug("Timer Ticks: %p\n", (void *)tmr_ticks);
 
     if (tmr_ticks < apic->tmr_cur_cnt) {
        apic->tmr_cur_cnt -= tmr_ticks;
@@ -916,6 +935,7 @@ static void apic_update_time(ullong_t cpu_cycles, ullong_t cpu_freq, void * priv
        // raise irq
        PrintDebug("Raising APIC Timer interrupt (periodic=%d) (icnt=%d) (div=%d)\n", 
                   apic->tmr_vec_tbl.tmr_mode, apic->tmr_init_cnt, shift_num);
+
        if (activate_internal_irq(apic, APIC_TMR_INT) == -1) {
            PrintError("Could not raise Timer interrupt\n");
        }