Rev 2329 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2329 | Rev 2355 | ||
---|---|---|---|
Line 89... | Line 89... | ||
89 | 89 | ||
90 | uint32_t pc; |
90 | uint32_t pc; |
91 | } istate_t; |
91 | } istate_t; |
92 | 92 | ||
93 | 93 | ||
- | 94 | /** Sets Program Counter member of given istate structure. |
|
94 | 95 | * |
|
- | 96 | * @param istate istate structure |
|
- | 97 | * @param retaddr new value of istate's PC member |
|
- | 98 | */ |
|
95 | static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) |
99 | static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) |
96 | { |
100 | { |
97 | istate->pc = retaddr; |
101 | istate->pc = retaddr; |
98 | } |
102 | } |
99 | 103 | ||
100 | 104 | ||
101 | /** Return true if exception happened while in userspace. */ |
105 | /** Returns true if exception happened while in userspace. */ |
102 | static inline int istate_from_uspace(istate_t *istate) |
106 | static inline int istate_from_uspace(istate_t *istate) |
103 | { |
107 | { |
104 | return (istate->spsr & STATUS_REG_MODE_MASK) == USER_MODE; |
108 | return (istate->spsr & STATUS_REG_MODE_MASK) == USER_MODE; |
105 | } |
109 | } |
106 | 110 | ||
107 | - | ||
- | 111 | /** Returns Program Counter member of given istate structure. */ |
|
108 | static inline unative_t istate_get_pc(istate_t *istate) |
112 | static inline unative_t istate_get_pc(istate_t *istate) |
109 | { |
113 | { |
110 | return istate->pc; |
114 | return istate->pc; |
111 | } |
115 | } |
112 | 116 |