source: rtems/c/src/lib/libbsp/powerpc/ep1a/include/tm27.h @ 5134f172

4.115
Last change on this file since 5134f172 was 5134f172, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/11/11 at 12:44:30

2011-02-11 Ralf Corsépius <ralf.corsepius@…>

  • console/console.c, console/ns16550cfg.c, console/polled_io.c, include/bsp.h, include/tm27.h, startup/bspstart.c: Use "asm" instead of "asm" for improved c99-compliance.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2008.
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    uint32_t _clicks = 8; \
42    __asm__ volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
43  } while (0)
44
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#endif
Note: See TracBrowser for help on using the repository browser.