2 * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
3 * Scott McNutt <smcnutt@psyent.com>
5 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/opcodes.h>
21 /* SAVE ALL REGS -- this allows trap and unimplemented
22 * instruction handlers to be coded conveniently in C
60 /* If interrupts are disabled -- software interrupt */
65 /* If no interrupts are pending -- software interrupt */
69 /* HARDWARE INTERRUPT: Call interrupt handler */
70 movhi r3, %hi(external_interrupt)
71 ori r3, r3, %lo(external_interrupt)
72 mov r4, sp /* ptr to regs */
75 /* Return address fixup: execution resumes by re-issue of
76 * interrupted instruction at ea-4 (ea == r29). Here we do
77 * simple fixup to allow common exception return.
86 movhi r3, %hi(OPC_TRAP)
87 ori r3, r3, %lo(OPC_TRAP)
91 movhi r3, %hi(trap_handler)
92 ori r3, r3, %lo(trap_handler)
93 mov r4, sp /* ptr to regs */
98 /* UNIMPLEMENTED INSTRUCTION EXCEPTION */
99 movhi r3, %hi(soft_emulation)
100 ori r3, r3, %lo(soft_emulation)
101 mov r4, sp /* ptr to regs */
104 /* Restore regsisters and return from exception*/
139 /*-------------------------------------------------------------*/