xref: /OK3568_Linux_fs/u-boot/arch/nios2/cpu/traps.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
3*4882a593Smuzhiyun  * Scott McNutt <smcnutt@psyent.com>
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * SPDX-License-Identifier:	GPL-2.0+
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #include <asm/ptrace.h>
9*4882a593Smuzhiyun #include <common.h>
10*4882a593Smuzhiyun 
trap_handler(struct pt_regs * regs)11*4882a593Smuzhiyun void trap_handler (struct pt_regs *regs)
12*4882a593Smuzhiyun {
13*4882a593Smuzhiyun 	/* Just issue warning */
14*4882a593Smuzhiyun 	printf ("\n\n*** WARNING: unimplemented trap @ %08x\n\n",
15*4882a593Smuzhiyun 			regs->reg[29] - 4);
16*4882a593Smuzhiyun }
17*4882a593Smuzhiyun 
soft_emulation(struct pt_regs * regs)18*4882a593Smuzhiyun void soft_emulation (struct pt_regs *regs)
19*4882a593Smuzhiyun {
20*4882a593Smuzhiyun 	/* TODO: Software emulation of mul/div etc. Until this is
21*4882a593Smuzhiyun 	 * implemented, generate warning and hang.
22*4882a593Smuzhiyun 	 */
23*4882a593Smuzhiyun 	printf ("\n\n*** ERROR: unimplemented instruction @ %08x\n",
24*4882a593Smuzhiyun 			regs->reg[29] - 4);
25*4882a593Smuzhiyun 	hang ();
26*4882a593Smuzhiyun }
27