Changeset 89c57b6 in mainline for kernel/arch/arm32/include/exception.h
- Timestamp:
- 2011-04-13T14:45:41Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 88634420
- Parents:
- cefb126 (diff), 17279ead (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
kernel/arch/arm32/include/exception.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/exception.h
rcefb126 r89c57b6 39 39 40 40 #include <typedefs.h> 41 #include <arch/ regutils.h>41 #include <arch/istate.h> 42 42 43 43 /** If defined, forces using of high exception vectors. */ … … 45 45 46 46 #ifdef HIGH_EXCEPTION_VECTORS 47 #define EXC_BASE_ADDRESS 0xffff000047 #define EXC_BASE_ADDRESS 0xffff0000 48 48 #else 49 #define EXC_BASE_ADDRESS 0x049 #define EXC_BASE_ADDRESS 0x0 50 50 #endif 51 51 52 52 /* 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)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) 60 60 61 61 /* Exception numbers */ … … 68 68 #define EXC_FIQ 6 69 69 70 71 70 /** Kernel stack pointer. 72 71 * 73 72 * It is set when thread switches to user mode, 74 73 * and then used for exception handling. 74 * 75 75 */ 76 76 extern uintptr_t supervisor_sp; 77 78 77 79 78 /** Temporary exception stack pointer. … … 81 80 * Temporary stack is used in exceptions handling routines 82 81 * before switching to thread's kernel stack. 82 * 83 83 */ 84 84 extern uintptr_t exc_stack; 85 86 87 /** Struct representing CPU state saved when an exception occurs. */88 typedef struct istate {89 uint32_t spsr;90 uint32_t sp;91 uint32_t lr;92 93 uint32_t r0;94 uint32_t r1;95 uint32_t r2;96 uint32_t r3;97 uint32_t r4;98 uint32_t r5;99 uint32_t r6;100 uint32_t r7;101 uint32_t r8;102 uint32_t r9;103 uint32_t r10;104 uint32_t fp;105 uint32_t r12;106 107 uint32_t pc;108 } istate_t;109 110 111 /** Sets Program Counter member of given istate structure.112 *113 * @param istate istate structure114 * @param retaddr new value of istate's PC member115 */116 static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr)117 {118 istate->pc = retaddr;119 }120 121 122 /** Returns true if exception happened while in userspace. */123 static inline int istate_from_uspace(istate_t *istate)124 {125 return (istate->spsr & STATUS_REG_MODE_MASK) == USER_MODE;126 }127 128 129 /** Returns Program Counter member of given istate structure. */130 static inline unative_t istate_get_pc(istate_t *istate)131 {132 return istate->pc;133 }134 135 static inline unative_t istate_get_fp(istate_t *istate)136 {137 return istate->fp;138 }139 140 85 141 86 extern void install_exception_handlers(void); … … 149 94 extern void swi_exception_entry(void); 150 95 151 152 96 #endif 153 97
Note:
See TracChangeset
for help on using the changeset viewer.
