From e9ae97fbc6221ffb11b1ce14f6fc320dc602b686 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 9 Nov 2001 00:04:57 +0000 Subject: 2001-11-08 Dennis Ehlin (ECS) This modification is part of the submitted modifications necessary to support the IBM PPC405 family. This submission was reviewed by Thomas Doerfler who ensured it did not negatively impact the ppc403 BSPs. The submission and tracking process was captured as PR50. * ppc403/console/console405.c ppc403/tty_drv/.cvsignore, ppc403/tty_drv/Makefile.am, ppc403/tty_drv/tty_drv.c, ppc403/tty_drv/tty_drv.h: New files. * Makefile.am, README, configure.ac, old_exception_processing/cpu.c, old_exception_processing/cpu.h, ppc403/Makefile.am, ppc403/clock/clock.c, ppc403/console/Makefile.am, ppc403/console/console.c, ppc403/ictrl/ictrl.c, ppc403/ictrl/ictrl.h, ppc403/timer/timer.c: Modified. --- c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c | 46 +++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (limited to 'c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c') diff --git a/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c b/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c index 6ba3947bc8..eb8bcb7bd8 100644 --- a/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c +++ b/c/src/lib/libcpu/powerpc/ppc403/ictrl/ictrl.c @@ -18,6 +18,8 @@ * IMD makes no representations about the suitability * of this software for any purpose. * + * Modifications for PPC405GP by Dennis Ehlin + * */ #include "ictrl.h" @@ -41,6 +43,47 @@ rtems_isr_entry ictrl_vector_table[PPC_IRQ_EXT_MAX]; /* * clear bits in EXISR that have a bit set in mask */ +#if defined(ppc405) +RTEMS_INLINE_ROUTINE void +clr_exisr(unsigned32 mask) +{ + asm volatile ("mtdcr 0xC0,%0"::"r" (mask));/*EXISR*/ +} + +/* + * get value of EXISR + */ +RTEMS_INLINE_ROUTINE unsigned32 +get_exisr(void) +{ + unsigned32 val; + + asm volatile ("mfdcr %0,0xC0":"=r" (val));/*EXISR*/ + return val; +} + +/* + * get value of EXIER + */ +RTEMS_INLINE_ROUTINE unsigned32 +get_exier(void) +{ + unsigned32 val; + asm volatile ("mfdcr %0,0xC2":"=r" (val));/*EXIER*/ + return val; +} + +/* + * set value of EXIER + */ +RTEMS_INLINE_ROUTINE void +set_exier(unsigned32 val) +{ + asm volatile ("mtdcr 0xC2,%0"::"r" (val));/*EXIER*/ +} + +#else /* not ppc405 */ + RTEMS_INLINE_ROUTINE void clr_exisr(unsigned32 mask) { @@ -78,7 +121,7 @@ set_exier(unsigned32 val) { asm volatile ("mtdcr 0x42,%0"::"r" (val));/*EXIER*/ } - +#endif /* ppc405 */ /* * enable an external interrupt, make this interrupt consistent */ @@ -191,7 +234,6 @@ ictrl_set_vector(rtems_isr_entry new_handler, /* check for valid vector range */ if ((vector >= PPC_IRQ_EXT_BASE) && (vector < PPC_IRQ_EXT_BASE + PPC_IRQ_EXT_MAX)) { - /* return old handler entry */ *old_handler = ictrl_vector_table[vector - PPC_IRQ_EXT_BASE]; -- cgit v1.2.3