From: Philip Homburg Date: Mon, 23 Apr 2007 13:19:25 +0000 (+0000) Subject: Prototypes for exception and stacktrace. Declare additional arguments X-Git-Tag: v3.1.4~428 X-Git-Url: http://zhaoyanbai.com/repos/icons/debian/static/man.7.ps?a=commitdiff_plain;h=bc17115a342e7e943e1f07e5177c3c3dac9e6ff7;p=minix.git Prototypes for exception and stacktrace. Declare additional arguments for exception to be able to print nexted exceptions. --- diff --git a/kernel/arch/i386/exception.c b/kernel/arch/i386/exception.c index df98dd4e1..e3ee95fac 100755 --- a/kernel/arch/i386/exception.c +++ b/kernel/arch/i386/exception.c @@ -4,13 +4,19 @@ */ #include "../../kernel.h" +#include "proto.h" #include #include "../../proc.h" /*===========================================================================* * exception * *===========================================================================*/ -PUBLIC void exception(unsigned vec_nr) +PUBLIC void exception(vec_nr, trap_errno, old_eip, old_cs, old_eflags) +unsigned vec_nr; +u32_t trap_errno; +u32_t old_eip; +U16_t old_cs; +u32_t old_eflags; { /* An exception or unexpected interrupt has occurred. */ @@ -84,6 +90,10 @@ PUBLIC void exception(unsigned vec_nr) kprintf("process %d (%s), ", proc_nr(saved_proc), saved_proc->p_name); kprintf("pc = %u:0x%x", (unsigned) saved_proc->p_reg.cs, (unsigned) saved_proc->p_reg.pc); + kprintf( + "vec_nr= %d, trap_errno= 0x%lx, eip= 0x%lx, cs= 0x%x, eflags= 0x%lx\n", + vec_nr, (unsigned long)trap_errno, + (unsigned long)old_eip, old_cs, (unsigned long)old_eflags); panic("exception in a kernel task", NO_NUM); } diff --git a/kernel/arch/i386/proto.h b/kernel/arch/i386/proto.h index 06eecd09f..0530bf35a 100644 --- a/kernel/arch/i386/proto.h +++ b/kernel/arch/i386/proto.h @@ -44,6 +44,11 @@ _PROTOTYPE( void trp, (void) ); _PROTOTYPE( void s_call, (void) ), _PROTOTYPE( p_s_call, (void) ); _PROTOTYPE( void level0_call, (void) ); +/* exception.c */ +_PROTOTYPE( void exception, (unsigned vec_nr, u32_t trap_errno, + u32_t old_eip, U16_t old_cs, u32_t old_eflags) ); +_PROTOTYPE( void stacktrace, (struct proc *proc) ); + /* klib386.s */ _PROTOTYPE( void level0, (void (*func)(void)) ); _PROTOTYPE( void monitor, (void) );