source: rtems/c/src/lib/libbsp/powerpc/psim/include/tm27.h @ 62f529f

4.104.114.84.95
Last change on this file since 62f529f was 62f529f, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/23/04 at 02:36:08

2004-04-22 Ralf Corsepius <ralf_corsepius@…>

  • include/bsp.h: Split out tmtest27 support.
  • include/tm27.h: New.
  • Property mode set to 100644
File size: 1.0 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 _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/*
19 *  Stuff for Time Test 27
20 */
21
22#define MUST_WAIT_FOR_INTERRUPT 1
23
24#define Install_tm27_vector( _handler ) \
25  set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 )
26
27#define Cause_tm27_intr()  \
28  do { \
29    uint32_t   _clicks = 1; \
30    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
31  } while (0)
32
33#define Clear_tm27_intr() \
34  do { \
35    uint32_t   _clicks = 0xffffffff; \
36    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
37  } while (0)
38
39#define Lower_tm27_intr() \
40  do { \
41    uint32_t   _msr = 0; \
42    _ISR_Set_level( 0 ); \
43    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
44    _msr |=  0x8002; \
45    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
46  } while (0)
47
48#endif
Note: See TracBrowser for help on using the repository browser.