Ignore:
File:
1 edited

Legend:

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

    rc9eb31c2 r214ec25c  
    6363void (* eoi_function)(void) = NULL;
    6464
    65 void istate_decode(istate_t *istate)
    66 {
    67         printf("error_word=%p\n", istate->error_word);
    68         printf("eflags=%p\n", istate->eflags);
    69 
    70         printf("cs =%p\tds =%p\tes =%p\n", istate->cs, istate->ds, istate->es);
    71         printf("fs =%p\tgs =%p", istate->fs, istate->gs);
    72         if (istate_from_uspace(istate))
    73                 printf("\tss =%p\n", istate->ss);
    74         else
    75                 printf("\n");
    76 
    77         printf("eax=%p\tebx=%p\tecx=%p\n", istate->eax, istate->ebx,
    78             istate->ecx);
    79         printf("edx=%p\tedi=%p\tesi=%p\n", istate->edx, istate->edi,
    80             istate->esi);
    81         printf("ebp=%p\tesp=%p\teip=%p\n", istate->ebp,
    82             istate_from_uspace(istate) ? istate->esp : (uintptr_t) &istate->esp,
    83             istate->eip);
     65void 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);
    8482}
    8583
     
    9694{
    9795        fault_if_from_uspace(istate, "Unserviced interrupt: %u.", n);
    98         panic_badtrap(istate, n, "Unserviced interrupt: %u.", n);
     96       
     97        decode_istate(istate);
     98        panic("Unserviced interrupt: %u.", n);
    9999}
    100100
     
    102102{
    103103        fault_if_from_uspace(istate, "Divide error.");
    104         panic_badtrap(istate, n, "Divide error.");
     104       
     105        decode_istate(istate);
     106        panic("Divide error.");
    105107}
    106108
     
    126128                fault_if_from_uspace(istate, "General protection fault.");
    127129        }
    128         panic_badtrap(istate, n, "General protection fault.");
     130       
     131        decode_istate(istate);
     132        panic("General protection fault.");
    129133}
    130134
     
    132136{
    133137        fault_if_from_uspace(istate, "Stack fault.");
    134         panic_badtrap(istate, n, "Stack fault.");
     138       
     139        decode_istate(istate);
     140        panic("Stack fault.");
    135141}
    136142
     
    143149        );
    144150       
    145         fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR=%#0.8x.",
     151        fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR: %#zx.",
    146152            (unative_t) mxcsr);
    147         panic_badtrap(istate, n, "SIMD FP exception, MXCSR=%#0.8x");
     153       
     154        decode_istate(istate);
     155        printf("MXCSR: %#lx\n", mxcsr);
     156        panic("SIMD FP exception(19).");
    148157}
    149158
     
    155164#else
    156165        fault_if_from_uspace(istate, "FPU fault.");
    157         panic_badtrap(istate, n, "FPU fault.");
     166        panic("FPU fault.");
    158167#endif
    159168}
Note: See TracChangeset for help on using the changeset viewer.