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

4.104.114.84.95
Last change on this file since 0bebe52 was 0bebe52, checked in by Joel Sherrill <joel.sherrill@…>, on 01/04/02 at 17:40:52

2002-01-03 Ralf Corsepius <corsepiu@…>

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