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


Ignore:
Timestamp:
2010-06-26T12:00:12Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
38e5675b
Parents:
8e374ea7
Message:

Switch ia32 to use the unified panic architecture.

File:
1 edited

Legend:

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

    r8e374ea7 r62baed17  
    6565void decode_istate(istate_t *istate)
    6666{
    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);
     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.