diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-19 06:35:52 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-20 09:57:01 +0200 |
commit | 7632906fc290b652416ab59eb5fb49356c064ed6 (patch) | |
tree | ac036b1f95637e044e10138ceea8d2b56d80ec97 /bsps/powerpc/tqm8xx | |
parent | bsps: Move bspsmpgetcurrentprocessor.c to bsps (diff) | |
download | rtems-7632906fc290b652416ab59eb5fb49356c064ed6.tar.bz2 |
bsps: Move clock drivers to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
Diffstat (limited to 'bsps/powerpc/tqm8xx')
-rw-r--r-- | bsps/powerpc/tqm8xx/clock/p_clock.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/bsps/powerpc/tqm8xx/clock/p_clock.c b/bsps/powerpc/tqm8xx/clock/p_clock.c new file mode 100644 index 0000000000..4ee201a3b2 --- /dev/null +++ b/bsps/powerpc/tqm8xx/clock/p_clock.c @@ -0,0 +1,58 @@ +/* + * Clock Tick interrupt conexion code. + */ + +/* + * COPYRIGHT (c) 1989-1997. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may in + * the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + * + * Modified to support the MPC750. + * Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr + */ + +#include <bsp.h> +#include <bsp/irq-generic.h> +#include <rtems/bspIo.h> + +extern void clockOn(void*); +extern void clockOff (void*); +extern int clockIsOn(void*); +extern void Clock_isr(void*); + +static void BSP_clock_hdl(void * arg) +{ + Clock_isr(arg); +} + +int BSP_disconnect_clock_handler (void) +{ + rtems_status_code sc; + + clockOff(NULL); + /* + * remove interrupt handler + */ + sc = rtems_interrupt_handler_remove(BSP_PERIODIC_TIMER, + BSP_clock_hdl,NULL); + + return sc == RTEMS_SUCCESSFUL; +} + +int BSP_connect_clock_handler (rtems_irq_hdl hdl) +{ + rtems_status_code sc; + /* + * install interrupt handler + */ + sc = rtems_interrupt_handler_install(BSP_PERIODIC_TIMER, + "PIT clock",0, + BSP_clock_hdl,NULL); + if (sc == RTEMS_SUCCESSFUL) { + clockOn(NULL); + } + return sc == RTEMS_SUCCESSFUL; +} |