Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/include/exception.h

    r598f90e r7a0359b  
    3737
    3838#include <typedefs.h>
    39 #include <arch/istate.h>
     39#include <arch/cp0.h>
     40#include <trace.h>
    4041
    4142#define EXC_Int    0
     
    5859#define EXC_VCED   31
    5960
     61typedef struct istate {
     62        uint32_t at;
     63        uint32_t v0;
     64        uint32_t v1;
     65        uint32_t a0;
     66        uint32_t a1;
     67        uint32_t a2;
     68        uint32_t a3;
     69        uint32_t t0;
     70        uint32_t t1;
     71        uint32_t t2;
     72        uint32_t t3;
     73        uint32_t t4;
     74        uint32_t t5;
     75        uint32_t t6;
     76        uint32_t t7;
     77        uint32_t t8;
     78        uint32_t t9;
     79        uint32_t gp;
     80        uint32_t sp;
     81        uint32_t ra;
     82       
     83        uint32_t lo;
     84        uint32_t hi;
     85       
     86        uint32_t status;  /* cp0_status */
     87        uint32_t epc;     /* cp0_epc */
     88        uint32_t k1;      /* We use it as thread-local pointer */
     89} istate_t;
     90
     91NO_TRACE static inline void istate_set_retaddr(istate_t *istate,
     92    uintptr_t retaddr)
     93{
     94        istate->epc = retaddr;
     95}
     96
     97/** Return true if exception happened while in userspace */
     98NO_TRACE static inline int istate_from_uspace(istate_t *istate)
     99{
     100        return istate->status & cp0_status_um_bit;
     101}
     102
     103NO_TRACE static inline unative_t istate_get_pc(istate_t *istate)
     104{
     105        return istate->epc;
     106}
     107
     108NO_TRACE static inline unative_t istate_get_fp(istate_t *istate)
     109{
     110        /* FIXME */
     111       
     112        return 0;
     113}
     114
    60115extern void exception(istate_t *istate);
    61116extern void tlb_refill_entry(void);
Note: See TracChangeset for help on using the changeset viewer.