Changeset 62baed17 in mainline


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.

Location:
kernel/arch/ia32
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/Makefile.inc

    r8e374ea7 r62baed17  
    7676ARCH_SOURCES = \
    7777        arch/$(KARCH)/src/context.S \
    78         arch/$(KARCH)/src/debug/panic.s \
    7978        arch/$(KARCH)/src/debug/stacktrace.c \
    8079        arch/$(KARCH)/src/debug/stacktrace_asm.S \
  • kernel/arch/ia32/src/asm.S

    r8e374ea7 r62baed17  
    163163        pushl %edi      # remember return user address
    164164
     165        xorl %ebp, %ebp # stop stack traces here
     166
    165167        pushl %gs       # remember TLS
    166168
     
    196198# and call exc_dispatch().
    197199#
    198 #define INTERRUPT_ALIGN 64
     200#define INTERRUPT_ALIGN 128
    199201.macro handler i n
    200202       
     
    224226                movw %ax, %ds
    225227                movw %ax, %es
    226                
     228       
     229                xorl %ebp, %ebp
     230
    227231                cld
    228232                sti
     
    230234                call syscall_handler
    231235                cli
    232                 addl $28, %esp         # clean-up of parameters
     236
     237                movl 20(%esp), %ebp     # restore EBP
     238                addl $28, %esp          # clean-up of parameters
    233239               
    234240                popl %gs
     
    280286                movw %ax, %es
    281287               
    282                 # stop stack traces here
     288                # stop stack traces here if we came from userspace
     289                cmpl $8, 40(%esp)
     290                jz 0f
    283291                xorl %ebp, %ebp
    284                
     292
     2930:             
    285294                pushl %esp          # *istate
    286295                pushl $(\i)         # intnum
  • 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}
  • kernel/arch/ia32/src/mm/page.c

    r8e374ea7 r62baed17  
    115115        if (as_page_fault(page, access, istate) == AS_PF_FAULT) {
    116116                fault_if_from_uspace(istate, "Page fault: %#x.", page);
    117                
    118                 decode_istate(istate);
    119                 printf("page fault address: %#lx\n", page);
    120                 panic("Page fault.");
     117                panic_memtrap(istate, access, page, "Page fault.");
    121118        }
    122119}
Note: See TracChangeset for help on using the changeset viewer.