2 * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
3 * Scott McNutt <smcnutt@psyent.com>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 #include <asm/opcodes.h>
37 /* SAVE ALL REGS -- this allows trap and unimplemented
38 * instruction handlers to be coded conveniently in C
76 /* If interrupts are disabled -- software interrupt */
81 /* If no interrupts are pending -- software interrupt */
85 /* HARDWARE INTERRUPT: Call interrupt handler */
86 movhi r3, %hi(external_interrupt)
87 ori r3, r3, %lo(external_interrupt)
88 mov r4, sp /* ptr to regs */
91 /* Return address fixup: execution resumes by re-issue of
92 * interrupted instruction at ea-4 (ea == r29). Here we do
93 * simple fixup to allow common exception return.
102 movhi r3, %hi(OPC_TRAP)
103 ori r3, r3, %lo(OPC_TRAP)
107 movhi r3, %hi(trap_handler)
108 ori r3, r3, %lo(trap_handler)
109 mov r4, sp /* ptr to regs */
114 /* UNIMPLEMENTED INSTRUCTION EXCEPTION */
115 movhi r3, %hi(soft_emulation)
116 ori r3, r3, %lo(soft_emulation)
117 mov r4, sp /* ptr to regs */
120 /* Restore regsisters and return from exception*/
155 /*-------------------------------------------------------------*/