From b285860989cc2e4002e32005ce7e9005744bffa5 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 31 Aug 1998 23:03:45 +0000 Subject: Patch from Eric Valette : Eric> NB : there is still a bug on PC386 serial line : exit does not Eric> flush the remaining output queue. As this is not a bug in the Eric> driver itself but somewhere in PC386 initialization/termios Eric> relationship it will be part of another patch. Eric> NB2 : As Emmanuel excerced the exception hanlder code, while Eric> porting the SMC driver to the new BSD stack, we found a bug Eric> in the exception handler : it shall not delete the current Eric> thread in case we are running at interrupt level. This will Eric> be part of another patch... So here is the patch. This patch fixes the two problems mentionned above + it use vpath mechanism intead of copying the irq related files in the right directory. This avoid to compile them each time and is more homogenous with other Makefiles. --- c/src/exec/score/cpu/i386/cpu.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'c/src/exec/score/cpu/i386/cpu.c') diff --git a/c/src/exec/score/cpu/i386/cpu.c b/c/src/exec/score/cpu/i386/cpu.c index 1f0900fceb..90473bdb14 100644 --- a/c/src/exec/score/cpu/i386/cpu.c +++ b/c/src/exec/score/cpu/i386/cpu.c @@ -104,12 +104,23 @@ void _defaultExcHandler (CPU_Exception_frame *ctx) printk("Error code pushed by processor itself (if not 0) = %x\n", ctx->faultCode); printk("----------------------------------------------------------\n\n"); - printk(" ************ FAULTY THREAD WILL BE DELETED **************\n"); - /* - * OK I could probably use a simplified version but at least this - * should work. - */ - rtems_task_delete(_Thread_Executing->Object.id); + if (_ISR_Nest_level > 0) { + /* + * In this case we shall not delete the task interrupted as + * it has nothing to do with the fault. We cannot return either + * because the eip points to the faulty instruction so... + */ + printk("Exception while executing ISR!!!. System locked\n"); + while(1); + } + else { + /* + * OK I could probably use a simplified version but at least this + * should work. + */ + printk(" ************ FAULTY THREAD WILL BE DELETED **************\n"); + rtems_task_delete(_Thread_Executing->Object.id); + } } cpuExcHandlerType _currentExcHandler = _defaultExcHandler; -- cgit v1.2.3