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


Ignore:
Timestamp:
2010-07-02T14:19:30Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
89c57b6
Parents:
fe7abd0 (diff), e3ee9b9 (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 mainline changes.

File:
1 edited

Legend:

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

    rfe7abd0 rcefb126  
    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=%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);
    8284}
    8385
     
    9496{
    9597        fault_if_from_uspace(istate, "Unserviced interrupt: %u.", n);
    96        
    97         decode_istate(istate);
    98         panic("Unserviced interrupt: %u.", n);
     98        panic_badtrap(istate, n, "Unserviced interrupt: %u.", n);
    9999}
    100100
     
    102102{
    103103        fault_if_from_uspace(istate, "Divide error.");
    104        
    105         decode_istate(istate);
    106         panic("Divide error.");
     104        panic_badtrap(istate, n, "Divide error.");
    107105}
    108106
     
    128126                fault_if_from_uspace(istate, "General protection fault.");
    129127        }
    130        
    131         decode_istate(istate);
    132         panic("General protection fault.");
     128        panic_badtrap(istate, n, "General protection fault.");
    133129}
    134130
     
    136132{
    137133        fault_if_from_uspace(istate, "Stack fault.");
    138        
    139         decode_istate(istate);
    140         panic("Stack fault.");
     134        panic_badtrap(istate, n, "Stack fault.");
    141135}
    142136
     
    149143        );
    150144       
    151         fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR: %#zx.",
     145        fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR=%#0.8x.",
    152146            (unative_t) mxcsr);
    153        
    154         decode_istate(istate);
    155         printf("MXCSR: %#lx\n", mxcsr);
    156         panic("SIMD FP exception(19).");
     147        panic_badtrap(istate, n, "SIMD FP exception, MXCSR=%#0.8x");
    157148}
    158149
     
    164155#else
    165156        fault_if_from_uspace(istate, "FPU fault.");
    166         panic("FPU fault.");
     157        panic_badtrap(istate, n, "FPU fault.");
    167158#endif
    168159}
Note: See TracChangeset for help on using the changeset viewer.