diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2016-09-07 20:28:33 +0200 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2016-09-07 20:29:39 +0200 |
commit | df2ee9d37717cdf2add689292415fe14bf9986ae (patch) | |
tree | e3c11683483a247eae71c664c8e91eee8ae66c3b /c/src/lib/libbsp/arm/raspberrypi/irq/irq.c | |
parent | arm/raspberrypi: propagate number of configured CPUs into linker script. (diff) | |
download | rtems-df2ee9d37717cdf2add689292415fe14bf9986ae.tar.bz2 |
arm/raspberrypi: basic BCM2836 SMP implementation.
The BSP support is divided to startup/bspsmp_api.c file where
functions required by SuperCore are defined and BCM2836 hardware
initialization part in startup/bspsmp_init.c.
Separation is done to prevent smpfatal08 test build failure.
Diffstat (limited to 'c/src/lib/libbsp/arm/raspberrypi/irq/irq.c')
-rw-r--r-- | c/src/lib/libbsp/arm/raspberrypi/irq/irq.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/raspberrypi/irq/irq.c b/c/src/lib/libbsp/arm/raspberrypi/irq/irq.c index e654d077c9..48f781075b 100644 --- a/c/src/lib/libbsp/arm/raspberrypi/irq/irq.c +++ b/c/src/lib/libbsp/arm/raspberrypi/irq/irq.c @@ -32,6 +32,11 @@ #include <rtems/bspIo.h> #include <strings.h> +#ifdef RTEMS_SMP +#include <rtems/score/smp.h> +#include <rtems/score/smpimpl.h> +#endif + typedef struct { unsigned long enable_reg_addr; unsigned long disable_reg_addr; @@ -97,6 +102,19 @@ void bsp_interrupt_dispatch(void) 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; |