diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2012-04-06 05:05:07 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-04-06 08:17:58 -0500 |
commit | 95518e59bd6dda4bda22f4f02a22613b67e39400 (patch) | |
tree | 6cfb21ea5492179731efad5a3a91813eb0f76df3 /c/src/lib/libbsp/sparc/leon3/startup/eirq.c | |
parent | LEON3: console use register pointers instead of UART indexes (diff) | |
download | rtems-95518e59bd6dda4bda22f4f02a22613b67e39400.tar.bz2 |
SPARC BSPs: implemented shared-irq using libbsp/shared layer
The implementation use IRQ number instead of vector number since
some IRQs does not have a unique vector, for example the extended
interrupts all enter the same trap vector entry.
Added support for the LEON3 extended interrupt controller when using
the shared IRQ layer.
ERC32 patches untested.
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Regenerate
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/startup/eirq.c')
-rw-r--r-- | c/src/lib/libbsp/sparc/leon3/startup/eirq.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/eirq.c b/c/src/lib/libbsp/sparc/leon3/startup/eirq.c new file mode 100644 index 0000000000..d62035ec84 --- /dev/null +++ b/c/src/lib/libbsp/sparc/leon3/startup/eirq.c @@ -0,0 +1,25 @@ +/* + * GRLIB/LEON3 extended interrupt controller + * + * COPYRIGHT (c) 2011 + * Aeroflex Gaisler + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + */ + +#include <bsp.h> + +/* GRLIB extended IRQ controller IRQ number */ +int LEON3_IrqCtrl_EIrq = -1; + +/* Initialize Extended Interrupt controller */ +void leon3_ext_irq_init(void) +{ + if ( (LEON3_IrqCtrl_Regs->mpstat >> 16) & 0xf ) { + /* Extended IRQ controller available */ + LEON3_IrqCtrl_EIrq = (LEON3_IrqCtrl_Regs->mpstat >> 16) & 0xf; + } +} |