Changeset e3038b4 in mainline for kernel/arch/ia32/src/interrupt.c


Ignore:
Timestamp:
2010-06-28T22:45:51Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
49eb681
Parents:
05e3cb8 (diff), e4a4b44 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge unified panic architecture (Phase 1).

Note that this is still work in progress as there are the following sharp edges:

  • imprecise detection of read/write accesses on some architectures
  • missing or imperfect capability to print stack traces on some architectures
  • istate_t on some architectures may contain too little valuable information
  • basically all trap frames need to be reorganized to look like a normal stack frame on the stack trace so that there are no missing frames
  • panic_common() could print more information about the current context such as the task name, thread name, ASID etc.
  • functions that call panic_*() should be protected against inlining to avoid missing or confusing stack frames in the stack trace
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/interrupt.c

    r05e3cb8 re3038b4  
    6363void (* eoi_function)(void) = NULL;
    6464
    65 void decode_istate(istate_t *istate)
    66 {
    67         const char *symbol = symtab_fmt_name_lookup(istate->eip);
    68        
    69         if (CPU)
    70                 printf("----------------EXCEPTION OCCURED (cpu%u)----------------\n", CPU->id);
    71         else
    72                 printf("----------------EXCEPTION OCCURED----------------\n");
    73        
    74         printf("%%eip: %#lx (%s)\n", istate->eip, symbol);
    75         printf("ERROR_WORD=%#lx\n", istate->error_word);
    76         printf("%%cs=%#lx,flags=%#lx\n", istate->cs, istate->eflags);
    77         printf("%%eax=%#lx, %%ecx=%#lx, %%edx=%#lx, %%esp=%p\n", istate->eax, istate->ecx, istate->edx, &istate->stack[0]);
    78         printf("stack: %#lx, %#lx, %#lx, %#lx\n", istate->stack[0], istate->stack[1], istate->stack[2], istate->stack[3]);
    79         printf("       %#lx, %#lx, %#lx, %#lx\n", istate->stack[4], istate->stack[5], istate->stack[6], istate->stack[7]);
    80        
    81         stack_trace_istate(istate);
     65void istate_decode(istate_t *istate)
     66{
     67        printf("error_word=%#lx\n", istate->error_word);
     68        printf("cs =%#0.8lx\teflags=%#0.8lx\n", istate->cs, istate->eflags);
     69        printf("eax=%#0.8lx\tecx=%#0.8lx\tedx=%#0.8lx\n",
     70            istate->eax, istate->ecx, istate->edx);
    8271}
    8372
     
    9483{
    9584        fault_if_from_uspace(istate, "Unserviced interrupt: %u.", n);
    96        
    97         decode_istate(istate);
    98         panic("Unserviced interrupt: %u.", n);
     85        panic_badtrap(istate, n, "Unserviced interrupt: %u.", n);
    9986}
    10087
     
    10289{
    10390        fault_if_from_uspace(istate, "Divide error.");
    104        
    105         decode_istate(istate);
    106         panic("Divide error.");
     91        panic_badtrap(istate, n, "Divide error.");
    10792}
    10893
     
    128113                fault_if_from_uspace(istate, "General protection fault.");
    129114        }
    130        
    131         decode_istate(istate);
    132         panic("General protection fault.");
     115        panic_badtrap(istate, n, "General protection fault.");
    133116}
    134117
     
    136119{
    137120        fault_if_from_uspace(istate, "Stack fault.");
    138        
    139         decode_istate(istate);
    140         panic("Stack fault.");
     121        panic_badtrap(istate, n, "Stack fault.");
    141122}
    142123
     
    149130        );
    150131       
    151         fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR: %#zx.",
     132        fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR=%#0.8x.",
    152133            (unative_t) mxcsr);
    153        
    154         decode_istate(istate);
    155         printf("MXCSR: %#lx\n", mxcsr);
    156         panic("SIMD FP exception(19).");
     134        panic_badtrap(istate, n, "SIMD FP exception, MXCSR=%#0.8x");
    157135}
    158136
     
    164142#else
    165143        fault_if_from_uspace(istate, "FPU fault.");
    166         panic("FPU fault.");
     144        panic_badtrap(istate, n, "FPU fault.");
    167145#endif
    168146}
Note: See TracChangeset for help on using the changeset viewer.