void TIMER_1_ISR(void) { asm("push {r0}"); irq_handler(TIMER_1, TIMER_1_DEV); asm("pop {r0}"); asm("bx r0"); }
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc) { if (irq_handler) { // Fire the user callback irq_handler(); } }
void TIMER_0_ISR(void) { asm("push {LR}"); irq_handler(TIMER_0, TIMER_0_DEV); asm("pop {r0}"); asm("bx r0"); }
long handle_trap(long cause, long epc, long long regs[32]) { /** * Pending interrupt bit is cleared in the crt.S file by calling: * csrc mip, MIP_MSIP * If we woudn't do it the interrupt handler will be called infinitly * * Rise interrupt from the software maybe done sending a self-IPI: * csrwi mipi, 0 */ irqctrl_map *p_irqctrl = (irqctrl_map *)ADDR_NASTI_SLAVE_IRQCTRL; IsrEntryType *isr_table = (IsrEntryType *)p_irqctrl->isr_table; IRQ_HANDLER irq_handler; p_irqctrl->dbg_cause = cause; p_irqctrl->dbg_epc = epc; if (cause == 0x8000000000000000l) { for (int i = 0; i < CFG_IRQ_TOTAL; i++) { if (p_irqctrl->irq_pending & (0x1 << i)) { irq_handler = (IRQ_HANDLER)isr_table[i].handler; p_irqctrl->irq_cause_idx = i; irq_handler((void *)isr_table[i].arg); p_irqctrl->irq_clear = 0x1 << i; // clear pending bit[0] } } } else { /// Exception trap while (1) {} } return epc; }
void interrupt_handler(struct interrupt_context* int_ctx) { if ( int_ctx->int_no < 32 ) isr_handler(int_ctx); else if ( 32 <= int_ctx->int_no && int_ctx->int_no < 32 + 16 ) irq_handler(int_ctx); }
/* * Common interrupt handler. */ void interrupt_handler(void) { uint32_t bits; int vector, old_ipl, new_ipl; /* Get interrupt source */ bits = ICU_IRQSTS; for (vector = 0; vector < NIRQS; vector++) { if (bits & (uint32_t)(1 << vector)) break; } if (vector == NIRQS) goto out; /* Adjust interrupt level */ old_ipl = irq_level; new_ipl = ipl_table[vector]; if (new_ipl > old_ipl) /* Ignore spurious interrupt */ irq_level = new_ipl; update_mask(); /* Dispatch interrupt */ interrupt_enable(); irq_handler(vector); interrupt_disable(); /* Restore interrupt level */ irq_level = old_ipl; update_mask(); out: return; }
void isr_exti4(void) { if (EXTI->PR & EXTI_PR_PR4) { EXTI->PR |= EXTI_PR_PR4; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_4); } }
void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc) { if (irq_handler) { // Fire the user callback irq_handler(); } }
__attribute__ ((naked)) void TIMER_0_ISR_0(void) { ISR_ENTER(); DEBUG("\nenter ISR\n"); irq_handler(TIMER_0, TIMER_0_DEV_0, TIMER_0_DEV_1); DEBUG("leave ISR\n\n"); ISR_EXIT(); }
void gpio_bbb_drv::begin () { // Open the GPIO device _fd = open(GPIO_DEV, O_RDWR ); if( _fd < 0 ) { throw gpio_exception("Cannot open "GPIO_DEV", ", errno); } // Start the irq thread irq_thread = std::thread([&](){ irq_handler();} ); }
void isr_handler(struct registers regs) { int int_no = regs.int_no; if(int_no <= 19) //an exception has occured, panic! handle_exception(regs); else if(int_no >= IRQ_BASE) irq_handler(regs); else printf("[INFO] Unhandled interrupt %d\n", int_no); }
void isr_stub(struct int_frame *r) { if (r->int_no < ISR_IRQ0 || r->int_no == ISR_UNKNOWN) { fault_handler(r); } else if (r->int_no < ISR_IRQ0 + 16) { irq_handler(r); } else if (r->int_no == ISR_SYSCALL) { syscall(); // get syscall number form proc->fm } else { panic("isr_stub: wrong interrupt number"); } }
void PIC::irq_dispatch(PIC_IRQ_CONTEXT* context) { int irq_id = context->int_id; PIC_IRQ_HANDLER irq_handler = m_irq_handlers[irq_id]; if (irq_handler != NULL) { irq_handler(context); } //发送中断结束命令EOI(0x20) outportb(PIC1_CMD_PORT, 0x20);//向主片发送中断结束命令 outportb(PIC2_CMD_PORT, 0x20);//向从片发送中断结束命令 }
void isr_exti15_10(void) { if (EXTI->PR & EXTI_PR_PR10) { EXTI->PR |= EXTI_PR_PR10; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_10); } if (EXTI->PR & EXTI_PR_PR11) { EXTI->PR |= EXTI_PR_PR11; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_11); } if (EXTI->PR & EXTI_PR_PR12) { EXTI->PR |= EXTI_PR_PR12; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_12); } if (EXTI->PR & EXTI_PR_PR13) { EXTI->PR |= EXTI_PR_PR13; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_13); } if (EXTI->PR & EXTI_PR_PR14) { EXTI->PR |= EXTI_PR_PR14; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_14); } if (EXTI->PR & EXTI_PR_PR15) { EXTI->PR |= EXTI_PR_PR15; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_15); } }
void isr_exti9_5(void) { if (EXTI->PR & EXTI_PR_PR5) { EXTI->PR |= EXTI_PR_PR5; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_5); } if (EXTI->PR & EXTI_PR_PR6) { EXTI->PR |= EXTI_PR_PR6; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_6); } if (EXTI->PR & EXTI_PR_PR7) { EXTI->PR |= EXTI_PR_PR7; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_7); } if (EXTI->PR & EXTI_PR_PR8) { EXTI->PR |= EXTI_PR_PR8; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_8); } if (EXTI->PR & EXTI_PR_PR9) { EXTI->PR |= EXTI_PR_PR9; /* clear status bit by writing a 1 to it */ irq_handler(GPIO_IRQ_9); } }
void nrfx_rtc_0_irq_handler(void) { irq_handler(NRF_RTC0, NRFX_RTC0_INST_IDX, NRF_RTC_CC_CHANNEL_COUNT(0)); }
__attribute__ ((naked)) void TIMER_0_ISR(void) { ISR_ENTER(); irq_handler(TIMER_0, TIMER_0_DEV); ISR_EXIT(); }
void UART_5_ISR(void) { irq_handler(5); }
void UART_4_ISR(void) { irq_handler(4); }
void UART_3_ISR(void) { irq_handler(3); }
void UART_2_ISR(void) { irq_handler(2); }
void UART_1_ISR(void) { irq_handler(1); }
void UART_0_ISR(void) { irq_handler(0); }
void UART_2_ISR(void) { irq_handler(UART_2, UART_2_DEV); }
void UART_1_ISR(void) { irq_handler(UART_1, UART_1_DEV); }
void UART_0_ISR(void) { irq_handler(UART_0, UART_0_DEV); }
void TIMER4_IRQHandler(void) { irq_handler(NRF_TIMER4, &m_cb[TIMER4_INSTANCE_INDEX], NRF_TIMER_CC_CHANNEL_COUNT(4)); }
void nrfx_rtc_1_irq_handler(void) { irq_handler(NRF_RTC1, NRFX_RTC1_INST_IDX, NRF_RTC_CC_CHANNEL_COUNT(1)); }
void nrfx_rtc_2_irq_handler(void) { irq_handler(NRF_RTC2, NRFX_RTC2_INST_IDX, NRF_RTC_CC_CHANNEL_COUNT(2)); }
void UART_5_ISR(void) { irq_handler(UART_DEV(5)); }