source: rtems/c/src/lib/libbsp/powerpc/eth_comm/clock/p_clock.c @ 4055e6f8

4.104.114.84.95
Last change on this file since 4055e6f8 was 4055e6f8, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 16, 2001 at 8:18:03 PM

2001-04-11 Eric Valette <valette@…>

  • clock/.cvsignore, clock/Makefile.am, clock/p_clock.c, include/8xx_immap.h, include/commproc.h, irq/.cvsignore, irq/Makefile.am, irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c, vectors/.cvsignore, vectors/Makefile.am, vectors/vectors.S, vectors/vectors.h, vectors/vectors_init.c: New file.
  • Switch the eth_comm BSP to use the "new exception processing model."
  • 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 <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 6;
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.