Changeset 7a0359b in mainline for kernel/arch/mips32/include/exception.h
- Timestamp:
- 2010-07-02T15:42:19Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bbfdf62
- Parents:
- e3ee9b9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/include/exception.h
re3ee9b9 r7a0359b 27 27 */ 28 28 29 /** @addtogroup mips32 29 /** @addtogroup mips32 30 30 * @{ 31 31 */ … … 38 38 #include <typedefs.h> 39 39 #include <arch/cp0.h> 40 #include <trace.h> 40 41 41 #define EXC_Int 42 #define EXC_Mod 43 #define EXC_TLBL 44 #define EXC_TLBS 45 #define EXC_AdEL 46 #define EXC_AdES 47 #define EXC_IBE 48 #define EXC_DBE 49 #define EXC_Sys 50 #define EXC_Bp 51 #define EXC_RI 52 #define EXC_CpU 53 #define EXC_Ov 54 #define EXC_Tr 55 #define EXC_VCEI 56 #define EXC_FPE 57 #define EXC_WATCH 58 #define EXC_VCED 42 #define EXC_Int 0 43 #define EXC_Mod 1 44 #define EXC_TLBL 2 45 #define EXC_TLBS 3 46 #define EXC_AdEL 4 47 #define EXC_AdES 5 48 #define EXC_IBE 6 49 #define EXC_DBE 7 50 #define EXC_Sys 8 51 #define EXC_Bp 9 52 #define EXC_RI 10 53 #define EXC_CpU 11 54 #define EXC_Ov 12 55 #define EXC_Tr 13 56 #define EXC_VCEI 14 57 #define EXC_FPE 15 58 #define EXC_WATCH 23 59 #define EXC_VCED 31 59 60 60 61 typedef struct istate { … … 82 83 uint32_t lo; 83 84 uint32_t hi; 84 85 uint32_t status; /* cp0_status */86 uint32_t epc; /* cp0_epc */87 uint32_t k1; /* We use it as thread-local pointer */85 86 uint32_t status; /* cp0_status */ 87 uint32_t epc; /* cp0_epc */ 88 uint32_t k1; /* We use it as thread-local pointer */ 88 89 } istate_t; 89 90 90 static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) 91 NO_TRACE static inline void istate_set_retaddr(istate_t *istate, 92 uintptr_t retaddr) 91 93 { 92 94 istate->epc = retaddr; … … 94 96 95 97 /** Return true if exception happened while in userspace */ 96 static inline int istate_from_uspace(istate_t *istate)98 NO_TRACE static inline int istate_from_uspace(istate_t *istate) 97 99 { 98 100 return istate->status & cp0_status_um_bit; 99 101 } 100 static inline unative_t istate_get_pc(istate_t *istate) 102 103 NO_TRACE static inline unative_t istate_get_pc(istate_t *istate) 101 104 { 102 105 return istate->epc; 103 106 } 104 static inline unative_t istate_get_fp(istate_t *istate) 107 108 NO_TRACE static inline unative_t istate_get_fp(istate_t *istate) 105 109 { 106 return 0; /* FIXME */ 110 /* FIXME */ 111 112 return 0; 107 113 } 108 114
Note:
See TracChangeset
for help on using the changeset viewer.