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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [sparclite/] [arch/] [current/] [src/] [hal_intr.c] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      hal_intr.c
4
//
5
//      SPARClite Architecture specific interrupt dispatch tables
6
//
7
//==========================================================================
8
// ####ECOSGPLCOPYRIGHTBEGIN####                                            
9
// -------------------------------------------                              
10
// This file is part of eCos, the Embedded Configurable Operating System.   
11
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
12
//
13
// eCos is free software; you can redistribute it and/or modify it under    
14
// the terms of the GNU General Public License as published by the Free     
15
// Software Foundation; either version 2 or (at your option) any later      
16
// version.                                                                 
17
//
18
// eCos is distributed in the hope that it will be useful, but WITHOUT      
19
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
20
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
21
// for more details.                                                        
22
//
23
// You should have received a copy of the GNU General Public License        
24
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
25
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
26
//
27
// As a special exception, if other files instantiate templates or use      
28
// macros or inline functions from this file, or you compile this file      
29
// and link it with other works to produce a work based on this file,       
30
// this file does not by itself cause the resulting work to be covered by   
31
// the GNU General Public License. However the source code for this file    
32
// must still be made available in accordance with section (3) of the GNU   
33
// General Public License v2.                                               
34
//
35
// This exception does not invalidate any other reasons why a work based    
36
// on this file might be covered by the GNU General Public License.         
37
// -------------------------------------------                              
38
// ####ECOSGPLCOPYRIGHTEND####                                              
39
//==========================================================================
40
//#####DESCRIPTIONBEGIN####
41
//
42
// Author(s):    hmt
43
// Contributors: hmt
44
// Date:         1999-02-20
45
// Purpose:      Interrupt handler tables for SPARClite.
46
//              
47
//####DESCRIPTIONEND####
48
//
49
//==========================================================================
50
 
51
 
52
#include <cyg/hal/hal_intr.h>
53
#include <cyg/hal/hal_arch.h>
54
 
55
#include <cyg/infra/cyg_ass.h> // for CYG_FAIL() below
56
 
57
// ------------------------------------------------------------------------
58
// First level C default interrupt handler.
59
 
60
//static int count = 0;
61
 
62
cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data)
63
{
64
    return 0; // 0x1def0000 + vector + (count += 0x0100);
65
}
66
 
67
// ------------------------------------------------------------------------
68
// First level C exception handler.
69
 
70
externC void __handle_exception (void);
71
 
72
externC HAL_SavedRegisters *_hal_registers;
73
 
74
void cyg_hal_exception_handler(CYG_ADDRWORD vector, CYG_ADDRWORD data,
75
                               CYG_ADDRWORD stackpointer )
76
{
77
#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
78
    // Set the pointer to the registers of the current exception
79
    // context. At entry the GDB stub will expand the
80
    // HAL_SavedRegisters structure into a (bigger) register array.
81
    _hal_registers = (HAL_SavedRegisters *)stackpointer;
82
 
83
    __handle_exception();
84
 
85
#elif defined(CYGFUN_HAL_COMMON_KERNEL_SUPPORT) && \
86
      defined(CYGPKG_HAL_EXCEPTIONS)
87
    // We should decode the vector and pass a more appropriate
88
    // value as the second argument. For now we simply pass a
89
    // pointer to the saved registers. We should also divert
90
    // breakpoint and other debug vectors into the debug stubs.
91
 
92
    cyg_hal_deliver_exception( vector, stackpointer );
93
 
94
#else
95
    CYG_FAIL("Exception!!!");
96
#endif    
97
    return;
98
}
99
 
100
// ISR tables
101
volatile
102
CYG_ADDRESS    hal_interrupt_handlers[CYGNUM_HAL_VSR_COUNT] = {
103
    (CYG_ADDRESS)hal_default_isr,
104
    (CYG_ADDRESS)hal_default_isr,
105
    (CYG_ADDRESS)hal_default_isr,
106
    (CYG_ADDRESS)hal_default_isr,
107
 
108
    (CYG_ADDRESS)hal_default_isr,
109
    (CYG_ADDRESS)hal_default_isr,
110
    (CYG_ADDRESS)hal_default_isr,
111
    (CYG_ADDRESS)hal_default_isr,
112
 
113
    (CYG_ADDRESS)hal_default_isr,
114
    (CYG_ADDRESS)hal_default_isr,
115
    (CYG_ADDRESS)hal_default_isr,
116
    (CYG_ADDRESS)hal_default_isr,
117
 
118
    (CYG_ADDRESS)hal_default_isr,
119
    (CYG_ADDRESS)hal_default_isr,
120
    (CYG_ADDRESS)hal_default_isr,
121
    (CYG_ADDRESS)hal_default_isr,  /* 16 of these */
122
 
123
    (CYG_ADDRESS)cyg_hal_exception_handler,
124
    (CYG_ADDRESS)cyg_hal_exception_handler,
125
    (CYG_ADDRESS)cyg_hal_exception_handler,
126
    (CYG_ADDRESS)cyg_hal_exception_handler,
127
    (CYG_ADDRESS)cyg_hal_exception_handler,
128
 
129
    (CYG_ADDRESS)cyg_hal_exception_handler,
130
    (CYG_ADDRESS)cyg_hal_exception_handler,
131
    (CYG_ADDRESS)cyg_hal_exception_handler,
132
    (CYG_ADDRESS)cyg_hal_exception_handler,
133
    (CYG_ADDRESS)cyg_hal_exception_handler,
134
 
135
    (CYG_ADDRESS)cyg_hal_exception_handler, /* 11 of these */
136
};
137
 
138
volatile
139
CYG_ADDRWORD   hal_interrupt_data[CYGNUM_HAL_VSR_COUNT] = {
140
 0x11da1a00, 0x11da1a01, 0x11da1a02, 0x11da1a03,
141
 0x11da1a04, 0x11da1a05, 0x11da1a06, 0x11da1a07,
142
 0x11da1a08, 0x11da1a09, 0x11da1a0a, 0x11da1a0b,
143
 0x11da1a0c, 0x11da1a0d, 0x11da1a0e, 0x11da1a0f,
144
 0xeeda1a00, 0xeeda1a01, 0xeeda1a02, 0xeeda1a03, 0xeeda1a04,
145
 0xeeda1a05, 0xeeda1a06, 0xeeda1a07, 0xeeda1a08, 0xeeda1a09,
146
 0xeeda1a0A
147
};
148
 
149
volatile
150
CYG_ADDRESS    hal_interrupt_objects[CYGNUM_HAL_VSR_COUNT] = {
151
    0,    0,    0,    0,
152
    0,    0,    0,    0,
153
    0,    0,    0,    0,
154
    0,    0,    0,    0,
155
 
156
    0,    0,    0,    0,    0,
157
    0,    0,    0,    0,    0,
158
    0,
159
};
160
 
161
// EOF hal_intr.c

powered by: WebSVN 2.1.0

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