diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-10-18 18:33:47 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-10-18 18:33:47 +0000 |
commit | f2442183383a7ad70f2a6bc5e8f25e200fa0f54a (patch) | |
tree | 3c8ffe7a34dd86363dca28e7f7b810badf65b5ef /c/src/lib/libcpu/powerpc/mpc505/ictrl/ictrl.h | |
parent | 2000-10-18 Sergei Organov <osv@javad.ru> (diff) | |
download | rtems-f2442183383a7ad70f2a6bc5e8f25e200fa0f54a.tar.bz2 |
2000-10-18 Sergei Organov <osv@javad.ru>
* Added full support for MPC505.
* mpc505/ictrl: New directory.
* configure.in, mpc505/Makefile.am: Modified to reflect ictrl addition.
* mpc505/ictrl/.cvsignore, mpc505/ictrl/Makefile.am,
mpc505/ictrl/ictrl.c, mpc505/ictrl/ictrl.h: New files.
* mpc505/timer/timer.c: Use <rtems.h>, not "rtems.h".
* mpc505/vectors/Makefile.am: alignment exception handler now included.
* mpc505/vectors/vectors.S: Now use constants for exception numbers.
* old_exception_processing/ppc_offs.h: New file.
* old_exception_processing/Makefile.am: Account for ppc_offs.h.
* old_exception_processing/cpu.h: Make Nest and Disable levels volatile.
* old_exception_processing/cpu_asm.S: Offsets moved to ppc_offs.h.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libcpu/powerpc/mpc505/ictrl/ictrl.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/c/src/lib/libcpu/powerpc/mpc505/ictrl/ictrl.h b/c/src/lib/libcpu/powerpc/mpc505/ictrl/ictrl.h new file mode 100644 index 0000000000..303ece825d --- /dev/null +++ b/c/src/lib/libcpu/powerpc/mpc505/ictrl/ictrl.h @@ -0,0 +1,75 @@ +#ifndef _ICTRL_H +#define _ICTRL_H + +/* + * mpc505/509 external interrupt controller management. + * + * FIXME: should be somehow merged into general RTEMS interrupt + * management code. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define _SIU_IRQENABLE ((unsigned long volatile *const)0x8007EFA8) +#define _SIU_IRQPEND ((unsigned long volatile *const)0x8007EFA0) + +/* Interrupt masks. */ +enum { + IMASK_EXT0 = 0x80000000, + IMASK_EXT1 = 0x20000000, + IMASK_EXT2 = 0x08000000, + IMASK_EXT3 = 0x02000000, + IMASK_EXT4 = 0x00800000, + IMASK_EXT5 = 0x00200000, + IMASK_EXT6 = 0x00080000, + IMASK_ALL = IMASK_EXT0 | IMASK_EXT1 | IMASK_EXT2 | IMASK_EXT3 | + IMASK_EXT4 | IMASK_EXT5 | IMASK_EXT6 +}; + +/* Interrupt numbers. */ +typedef enum { + IRQ_EXT0, + IRQ_EXT1, + IRQ_EXT2, + IRQ_EXT3, + IRQ_EXT4, + IRQ_EXT5, + IRQ_EXT6, + NUM_IRQS +} ExtInt; + +/* Type of external interrupt handlers */ +typedef void (*ExtIsrHandler) (void); + +/* Initialization. Must be called once after RTEMS interrupts sybsystem + is initiailized. 'predriver_hook' is one of such places. */ +extern void extIsrInit( void ); + +/* Set interrupt handler 'handler' for external interrupt number + 'interrupt'. */ +extern void extIrqSetHandler(ExtInt interrupt, ExtIsrHandler handler); + +/* Check is external interrupt 'irq' (IMASK_XXXX) is pended. */ +#define extIrqIsSet(irq) \ + (*_SIU_IRQPEND & (irq)) + +/* Enable external interrupt 'irq' (IMASK_XXXX) processing. */ +#define extIrqEnable(irq) \ + (*_SIU_IRQENABLE |= (irq)) + +/* Disable external interrupt 'irq' (IMASK_XXXX) processing. */ +#define extIrqDisable(irq) \ + (*_SIU_IRQENABLE &= ~(irq)) + +/* Check if external interrupt 'irq' (IMASK_XXXX) processing is + enabled. */ +#define extIrqGetEnable \ + (*_SIU_IRQENABLE) + +#ifdef __cplusplus +} +#endif + +#endif /* _ICTRL_H */ |