source: rtems/c/src/lib/libbsp/powerpc/mbx8xx/clock/p_clock.c @ 182712f7

4.104.114.84.95
Last change on this file since 182712f7 was 182712f7, checked in by Joel Sherrill <joel.sherrill@…>, on 10/12/01 at 21:07:01

2001-10-12 Joel Sherrill <joel@…>

  • clock/p_clock.c, include/bsp.h, include/coverhd.h, startup/bspstart.c, startup/bspstart.c.nocache, startup/setvec.c, startup/start.S: Fixed typo.
  • 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.OARcorp.com/rtems/license.html.
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 <bsp/irq.h>
19
20extern void clockOn(void*);
21extern void clockOff (void*);
22extern int clockIsOn(void*);
23extern void Clock_isr();
24
25static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER,
26                                              (rtems_irq_hdl)Clock_isr,
27                                              (rtems_irq_enable)clockOn,
28                                              (rtems_irq_disable)clockOff,
29                                              (rtems_irq_is_enabled)clockIsOn};
30                                             
31int BSP_get_clock_irq_level()
32{
33  /*
34   * Caution : if you change this, you must change the
35   * definition of BSP_PERIODIC_TIMER accordingly
36   */
37  return 6;
38}
39
40int BSP_disconnect_clock_handler (void)
41{
42  if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
43     printk("Unable to stop system clock\n");
44    rtems_fatal_error_occurred(1);
45  }
46  return BSP_remove_rtems_irq_handler (&clockIrqData);
47}
48
49int BSP_connect_clock_handler (rtems_irq_hdl hdl)
50{
51  if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) {
52     printk("Unable to get system clock handler\n");
53    rtems_fatal_error_occurred(1);
54  }
55  if (!BSP_remove_rtems_irq_handler (&clockIrqData)) {
56   printk("Unable to remove current system clock handler\n");
57    rtems_fatal_error_occurred(1);
58  }
59  /*
60   * Reinit structure
61   */
62  clockIrqData.name = BSP_PERIODIC_TIMER;
63  clockIrqData.hdl = (rtems_irq_hdl) hdl;
64  clockIrqData.on = (rtems_irq_enable)clockOn;
65  clockIrqData.off = (rtems_irq_enable)clockOff;
66  clockIrqData.isOn = (rtems_irq_is_enabled)clockIsOn;
67 
68  return BSP_install_rtems_irq_handler (&clockIrqData);
69}
Note: See TracBrowser for help on using the repository browser.