source: rtems/c/src/lib/libbsp/powerpc/psim/include/tm27.h @ 270ce1ff

4.104.114.84.95
Last change on this file since 270ce1ff was 270ce1ff, checked in by Jennifer Averett <Jennifer.Averett@…>, on Nov 22, 2004 at 10:13:35 PM

2004-11-22 Jennifer Averett <jennifer@…>

PR 581/bsps

  • Makefile.am, bsp_specs, configure.ac, include/bsp.h, include/tm27.h, start/start.S, startup/bspstart.c, startup/linkcmds, tools/Makefile.am, tools/psim, vectors/vectors.S, wrapup/Makefile.am: Convert PSIM to new exception model.
  • irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c: New files.
  • startup/setvec.c, timer/timer.c: Removed.
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 *  tm27.h
3 *
4 *  The license and distribution terms for this file may be
5 *  found in the file LICENSE in this distribution or at
6 *  http://www.rtems.com/license/LICENSE.
7 *
8 *  $Id$
9 */
10
11#ifndef _RTEMS_TMTEST27
12#error "This is an RTEMS internal file you must not include directly."
13#endif
14
15#ifndef __tm27_h
16#define __tm27_h
17
18#include <bsp/irq.h>
19
20/*
21 *  Stuff for Time Test 27
22 */
23
24#define MUST_WAIT_FOR_INTERRUPT 1
25
26void nullFunc() {}
27static rtems_irq_connect_data clockIrqData = {BSP_DECREMENTER,
28                                              0,
29                                              (rtems_irq_enable)nullFunc,
30                                              (rtems_irq_disable)nullFunc,
31                                              (rtems_irq_is_enabled) nullFunc};
32
33void Install_tm27_vector(void (*_handler)())
34{
35  clockIrqData.hdl = _handler;
36  if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
37        printk("Error installing clock interrupt handler!\n");
38        rtems_fatal_error_occurred(1);
39  }
40}
41
42#define Cause_tm27_intr()  \
43  do { \
44    unsigned32 _clicks = 1; \
45    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
46  } while (0)
47
48
49#define Clear_tm27_intr() \
50  do { \
51    unsigned32 _clicks = 0xffffffff; \
52    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
53  } while (0)
54
55#define Lower_tm27_intr() \
56  do { \
57    unsigned32 _msr = 0; \
58    _ISR_Set_level( 0 ); \
59    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
60    _msr |=  0x8002; \
61    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
62  } while (0)
63
64#endif
Note: See TracBrowser for help on using the repository browser.