Changes in kernel/arch/arm32/include/exception.h [22a28a69:7a0359b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/exception.h
r22a28a69 r7a0359b 40 40 #include <typedefs.h> 41 41 #include <arch/regutils.h> 42 #include <trace.h> 42 43 43 44 /** If defined, forces using of high exception vectors. */ … … 45 46 46 47 #ifdef HIGH_EXCEPTION_VECTORS 47 #define EXC_BASE_ADDRESS 48 #define EXC_BASE_ADDRESS 0xffff0000 48 49 #else 49 #define EXC_BASE_ADDRESS 50 #define EXC_BASE_ADDRESS 0x0 50 51 #endif 51 52 52 53 /* Exception Vectors */ 53 #define EXC_RESET_VEC (EXC_BASE_ADDRESS + 0x0)54 #define EXC_UNDEF_INSTR_VEC (EXC_BASE_ADDRESS + 0x4)55 #define EXC_SWI_VEC (EXC_BASE_ADDRESS + 0x8)56 #define EXC_PREFETCH_ABORT_VEC (EXC_BASE_ADDRESS + 0xc)57 #define EXC_DATA_ABORT_VEC (EXC_BASE_ADDRESS + 0x10)58 #define EXC_IRQ_VEC (EXC_BASE_ADDRESS + 0x18)59 #define EXC_FIQ_VEC (EXC_BASE_ADDRESS + 0x1c)54 #define EXC_RESET_VEC (EXC_BASE_ADDRESS + 0x0) 55 #define EXC_UNDEF_INSTR_VEC (EXC_BASE_ADDRESS + 0x4) 56 #define EXC_SWI_VEC (EXC_BASE_ADDRESS + 0x8) 57 #define EXC_PREFETCH_ABORT_VEC (EXC_BASE_ADDRESS + 0xc) 58 #define EXC_DATA_ABORT_VEC (EXC_BASE_ADDRESS + 0x10) 59 #define EXC_IRQ_VEC (EXC_BASE_ADDRESS + 0x18) 60 #define EXC_FIQ_VEC (EXC_BASE_ADDRESS + 0x1c) 60 61 61 62 /* Exception numbers */ … … 68 69 #define EXC_FIQ 6 69 70 70 71 71 /** Kernel stack pointer. 72 72 * 73 73 * It is set when thread switches to user mode, 74 74 * and then used for exception handling. 75 * 75 76 */ 76 77 extern uintptr_t supervisor_sp; 77 78 78 79 79 /** Temporary exception stack pointer. … … 81 81 * Temporary stack is used in exceptions handling routines 82 82 * before switching to thread's kernel stack. 83 * 83 84 */ 84 85 extern uintptr_t exc_stack; 85 86 86 87 87 /** Struct representing CPU state saved when an exception occurs. */ … … 90 90 uint32_t sp; 91 91 uint32_t lr; 92 92 93 93 uint32_t r0; 94 94 uint32_t r1; … … 104 104 uint32_t fp; 105 105 uint32_t r12; 106 106 107 107 uint32_t pc; 108 108 } istate_t; 109 109 110 111 /** Sets Program Counter member of given istate structure. 110 /** Set Program Counter member of given istate structure. 112 111 * 113 * @param istate istate structure112 * @param istate istate structure 114 113 * @param retaddr new value of istate's PC member 114 * 115 115 */ 116 static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) 116 NO_TRACE static inline void istate_set_retaddr(istate_t *istate, 117 uintptr_t retaddr) 117 118 { 118 119 istate->pc = retaddr; 119 120 } 120 121 121 122 /** Returns true if exception happened while in userspace. */ 123 static inline int istate_from_uspace(istate_t *istate) 122 /** Return true if exception happened while in userspace. */ 123 NO_TRACE static inline int istate_from_uspace(istate_t *istate) 124 124 { 125 125 return (istate->spsr & STATUS_REG_MODE_MASK) == USER_MODE; 126 126 } 127 127 128 129 /** Returns Program Counter member of given istate structure. */ 130 static inline unative_t istate_get_pc(istate_t *istate) 128 /** Return Program Counter member of given istate structure. */ 129 NO_TRACE static inline unative_t istate_get_pc(istate_t *istate) 131 130 { 132 131 return istate->pc; 133 132 } 134 133 135 static inline unative_t istate_get_fp(istate_t *istate)134 NO_TRACE static inline unative_t istate_get_fp(istate_t *istate) 136 135 { 137 136 return istate->fp; 138 137 } 139 140 138 141 139 extern void install_exception_handlers(void); … … 149 147 extern void swi_exception_entry(void); 150 148 151 152 149 #endif 153 150
Note:
See TracChangeset
for help on using the changeset viewer.