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;
*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);
}
// 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:
*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;
}
}
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;
// 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");
}