Rev 2286 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2286 | Rev 2298 | ||
---|---|---|---|
Line 36... | Line 36... | ||
36 | 36 | ||
37 | #ifndef KERN_arm32_EXCEPTION_H_ |
37 | #ifndef KERN_arm32_EXCEPTION_H_ |
38 | #define KERN_arm32_EXCEPTION_H_ |
38 | #define KERN_arm32_EXCEPTION_H_ |
39 | 39 | ||
40 | #include <arch/types.h> |
40 | #include <arch/types.h> |
- | 41 | #include <arch/regutils.h> |
|
41 | 42 | ||
42 | #define HIGH_EXCEPTION_VECTORS |
43 | #define HIGH_EXCEPTION_VECTORS |
43 | 44 | ||
44 | #ifdef HIGH_EXCEPTION_VECTORS |
45 | #ifdef HIGH_EXCEPTION_VECTORS |
45 | #define EXC_BASE_ADDRESS 0xffff0000 |
46 | #define EXC_BASE_ADDRESS 0xffff0000 |
Line 89... | Line 90... | ||
89 | 90 | ||
90 | 91 | ||
91 | 92 | ||
92 | static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) |
93 | static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) |
93 | { |
94 | { |
94 | istate->lr = retaddr; |
95 | istate->pc = retaddr; |
95 | } |
96 | } |
96 | 97 | ||
97 | /** Return true if exception happened while in userspace */ |
98 | /** Return true if exception happened while in userspace */ |
98 | static inline int istate_from_uspace(istate_t *istate) |
99 | static inline int istate_from_uspace(istate_t *istate) |
99 | { |
100 | { |
100 | return !(istate->lr & 0x80000000); |
101 | return (istate->spsr & STATUS_REG_MODE_MASK) == USER_MODE; |
101 | return 0; |
- | |
102 | } |
102 | } |
103 | static inline unative_t istate_get_pc(istate_t *istate) |
103 | static inline unative_t istate_get_pc(istate_t *istate) |
104 | { |
104 | { |
105 | return istate->lr; |
105 | return istate->pc; |
106 | } |
106 | } |
107 | 107 | ||
108 | extern void setup_exception_stacks(void); |
108 | extern void setup_exception_stacks(void); |
109 | extern void install_exception_handlers(void); |
109 | extern void install_exception_handlers(void); |
110 | extern void exception_init(void); |
110 | extern void exception_init(void); |