Changeset 874621f in mainline for arch/mips32


Ignore:
Timestamp:
2006-06-06T07:40:51Z (19 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/mips32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • arch/mips32/include/arg.h

    r6f9a9bc r874621f  
    4545        (((type *)((ap) = (va_list)( (sizeof(type) <= 4) ? ((__address)((ap) + 2*4 - 1) & (~3)) : ((__address)((ap) + 2*8 -1) & (~7)) )))[-1])
    4646
     47#define va_copy(dst,src) ((dst)=(src))
     48
    4749#define va_end(ap)
    4850
  • arch/mips32/include/exception.h

    r6f9a9bc r874621f  
    3535
    3636#include <typedefs.h>
     37#include <arch/cp0.h>
    3738
    3839#define EXC_Int         0
     
    99100}
    100101
     102/** Return true if exception happened while in userspace */
     103static inline int istate_from_uspace(istate_t *istate)
     104{
     105        return istate->status & cp0_status_um_bit;
     106}
     107static inline __native istate_get_pc(istate_t *istate)
     108{
     109        return istate->epc;
     110}
     111
    101112extern void exception(istate_t *istate);
    102113extern void tlb_refill_entry(void);
  • arch/mips32/src/exception.c

    r6f9a9bc r874621f  
    7979static void unhandled_exception(int n, istate_t *istate)
    8080{
     81        fault_if_from_uspace(istate, "unhandled exception %s", exctable[n]);
     82       
    8183        print_regdump(istate);
    8284        panic("unhandled exception %s\n", exctable[n]);
     
    120122        if (cp0_cause_coperr(cp0_cause_read()) == fpu_cop_id)
    121123                scheduler_fpu_lazy_request();
    122         else
     124        else {
     125                fault_if_from_uspace(istate, "unhandled Coprocessor Unusable Exception");
    123126                panic("unhandled Coprocessor Unusable Exception\n");
     127        }
    124128}
    125129#endif
  • arch/mips32/src/mm/tlb.c

    r6f9a9bc r874621f  
    4040#include <debug.h>
    4141#include <align.h>
     42#include <interrupt.h>
    4243
    4344static void tlb_refill_fail(istate_t *istate);
     
    337338        if (s)
    338339                sym2 = s;
     340
     341        fault_if_from_uspace(istate, "TLB Refill Exception on %P", cp0_badvaddr_read());
    339342        panic("%X: TLB Refill Exception at %X(%s<-%s)\n", cp0_badvaddr_read(), istate->epc, symbol, sym2);
    340343}
     
    348351        if (s)
    349352                symbol = s;
     353        fault_if_from_uspace(istate, "TLB Invalid Exception on %P", cp0_badvaddr_read());
    350354        panic("%X: TLB Invalid Exception at %X(%s)\n", cp0_badvaddr_read(), istate->epc, symbol);
    351355}
     
    358362        if (s)
    359363                symbol = s;
     364        fault_if_from_uspace(istate, "TLB Modified Exception on %P", cp0_badvaddr_read());
    360365        panic("%X: TLB Modified Exception at %X(%s)\n", cp0_badvaddr_read(), istate->epc, symbol);
    361366}
Note: See TracChangeset for help on using the changeset viewer.