source: rtems/c/src/lib/libbsp/powerpc/ep1a/include/tm27.h @ 0329aae

4.104.114.84.95
Last change on this file since 0329aae was 0329aae, checked in by Jennifer Averett <Jennifer.Averett@…>, on 04/28/05 at 14:05:14

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

  • acinclude.m4: Initial release of ep1a bsp
  • ep1a/Makefile.am, ep1a/bsp_specs, ep1a/configure.ac, ep1a/console/alloc360.c, ep1a/console/console.c, ep1a/console/console.h, ep1a/console/init68360.c, ep1a/console/m68360.h, ep1a/console/mc68360_scc.c, ep1a/console/ns16550cfg.c, ep1a/console/ns16550cfg.h, ep1a/console/rsPMCQ1.c, ep1a/console/rsPMCQ1.h, ep1a/include/bsp.h, ep1a/irq/irq.c, ep1a/irq/irq_init.c, ep1a/pci/no_host_bridge.c, ep1a/start/start.S, ep1a/startup/bspstart.c, ep1a/startup/linkcmds, ep1a/vme/vmeconfig.c: New files.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-1999.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#ifndef _RTEMS_TMTEST27
13#error "This is an RTEMS internal file you must not include directly."
14#endif
15
16#ifndef __tm27_h
17#define __tm27_h
18
19#include <bsp/irq.h>
20
21#define MUST_WAIT_FOR_INTERRUPT 1
22
23void nullFunc() {}
24
25static rtems_irq_connect_data clockIrqData = {BSP_DECREMENTER,
26                                              0,
27                                              (rtems_irq_enable)nullFunc,
28                                              (rtems_irq_disable)nullFunc,
29                                              (rtems_irq_is_enabled) nullFunc};
30void Install_tm27_vector(void (*_handler)())
31{
32  clockIrqData.hdl = _handler;
33  if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
34        printk("Error installing clock interrupt handler!\n");
35        rtems_fatal_error_occurred(1);
36  }
37}
38
39#define Cause_tm27_intr()  \
40  do { \
41    unsigned32 _clicks = 8; \
42    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
43  } while (0)
44
45
46#define Clear_tm27_intr() \
47  do { \
48    unsigned32 _clicks = 0xffffffff; \
49    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
50   } while (0)
51
52#define Lower_tm27_intr() \
53  do { \
54    unsigned32 _msr = 0; \
55    _ISR_Set_level( 0 ); \
56    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
57    _msr |=  0x8002; \
58    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
59  } while (0)
60#endif
Note: See TracBrowser for help on using the repository browser.