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