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

4.104.114.84.9
Last change on this file since 00d8424e was 00d8424e, checked in by Jennifer Averett <Jennifer.Averett@…>, on Apr 15, 2005 at 6:05:34 PM

2005-04-15 Jennifer Averett <jennifer.averett@…>

PR 779/bsp

  • clock/p_clock.c, irq/irq.c, irq/irq.h, irq/irq_init.c, network/network.c: add parameter to new exception interrupt handlers in powerpc bsps
  • 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                                              NULL,
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.