source: rtems/c/src/lib/libbsp/powerpc/mpc8260ads/clock/p_clock.c @ f05b2ac

4.104.114.84.9
Last change on this file since f05b2ac was 6128a4a, checked in by Ralf Corsepius <ralf.corsepius@…>, on Apr 21, 2004 at 10:43:04 AM

Remove stray white spaces.

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  Clock Tick interrupt conexion code.
3 *
4 *  COPYRIGHT (c) 1989-1997.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may in
8 *  the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  Modified to support the MPC750.
12 *  Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr
13 *
14 *  $Id$
15 */
16
17#include <bsp.h>
18#include <rtems/bspIo.h>
19#include <bsp/irq.h>
20
21extern void clockOn(void*);
22extern void clockOff (void*);
23extern int clockIsOn(void*);
24extern void Clock_isr();
25
26static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER,
27                                              (rtems_irq_hdl)Clock_isr,
28                                              (rtems_irq_enable)clockOn,
29                                              (rtems_irq_disable)clockOff,
30                                              (rtems_irq_is_enabled)clockIsOn};
31
32int BSP_get_clock_irq_level()
33{
34  /*
35   * Caution : if you change this, you must change the
36   * definition of BSP_PERIODIC_TIMER accordingly
37   */
38  return BSP_PERIODIC_TIMER;
39}
40
41int BSP_disconnect_clock_handler (void)
42{
43  if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
44     printk("Unable to stop system clock\n");
45    rtems_fatal_error_occurred(1);
46  }
47  return BSP_remove_rtems_irq_handler (&clockIrqData);
48}
49
50int BSP_connect_clock_handler (rtems_irq_hdl hdl)
51{
52  if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
53     printk("Unable to get system clock handler\n");
54    rtems_fatal_error_occurred(1);
55  }
56  if (!BSP_remove_rtems_irq_handler (&clockIrqData)) {
57   printk("Unable to remove current system clock handler\n");
58    rtems_fatal_error_occurred(1);
59  }
60  /*
61   * Reinit structure
62   */
63  clockIrqData.name = BSP_PERIODIC_TIMER;
64  clockIrqData.hdl = (rtems_irq_hdl) hdl;
65  clockIrqData.on = (rtems_irq_enable)clockOn;
66  clockIrqData.off = (rtems_irq_enable)clockOff;
67  clockIrqData.isOn = (rtems_irq_is_enabled)clockIsOn;
68
69  return BSP_install_rtems_irq_handler (&clockIrqData);
70}
Note: See TracBrowser for help on using the repository browser.