1*c978b524SChris Zankel /* 2*c978b524SChris Zankel * (C) Copyright 2008 - 2013 Tensilica Inc. 3*c978b524SChris Zankel * (C) Copyright 2014 - 2016 Cadence Design Systems Inc. 4*c978b524SChris Zankel * 5*c978b524SChris Zankel * SPDX-License-Identifier: GPL-2.0+ 6*c978b524SChris Zankel */ 7*c978b524SChris Zankel 8*c978b524SChris Zankel /* 9*c978b524SChris Zankel * Exception handling. 10*c978b524SChris Zankel * We currently don't handle any exception and force a reset. 11*c978b524SChris Zankel * (Note that alloca is a special case and handled in start.S) 12*c978b524SChris Zankel */ 13*c978b524SChris Zankel 14*c978b524SChris Zankel #include <common.h> 15*c978b524SChris Zankel #include <command.h> 16*c978b524SChris Zankel #include <asm/string.h> 17*c978b524SChris Zankel #include <asm/regs.h> 18*c978b524SChris Zankel 19*c978b524SChris Zankel typedef void (*handler_t)(struct pt_regs *); 20*c978b524SChris Zankel unhandled_exception(struct pt_regs * regs)21*c978b524SChris Zankelvoid unhandled_exception(struct pt_regs *regs) 22*c978b524SChris Zankel { 23*c978b524SChris Zankel printf("Unhandled Exception: EXCCAUSE = %ld, EXCVADDR = %lx, pc = %lx\n", 24*c978b524SChris Zankel regs->exccause, regs->excvaddr, regs->pc); 25*c978b524SChris Zankel panic("*** PANIC\n"); 26*c978b524SChris Zankel } 27*c978b524SChris Zankel 28*c978b524SChris Zankel handler_t exc_table[EXCCAUSE_LAST] = { 29*c978b524SChris Zankel [0 ... EXCCAUSE_LAST-1] = unhandled_exception, 30*c978b524SChris Zankel }; 31*c978b524SChris Zankel interrupt_init(void)32*c978b524SChris Zankelint interrupt_init(void) 33*c978b524SChris Zankel { 34*c978b524SChris Zankel return 0; 35*c978b524SChris Zankel } 36*c978b524SChris Zankel enable_interrupts(void)37*c978b524SChris Zankelvoid enable_interrupts(void) 38*c978b524SChris Zankel { 39*c978b524SChris Zankel } 40*c978b524SChris Zankel disable_interrupts(void)41*c978b524SChris Zankelint disable_interrupts(void) 42*c978b524SChris Zankel { 43*c978b524SChris Zankel return 0; 44*c978b524SChris Zankel } 45