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

4.104.114.84.95
Last change on this file since 5edbffe was 5edbffe, checked in by Joel Sherrill <joel.sherrill@…>, on 10/22/01 at 14:46:02

01-10-22 Andy Dachs <a.dachs@…>

  • mpc8260ads added as new BSP. tm27 reported not to run at this time.
  • ChangeLog?, Makefile.am, README, aclocal.m4, bsp_specs, clock/.cvsignore, clock/Makefile.am, clock/p_clock.c, configure.in, console/Makefile.am, console/console.c, include/Makefile.am, include/bsp.h, include/coverhd.h, irq/.cvsignore, irq/Makefile.am, irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c, network/Makefile.am, network/README, network/if_hdlcsubr.c, network/if_hdlcsubr.h, network/network.c, start/Makefile.am, start/start.S, startup/Makefile.am, startup/bspstart.c, startup/cpuinit.c, startup/linkcmds, startup/setvec.c, times, vectors/.cvsignore, vectors/Makefile.am, vectors/vectors.S, vectors/vectors.h, vectors/vectors_init.c, wrapup/Makefile.am: New files.
  • 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 <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.