1 //==========================================================================
5 // SPARC Architecture specific interrupt dispatch tables
7 //==========================================================================
8 //####ECOSGPLCOPYRIGHTBEGIN####
9 // -------------------------------------------
10 // This file is part of eCos, the Embedded Configurable Operating System.
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
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 version.
17 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 // You should have received a copy of the GNU General Public License along
23 // with eCos; if not, write to the Free Software Foundation, Inc.,
24 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
26 // As a special exception, if other files instantiate templates or use macros
27 // or inline functions from this file, or you compile this file and link it
28 // with other works to produce a work based on this file, this file does not
29 // by itself cause the resulting work to be covered by the GNU General Public
30 // License. However the source code for this file must still be made available
31 // in accordance with section (3) of the GNU General Public License.
33 // This exception does not invalidate any other reasons why a work based on
34 // this file might be covered by the GNU General Public License.
36 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37 // at http://sources.redhat.com/ecos/ecos-license/
38 // -------------------------------------------
39 //####ECOSGPLCOPYRIGHTEND####
40 //==========================================================================
41 //#####DESCRIPTIONBEGIN####
46 // Purpose: Interrupt handler tables for SPARC.
48 //####DESCRIPTIONEND####
50 //==========================================================================
53 #include <cyg/hal/hal_intr.h>
54 #include <cyg/hal/hal_arch.h>
56 #include <cyg/infra/cyg_ass.h> // for CYG_FAIL() below
58 // ------------------------------------------------------------------------
59 // First level C default interrupt handler.
61 //static int count = 0;
63 cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data)
65 return 0; // 0x1def0000 + vector + (count += 0x0100);
68 // ------------------------------------------------------------------------
69 // First level C exception handler.
71 externC void __handle_exception (void);
73 externC HAL_SavedRegisters *_hal_registers;
75 void cyg_hal_exception_handler(CYG_ADDRWORD vector, CYG_ADDRWORD data,
76 CYG_ADDRWORD stackpointer )
78 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
79 // Set the pointer to the registers of the current exception
80 // context. At entry the GDB stub will expand the
81 // HAL_SavedRegisters structure into a (bigger) register array.
82 _hal_registers = (HAL_SavedRegisters *)stackpointer;
86 #elif defined(CYGFUN_HAL_COMMON_KERNEL_SUPPORT) && \
87 defined(CYGPKG_HAL_EXCEPTIONS)
88 // We should decode the vector and pass a more appropriate
89 // value as the second argument. For now we simply pass a
90 // pointer to the saved registers. We should also divert
91 // breakpoint and other debug vectors into the debug stubs.
93 cyg_hal_deliver_exception( vector, stackpointer );
96 CYG_FAIL("Exception!!!");
103 CYG_ADDRESS hal_interrupt_handlers[CYGNUM_HAL_VSR_COUNT] = {
104 (CYG_ADDRESS)hal_default_isr,
105 (CYG_ADDRESS)hal_default_isr,
106 (CYG_ADDRESS)hal_default_isr,
107 (CYG_ADDRESS)hal_default_isr,
109 (CYG_ADDRESS)hal_default_isr,
110 (CYG_ADDRESS)hal_default_isr,
111 (CYG_ADDRESS)hal_default_isr,
112 (CYG_ADDRESS)hal_default_isr,
114 (CYG_ADDRESS)hal_default_isr,
115 (CYG_ADDRESS)hal_default_isr,
116 (CYG_ADDRESS)hal_default_isr,
117 (CYG_ADDRESS)hal_default_isr,
119 (CYG_ADDRESS)hal_default_isr,
120 (CYG_ADDRESS)hal_default_isr,
121 (CYG_ADDRESS)hal_default_isr,
122 (CYG_ADDRESS)hal_default_isr, /* 16 of these */
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 (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 (CYG_ADDRESS)cyg_hal_exception_handler,
136 (CYG_ADDRESS)cyg_hal_exception_handler, /* 11 of these */
140 CYG_ADDRWORD hal_interrupt_data[CYGNUM_HAL_VSR_COUNT] = {
141 0x11da1a00, 0x11da1a01, 0x11da1a02, 0x11da1a03,
142 0x11da1a04, 0x11da1a05, 0x11da1a06, 0x11da1a07,
143 0x11da1a08, 0x11da1a09, 0x11da1a0a, 0x11da1a0b,
144 0x11da1a0c, 0x11da1a0d, 0x11da1a0e, 0x11da1a0f,
145 0xeeda1a00, 0xeeda1a01, 0xeeda1a02, 0xeeda1a03, 0xeeda1a04,
146 0xeeda1a05, 0xeeda1a06, 0xeeda1a07, 0xeeda1a08, 0xeeda1a09,
151 CYG_ADDRESS hal_interrupt_objects[CYGNUM_HAL_VSR_COUNT] = {