Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:59

0001 /*
0002  *  Clock Tick interrupt conexion code.
0003  */
0004 
0005 /*
0006  *  COPYRIGHT (c) 1989-1997.
0007  *  On-Line Applications Research Corporation (OAR).
0008  *
0009  *  The license and distribution terms for this file may in
0010  *  the file LICENSE in this distribution or at
0011  *  http://www.rtems.org/license/LICENSE.
0012  *
0013  *  Modified to support the MPC750.
0014  *  Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr
0015  */
0016 
0017 #include <bsp.h>
0018 #include <bsp/irq-generic.h>
0019 #include <rtems/bspIo.h>
0020 
0021 extern void clockOn(void*);
0022 extern void clockOff (void*);
0023 extern int clockIsOn(void*);
0024 extern void Clock_isr(void*);
0025 
0026 static void BSP_clock_hdl(void * arg)
0027 {
0028   Clock_isr(arg);
0029 }
0030 
0031 int BSP_disconnect_clock_handler (void)
0032 {
0033   rtems_status_code sc;
0034 
0035   clockOff(NULL);
0036   /*
0037    * remove interrupt handler
0038    */
0039   sc = rtems_interrupt_handler_remove(BSP_PERIODIC_TIMER,
0040                       BSP_clock_hdl,NULL);
0041 
0042   return sc == RTEMS_SUCCESSFUL;
0043 }
0044 
0045 int BSP_connect_clock_handler (rtems_irq_hdl hdl)
0046 {
0047   rtems_status_code sc;
0048   /*
0049    * install interrupt handler
0050    */
0051   sc = rtems_interrupt_handler_install(BSP_PERIODIC_TIMER,
0052                        "PIT clock",0,
0053                        BSP_clock_hdl,NULL);
0054   if (sc == RTEMS_SUCCESSFUL) {
0055     clockOn(NULL);
0056   }
0057   return sc == RTEMS_SUCCESSFUL;
0058 }