Changeset 874621f in mainline for arch/ia32


Ignore:
Timestamp:
2006-06-06T07:40:51Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0dbc4e7
Parents:
6f9a9bc
Message:

Added kernel circular buffer klog.
Added automatic killing of tasks raising inappropriate exceptions.
TODO Fix vsnprintf return value(and behaviour according to specs) and remove workaround in klog.

Location:
arch/ia32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/include/interrupt.h

    r6f9a9bc r874621f  
    8484};
    8585
     86/** Return true if exception happened while in userspace */
     87static inline int istate_from_uspace(istate_t *istate)
     88{
     89        return !(istate->eip & 0x80000000);
     90}
     91
    8692static inline void istate_set_retaddr(istate_t *istate, __address retaddr)
    8793{
    8894        istate->eip = retaddr;
     95}
     96
     97static inline __native istate_get_pc(istate_t *istate)
     98{
     99        return istate->eip;
    89100}
    90101
  • arch/ia32/src/interrupt.c

    r6f9a9bc r874621f  
    8080void null_interrupt(int n, istate_t *istate)
    8181{
     82        fault_if_from_uspace(istate, "unserviced interrupt: %d", n);
     83
    8284        PRINT_INFO_ERRCODE(istate);
    8385        panic("unserviced interrupt: %d\n", n);
     
    105107                        return;
    106108                }
     109                fault_if_from_uspace(istate, "general protection fault");
    107110        }
    108111
     
    113116void ss_fault(int n, istate_t *istate)
    114117{
     118        fault_if_from_uspace(istate, "stack fault");
     119
    115120        PRINT_INFO_ERRCODE(istate);
    116121        panic("stack fault\n");
     
    119124void simd_fp_exception(int n, istate_t *istate)
    120125{
    121 
    122         PRINT_INFO_ERRCODE(istate);
    123126        __u32 mxcsr;
    124127        asm
     
    127130                :"=m"(mxcsr)
    128131        );
     132        fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR: %#zX",
     133                             (__native)mxcsr);
     134
     135        PRINT_INFO_ERRCODE(istate);
    129136        printf("MXCSR: %#zX\n",(__native)(mxcsr));
    130137        panic("SIMD FP exception(19)\n");
     
    136143        scheduler_fpu_lazy_request();
    137144#else
     145        fault_if_from_uspace(istate, "fpu fault");
    138146        panic("fpu fault");
    139147#endif
  • arch/ia32/src/mm/page.c

    r6f9a9bc r874621f  
    104104
    105105        if (as_page_fault(page, access, istate) == AS_PF_FAULT) {
     106                fault_if_from_uspace(istate, "Page fault: %#x", page);
     107
    106108                PRINT_INFO_ERRCODE(istate);
    107109                printf("page fault address: %#x\n", page);
Note: See TracChangeset for help on using the changeset viewer.