OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [mips/] [rm7000/] [var/] [v2_0/] [include/] [var_intr.h] - Blame information for rev 174

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
#ifndef CYGONCE_HAL_VAR_INTR_H
2
#define CYGONCE_HAL_VAR_INTR_H
3
 
4
//==========================================================================
5
//
6
//      imp_intr.h
7
//
8
//      RM7000 Interrupt and clock support
9
//
10
//==========================================================================
11
//####ECOSGPLCOPYRIGHTBEGIN####
12
// -------------------------------------------
13
// This file is part of eCos, the Embedded Configurable Operating System.
14
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
15
//
16
// eCos is free software; you can redistribute it and/or modify it under
17
// the terms of the GNU General Public License as published by the Free
18
// Software Foundation; either version 2 or (at your option) any later version.
19
//
20
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
21
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
22
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
23
// for more details.
24
//
25
// You should have received a copy of the GNU General Public License along
26
// with eCos; if not, write to the Free Software Foundation, Inc.,
27
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28
//
29
// As a special exception, if other files instantiate templates or use macros
30
// or inline functions from this file, or you compile this file and link it
31
// with other works to produce a work based on this file, this file does not
32
// by itself cause the resulting work to be covered by the GNU General Public
33
// License. However the source code for this file must still be made available
34
// in accordance with section (3) of the GNU General Public License.
35
//
36
// This exception does not invalidate any other reasons why a work based on
37
// this file might be covered by the GNU General Public License.
38
//
39
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
40
// at http://sources.redhat.com/ecos/ecos-license/
41
// -------------------------------------------
42
//####ECOSGPLCOPYRIGHTEND####
43
//==========================================================================
44
//#####DESCRIPTIONBEGIN####
45
//
46
// Author(s):    jskov
47
// Contributors: jskov
48
// Date:         2000-05-09
49
// Purpose:      RM7000 Interrupt support
50
// Description:  The macros defined here provide the HAL APIs for handling
51
//               interrupts and the clock for variants of the RM7000 MIPS
52
//               architecture.
53
//              
54
// Usage:
55
//              #include <cyg/hal/var_intr.h>
56
//              ...
57
//              
58
//
59
//####DESCRIPTIONEND####
60
//
61
//==========================================================================
62
 
63
#include <pkgconf/hal.h>
64
 
65
#include <cyg/hal/plf_intr.h>
66
 
67
//--------------------------------------------------------------------------
68
// Interrupt controller information
69
 
70
#ifndef CYGHWR_HAL_INTERRUPT_CONTROLLER_ACCESS_DEFINED
71
#define HAL_INTERRUPT_MASK( _vector_ )                                      \
72
    CYG_MACRO_START                                                         \
73
    if( (_vector_) <= CYGNUM_HAL_INTERRUPT_COMPARE )                        \
74
    {                                                                       \
75
        asm volatile (                                                      \
76
            "mfc0   $3,$12\n"                                               \
77
            "la     $2,0x00000400\n"                                        \
78
            "sllv   $2,$2,%0\n"                                             \
79
            "nor    $2,$2,$0\n"                                             \
80
            "and    $3,$3,$2\n"                                             \
81
            "mtc0   $3,$12\n"                                               \
82
            "nop; nop; nop\n"                                               \
83
            :                                                               \
84
            : "r"(_vector_)                                                 \
85
            : "$2", "$3"                                                    \
86
            );                                                              \
87
    }                                                                       \
88
    else                                                                    \
89
    {                                                                       \
90
        /* int 6:9 are masked in the Interrupt Control register */          \
91
        asm volatile (                                                      \
92
            "cfc0   $3,$20\n"                                               \
93
            "la     $2,0x00000004\n"                                        \
94
            "sllv   $2,$2,%0\n"                                             \
95
            "nor    $2,$2,$0\n"                                             \
96
            "and    $3,$3,$2\n"                                             \
97
            "ctc0   $3,$20\n"                                               \
98
            "nop; nop; nop\n"                                               \
99
            :                                                               \
100
            : "r"((_vector_) )                                              \
101
            : "$2", "$3"                                                    \
102
            );                                                              \
103
    }                                                                       \
104
    CYG_MACRO_END
105
 
106
#define HAL_INTERRUPT_UNMASK( _vector_ )                                    \
107
    CYG_MACRO_START                                                         \
108
    if( (_vector_) <= CYGNUM_HAL_INTERRUPT_COMPARE )                        \
109
    {                                                                       \
110
        asm volatile (                                                      \
111
            "mfc0   $3,$12\n"                                               \
112
            "la     $2,0x00000400\n"                                        \
113
            "sllv   $2,$2,%0\n"                                             \
114
            "or     $3,$3,$2\n"                                             \
115
            "mtc0   $3,$12\n"                                               \
116
            "nop; nop; nop\n"                                               \
117
            :                                                               \
118
            : "r"(_vector_)                                                 \
119
            : "$2", "$3"                                                    \
120
            );                                                              \
121
    }                                                                       \
122
    else                                                                    \
123
    {                                                                       \
124
        /* int 6:9 are masked in the Interrupt Control register */          \
125
        asm volatile (                                                      \
126
            "cfc0   $3,$20\n"                                               \
127
            "la     $2,0x00000004\n"                                        \
128
            "sllv   $2,$2,%0\n"                                             \
129
            "or     $3,$3,$2\n"                                             \
130
            "ctc0   $3,$20\n"                                               \
131
            "nop; nop; nop\n"                                               \
132
            :                                                               \
133
            : "r"((_vector_) )                                              \
134
            : "$2", "$3"                                                    \
135
            );                                                              \
136
    }                                                                       \
137
    CYG_MACRO_END
138
 
139
#define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ )                           \
140
    CYG_MACRO_START                                                     \
141
    /* All 10 interrupts have pending bits in the cause register */     \
142
    cyg_uint32 _srvector_ = _vector_;                                   \
143
    asm volatile (                                                      \
144
        "mfc0   $3,$13\n"                                               \
145
        "la     $2,0x00000400\n"                                        \
146
        "sllv   $2,$2,%0\n"                                             \
147
        "nor    $2,$2,$0\n"                                             \
148
        "and    $3,$3,$2\n"                                             \
149
        "mtc0   $3,$13\n"                                               \
150
        "nop; nop; nop\n"                                               \
151
        :                                                               \
152
        : "r"(_srvector_)                                               \
153
        : "$2", "$3"                                                    \
154
        );                                                              \
155
    CYG_MACRO_END
156
 
157
#define HAL_INTERRUPT_CONFIGURE( _vector_, _level_, _up_ )
158
 
159
#define HAL_INTERRUPT_SET_LEVEL( _vector_, _level_ )
160
 
161
#define CYGHWR_HAL_INTERRUPT_CONTROLLER_ACCESS_DEFINED
162
 
163
#endif
164
 
165
//--------------------------------------------------------------------------
166
// Interrupt vectors.
167
 
168
// Vectors and handling of these are defined in platform HALs since the
169
// CPU itself does not have a builtin interrupt controller.
170
 
171
//--------------------------------------------------------------------------
172
// Clock control
173
 
174
// This is handled by the default code
175
 
176
//--------------------------------------------------------------------------
177
#endif // ifndef CYGONCE_HAL_VAR_INTR_H
178
// End of var_intr.h

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.