summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/eth_comm/clock/p_clock.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-04-16 20:18:03 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-04-16 20:18:03 +0000
commit4055e6f86f2649e40e5f3a49c3c5459e55e57002 (patch)
tree72013f4ad7ef0c816fba7aef32efac0227f3f02d /c/src/lib/libbsp/powerpc/eth_comm/clock/p_clock.c
parent2001-04-16 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-4055e6f86f2649e40e5f3a49c3c5459e55e57002.tar.bz2
2001-04-11 Eric Valette <valette@crf.canon.fr>
* clock/.cvsignore, clock/Makefile.am, clock/p_clock.c, include/8xx_immap.h, include/commproc.h, irq/.cvsignore, irq/Makefile.am, irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c, vectors/.cvsignore, vectors/Makefile.am, vectors/vectors.S, vectors/vectors.h, vectors/vectors_init.c: New file. * Switch the eth_comm BSP to use the "new exception processing model."
Diffstat (limited to 'c/src/lib/libbsp/powerpc/eth_comm/clock/p_clock.c')
-rw-r--r--c/src/lib/libbsp/powerpc/eth_comm/clock/p_clock.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/eth_comm/clock/p_clock.c b/c/src/lib/libbsp/powerpc/eth_comm/clock/p_clock.c
new file mode 100644
index 0000000000..327919f7f9
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/eth_comm/clock/p_clock.c
@@ -0,0 +1,70 @@
+/*
+ * Clock Tick interrupt conexion code.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * Modified to support the MPC750.
+ * Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+#include <bsp/irq.h>
+
+extern void clockOn(void*);
+extern void clockOff (void*);
+extern int clockIsOn(void*);
+extern void Clock_isr();
+
+static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER,
+ (rtems_irq_hdl)Clock_isr,
+ (rtems_irq_enable)clockOn,
+ (rtems_irq_disable)clockOff,
+ (rtems_irq_is_enabled)clockIsOn};
+
+int BSP_get_clock_irq_level()
+{
+ /*
+ * Caution : if you change this, you must change the
+ * definition of BSP_PERIODIC_TIMER accordingly
+ */
+ return 6;
+}
+
+int BSP_disconnect_clock_handler (void)
+{
+ if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
+ printk("Unable to stop system clock\n");
+ rtems_fatal_error_occurred(1);
+ }
+ return BSP_remove_rtems_irq_handler (&clockIrqData);
+}
+
+int BSP_connect_clock_handler (rtems_irq_hdl hdl)
+{
+ if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
+ printk("Unable to get system clock handler\n");
+ rtems_fatal_error_occurred(1);
+ }
+ if (!BSP_remove_rtems_irq_handler (&clockIrqData)) {
+ printk("Unable to remove current system clock handler\n");
+ rtems_fatal_error_occurred(1);
+ }
+ /*
+ * Reinit structure
+ */
+ clockIrqData.name = BSP_PERIODIC_TIMER;
+ clockIrqData.hdl = (rtems_irq_hdl) hdl;
+ clockIrqData.on = (rtems_irq_enable)clockOn;
+ clockIrqData.off = (rtems_irq_enable)clockOff;
+ clockIrqData.isOn = (rtems_irq_is_enabled)clockIsOn;
+
+ return BSP_install_rtems_irq_handler (&clockIrqData);
+}