/* * Determine the source of the interrupt and dispatch the correct handler. */ void bsp_interrupt_dispatch(void) { unsigned int pend; unsigned int pend_bit; rtems_vector_number vector = 255; #ifdef RTEMS_SMP uint32_t cpu_index_self = _SMP_Get_current_processor(); uint32_t local_source = BCM2835_REG(BCM2836_IRQ_SOURCE_REG(cpu_index_self)); if ( local_source & BCM2836_IRQ_SOURCE_MBOX3 ) { /* reset mailbox 3 contents to zero */ BCM2835_REG(BCM2836_MAILBOX_3_READ_CLEAR_BASE + 0x10 * cpu_index_self) = 0xffffffff; _SMP_Inter_processor_interrupt_handler(); } if ( cpu_index_self != 0 ) return; #endif /* RTEMS_SMP */ pend = BCM2835_REG(BCM2835_IRQ_BASIC); if ( pend & BCM2835_IRQ_BASIC_SPEEDUP_USED_BITS ) { pend_bit = ffs(pend) - 1; vector = bcm2835_irq_speedup_table[pend_bit]; } else { pend = BCM2835_REG(BCM2835_IRQ_PENDING1); if ( pend != 0 ) { pend_bit = ffs(pend) - 1; vector = pend_bit; } else { pend = BCM2835_REG(BCM2835_IRQ_PENDING2); if ( pend != 0 ) { pend_bit = ffs(pend) - 1; vector = pend_bit + 32; } } } if ( vector < 255 ) { bsp_interrupt_handler_dispatch(vector); } }
static void bsp_inter_processor_interrupt(void *arg) { _SMP_Inter_processor_interrupt_handler(); }
static rtems_isr bsp_inter_processor_interrupt( rtems_vector_number vector ) { _SMP_Inter_processor_interrupt_handler(); }