source: rtems/c/src/lib/libbsp/powerpc/ss555/clock/p_clock.c @ 125c601

4.104.114.84.95
Last change on this file since 125c601 was 125c601, checked in by Jennifer Averett <Jennifer.Averett@…>, on Apr 25, 2005 at 2:46:37 PM

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

PR 779/bsp

  • clock/p_clock.c: Add parameter to powerpc exception handler routines
  • 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 *  SS555 port sponsored by Defence Research and Development Canada - Suffield
12 *  Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
13 *
14 *  Derived from c/src/lib/libbsp/powerpc/mbx8xx/clock/p_clock.c:
15 *
16 *  Modified to support the MPC750.
17 *  Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr
18 *
19 *  $Id$
20 */
21
22#include <bsp.h>
23#include <bsp/irq.h>
24#include <rtems/bspIo.h>
25
26extern void clockOn(void*);
27extern void clockOff (void*);
28extern int clockIsOn(void*);
29extern void Clock_isr(void *);
30
31static rtems_irq_connect_data clockIrqData = {
32  CPU_PERIODIC_TIMER,
33  (rtems_irq_hdl)Clock_isr,
34  NULL,
35  (rtems_irq_enable)clockOn,
36  (rtems_irq_disable)clockOff,
37  (rtems_irq_is_enabled)clockIsOn
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 = CPU_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.