Changes in kernel/arch/arm32/include/exception.h [7a0359b:d99c1d2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/exception.h
r7a0359b rd99c1d2 28 28 */ 29 29 30 /** @addtogroup arm32 30 /** @addtogroup arm32 31 31 * @{ 32 32 */ … … 40 40 #include <typedefs.h> 41 41 #include <arch/regutils.h> 42 #include <trace.h>43 42 44 43 /** If defined, forces using of high exception vectors. */ … … 46 45 47 46 #ifdef HIGH_EXCEPTION_VECTORS 48 #define EXC_BASE_ADDRESS 47 #define EXC_BASE_ADDRESS 0xffff0000 49 48 #else 50 #define EXC_BASE_ADDRESS 49 #define EXC_BASE_ADDRESS 0x0 51 50 #endif 52 51 53 52 /* Exception Vectors */ 54 #define EXC_RESET_VEC 55 #define EXC_UNDEF_INSTR_VEC 56 #define EXC_SWI_VEC 57 #define EXC_PREFETCH_ABORT_VEC 58 #define EXC_DATA_ABORT_VEC 59 #define EXC_IRQ_VEC 60 #define EXC_FIQ_VEC 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) 61 60 62 61 /* Exception numbers */ … … 69 68 #define EXC_FIQ 6 70 69 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 *76 75 */ 77 76 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 *84 83 */ 85 84 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 /** Set Program Counter member of given istate structure. 110 111 /** Sets Program Counter member of given istate structure. 111 112 * 112 * @param istate 113 * @param istate istate structure 113 114 * @param retaddr new value of istate's PC member 114 *115 115 */ 116 NO_TRACE static inline void istate_set_retaddr(istate_t *istate, 117 uintptr_t retaddr) 116 static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) 118 117 { 119 istate->pc = retaddr;118 istate->pc = retaddr; 120 119 } 121 120 122 /** Return true if exception happened while in userspace. */ 123 NO_TRACE static inline int istate_from_uspace(istate_t *istate) 121 122 /** Returns true if exception happened while in userspace. */ 123 static inline int istate_from_uspace(istate_t *istate) 124 124 { 125 return (istate->spsr & STATUS_REG_MODE_MASK) == USER_MODE;125 return (istate->spsr & STATUS_REG_MODE_MASK) == USER_MODE; 126 126 } 127 127 128 /** Return Program Counter member of given istate structure. */ 129 NO_TRACE static inline unative_t istate_get_pc(istate_t *istate) 128 129 /** Returns Program Counter member of given istate structure. */ 130 static inline unative_t istate_get_pc(istate_t *istate) 130 131 { 131 return istate->pc;132 return istate->pc; 132 133 } 133 134 134 NO_TRACEstatic inline unative_t istate_get_fp(istate_t *istate)135 static inline unative_t istate_get_fp(istate_t *istate) 135 136 { 136 137 return istate->fp; 137 138 } 138 139 140 139 141 extern void install_exception_handlers(void); 140 142 extern void exception_init(void); 143 extern void print_istate(istate_t *istate); 141 144 extern void reset_exception_entry(void); 142 145 extern void irq_exception_entry(void); … … 147 150 extern void swi_exception_entry(void); 148 151 152 149 153 #endif 150 154
Note:
See TracChangeset
for help on using the changeset viewer.