source: rtems/cpukit/score/cpu/lm32/rtems/score/lm32.h @ b999676a

4.115
Last change on this file since b999676a was b999676a, checked in by Joel Sherrill <joel.sherrill@…>, on 08/20/10 at 21:24:16

2010-08-20 <yann.sionneau@…>

  • rtems/score/lm32.h: Add lm32_read_interrupts().
  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*  lm32.h
2 *
3 *  This file sets up basic CPU dependency settings based on
4 *  compiler settings.  For example, it can determine if
5 *  floating point is available.  This particular implementation
6 *  is specified to the NO CPU port.
7 *
8 *
9 *  COPYRIGHT (c) 1989-1999.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 *
16 *  $Id$
17 *
18 *  Jukka Pietarinen <jukka.pietarinen@mrf.fi>, 2008,
19 *  Micro-Research Finland Oy
20 */
21
22#ifndef _RTEMS_SCORE_LM32_H
23#define _RTEMS_SCORE_LM32_H
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/*
30 *  This file contains the information required to build
31 *  RTEMS for a particular member of the NO CPU family.
32 *  It does this by setting variables to indicate which
33 *  implementation dependent features are present in a particular
34 *  member of the family.
35 *
36 *  This is a good place to list all the known CPU models
37 *  that this port supports and which RTEMS CPU model they correspond
38 *  to.
39 */
40
41#if defined(rtems_multilib)
42/*
43 *  Figure out all CPU Model Feature Flags based upon compiler
44 *  predefines.
45 */
46
47#define CPU_MODEL_NAME  "rtems_multilib"
48#define LM32_HAS_FPU     0
49
50#elif defined(__lm32__)
51
52#define CPU_MODEL_NAME  "lm32"
53#define LM32_HAS_FPU     0
54
55#else
56
57#error "Unsupported CPU Model"
58
59#endif
60
61/*
62 *  Define the name of the CPU family.
63 */
64
65#define CPU_NAME "LM32"
66
67#ifdef __cplusplus
68}
69#endif
70
71#define lm32_read_interrupts( _ip) \
72  asm volatile ("rcsr %0, ip":"=r"(_ip));
73
74#define lm32_disable_interrupts( _level ) \
75  do { register uint32_t ie; \
76    asm volatile ("rcsr %0,ie":"=r"(ie)); \
77    _level = ie; \
78    ie &= (~0x0001); \
79    asm volatile ("wcsr ie,%0"::"r"(ie)); \
80  } while (0)
81
82#define lm32_enable_interrupts( _level ) \
83  asm volatile ("wcsr ie,%0"::"r"(_level));
84
85#define lm32_flash_interrupts( _level ) \
86  do { register uint32_t ie; \
87    asm volatile ("wcsr ie,%0"::"r"(_level)); \
88    ie = _level & (~0x0001); \
89    asm volatile ("wcsr ie,%0"::"r"(ie)); \
90  } while (0)
91
92#define lm32_interrupt_unmask( _mask ) \
93  do { register uint32_t im; \
94    asm volatile ("rcsr %0,im":"=r"(im)); \
95    im |= _mask; \
96    asm volatile ("wcsr im,%0"::"r"(im)); \
97  } while (0)
98
99#define lm32_interrupt_mask( _mask ) \
100  do { register uint32_t im; \
101    asm volatile ("rcsr %0,im":"=r"(im)); \
102    im &= ~_mask; \
103    asm volatile ("wcsr im,%0"::"r"(im)); \
104  } while (0)
105
106#define lm32_interrupt_ack( _mask ) \
107  do { register uint32_t ip = _mask; \
108    asm volatile ("wcsr ip,%0"::"r"(ip)); \
109  } while (0)
110
111#endif /* _RTEMS_SCORE_LM32_H */
Note: See TracBrowser for help on using the repository browser.