source: rtems/c/src/lib/libbsp/powerpc/score603e/include/tm27.h @ bb41881e

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

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

  • score603e/Makefile.am, score603e/configure.ac, score603e/console/console.c, score603e/include/bsp.h, score603e/include/gen2.h, score603e/include/tm27.h, score603e/startup/bspstart.c: Update score603e to new exception model NOTE: These modifications have not been tested on hardware.
  • Property mode set to 100644
File size: 1.5 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
26static rtems_irq_connect_data clockIrqData = {BSP_DECREMENTER,
27                                              0,
28                                              (rtems_irq_enable)nullFunc,
29                                              (rtems_irq_disable)nullFunc,
30                                              (rtems_irq_is_enabled) nullFunc};
31void Install_tm27_vector(void (*_handler)())
32{
33  clockIrqData.hdl = _handler;
34  if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
35        printk("Error installing clock interrupt handler!\n");
36        rtems_fatal_error_occurred(1);
37  }
38}
39
40#define Cause_tm27_intr()  \
41  do { \
42    uint32_t   _clicks = 8; \
43    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
44  } while (0)
45
46#define Clear_tm27_intr() \
47  do { \
48    uint32_t   _clicks = 0xffffffff; \
49    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
50  } while (0)
51
52#define Lower_tm27_intr() \
53  do { \
54    uint32_t   _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
61#endif
Note: See TracBrowser for help on using the repository browser.