Rev 3424 | Rev 3432 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3424 | Rev 3431 | ||
---|---|---|---|
Line 191... | Line 191... | ||
191 | fault_if_from_uspace(istate, "Page fault: %#x", badvaddr); |
191 | fault_if_from_uspace(istate, "Page fault: %#x", badvaddr); |
192 | panic("page fault\n"); |
192 | panic("page fault\n"); |
193 | } |
193 | } |
194 | } |
194 | } |
195 | 195 | ||
- | 196 | #ifdef CONFIG_UDEBUG |
|
- | 197 | ||
196 | /** Check whether the abort was caused by a bkpt instruction. |
198 | /** Check whether the abort was caused by a bkpt instruction. |
197 | * |
199 | * |
198 | * This must be called after (possibly) fetching the faulting page. |
200 | * This must be called after (possibly) fetching the faulting page. |
199 | * |
201 | * |
200 | * TODO: When paging-out is implemented, make sure the page |
202 | * TODO: When paging-out is implemented, make sure the page |
Line 206... | Line 208... | ||
206 | uint32_t *instr_addr = (uint32_t *) istate->pc; |
208 | uint32_t *instr_addr = (uint32_t *) istate->pc; |
207 | uint32_t opcode = *instr_addr; |
209 | uint32_t opcode = *instr_addr; |
208 | 210 | ||
209 | if ((opcode & 0xfff000f0) == 0xe1200070) { |
211 | if ((opcode & 0xfff000f0) == 0xe1200070) { |
210 | /* Bkpt */ |
212 | /* Bkpt */ |
- | 213 | ||
211 | if (istate_from_uspace(istate)) { |
214 | if (istate_from_uspace(istate)) { |
212 | udebug_breakpoint_event(0); |
215 | udebug_breakpoint_event(0); |
- | 216 | return; |
|
213 | } else { |
217 | } else { |
214 | panic("Unexpected BKPT instruction at 0x%x", |
218 | panic("Unexpected BKPT instruction at 0x%x", |
215 | istate->pc); |
219 | istate->pc); |
216 | } |
220 | } |
217 | } |
221 | } |
218 | } |
222 | } |
219 | 223 | ||
- | 224 | #endif |
|
- | 225 | ||
220 | /** Handles "prefetch abort" exception (instruction couldn't be executed). |
226 | /** Handles "prefetch abort" exception (instruction couldn't be executed). |
221 | * |
227 | * |
222 | * @param exc_no Exception number. |
228 | * @param exc_no Exception number. |
223 | * @param istate CPU state when exception occured. |
229 | * @param istate CPU state when exception occured. |
224 | */ |
230 | */ |
Line 231... | Line 237... | ||
231 | print_istate(istate); |
237 | print_istate(istate); |
232 | panic("page fault - prefetch_abort at address: %x\n", |
238 | panic("page fault - prefetch_abort at address: %x\n", |
233 | istate->pc); |
239 | istate->pc); |
234 | } |
240 | } |
235 | 241 | ||
- | 242 | #ifdef CONFIG_UDEBUG |
|
236 | /* Now check if the abort was caused by a breakpoint instruction */ |
243 | /* Now check if the abort was caused by a breakpoint instruction */ |
237 | bkpt_check(istate); |
244 | bkpt_check(istate); |
- | 245 | #else |
|
- | 246 | panic("Unexpected BKPT instruction at 0x%x", istate->pc); |
|
- | 247 | #endif |
|
- | 248 | ||
238 | } |
249 | } |
239 | 250 | ||
240 | /** @} |
251 | /** @} |
241 | */ |
252 | */ |