Rev 2787 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2787 | Rev 3114 | ||
|---|---|---|---|
| Line 34... | Line 34... | ||
| 34 | 34 | ||
| 35 | #ifndef KERN_ppc32_EXCEPTION_H_ |
35 | #ifndef KERN_ppc32_EXCEPTION_H_ |
| 36 | #define KERN_ppc32_EXCEPTION_H_ |
36 | #define KERN_ppc32_EXCEPTION_H_ |
| 37 | 37 | ||
| 38 | #include <arch/types.h> |
38 | #include <arch/types.h> |
| - | 39 | #include <arch/regutils.h> |
|
| 39 | 40 | ||
| 40 | typedef struct { |
41 | typedef struct { |
| 41 | uint32_t r0; |
42 | uint32_t r0; |
| 42 | uint32_t r2; |
43 | uint32_t r2; |
| 43 | uint32_t r3; |
44 | uint32_t r3; |
| Line 80... | Line 81... | ||
| 80 | 81 | ||
| 81 | static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) |
82 | static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) |
| 82 | { |
83 | { |
| 83 | istate->pc = retaddr; |
84 | istate->pc = retaddr; |
| 84 | } |
85 | } |
| - | 86 | ||
| 85 | /** Return true if exception happened while in userspace */ |
87 | /** Return true if exception happened while in userspace */ |
| 86 | #include <panic.h> |
- | |
| 87 | static inline int istate_from_uspace(istate_t *istate) |
88 | static inline int istate_from_uspace(istate_t *istate) |
| 88 | { |
89 | { |
| 89 | panic("istate_from_uspace not yet implemented"); |
90 | /* true if privilege level PR (copied from MSR) == 1 */ |
| 90 | return 0; |
91 | return (istate->srr1 & MSR_PR) != 0; |
| 91 | } |
92 | } |
| - | 93 | ||
| 92 | static inline unative_t istate_get_pc(istate_t *istate) |
94 | static inline unative_t istate_get_pc(istate_t *istate) |
| 93 | { |
95 | { |
| 94 | return istate->pc; |
96 | return istate->pc; |
| 95 | } |
97 | } |
| 96 | 98 | ||