Rev 2787 | Rev 3424 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2787 | Rev 3125 | ||
|---|---|---|---|
| Line 190... | Line 190... | ||
| 190 | fault_if_from_uspace(istate, "Page fault: %#x", badvaddr); |
190 | fault_if_from_uspace(istate, "Page fault: %#x", badvaddr); |
| 191 | panic("page fault\n"); |
191 | panic("page fault\n"); |
| 192 | } |
192 | } |
| 193 | } |
193 | } |
| 194 | 194 | ||
| - | 195 | /** Check whether the abort was caused by a bkpt instruction. |
|
| - | 196 | * |
|
| - | 197 | * This must be called after (possibly) fetching the faulting page. |
|
| - | 198 | * |
|
| - | 199 | * TODO: When paging-out is implemented, make sure the page |
|
| - | 200 | * is still present when reading the instruction (we don't want |
|
| - | 201 | * to trigger another exception). |
|
| - | 202 | */ |
|
| - | 203 | static void bkpt_check(istate_t *istate) |
|
| - | 204 | { |
|
| - | 205 | uint32_t *instr_addr = (uint32_t *) istate->pc; |
|
| - | 206 | uint32_t opcode = *instr_addr; |
|
| - | 207 | ||
| - | 208 | if ((opcode & 0xfff000f0) == 0xe1200070) { |
|
| - | 209 | /* Bkpt */ |
|
| - | 210 | if (istate_from_uspace(istate)) { |
|
| - | 211 | udebug_breakpoint_event(0); |
|
| - | 212 | } else { |
|
| - | 213 | panic("Unexpected BKPT instruction at 0x%x", |
|
| - | 214 | istate->pc); |
|
| - | 215 | } |
|
| - | 216 | } |
|
| - | 217 | } |
|
| - | 218 | ||
| 195 | /** Handles "prefetch abort" exception (instruction couldn't be executed). |
219 | /** Handles "prefetch abort" exception (instruction couldn't be executed). |
| 196 | * |
220 | * |
| 197 | * @param exc_no Exception number. |
221 | * @param exc_no Exception number. |
| 198 | * @param istate CPU state when exception occured. |
222 | * @param istate CPU state when exception occured. |
| 199 | */ |
223 | */ |
| Line 205... | Line 229... | ||
| 205 | dprintf("prefetch_abort\n"); |
229 | dprintf("prefetch_abort\n"); |
| 206 | print_istate(istate); |
230 | print_istate(istate); |
| 207 | panic("page fault - prefetch_abort at address: %x\n", |
231 | panic("page fault - prefetch_abort at address: %x\n", |
| 208 | istate->pc); |
232 | istate->pc); |
| 209 | } |
233 | } |
| - | 234 | ||
| - | 235 | /* Now check if the abort was caused by a breakpoint instruction */ |
|
| - | 236 | bkpt_check(istate); |
|
| 210 | } |
237 | } |
| 211 | 238 | ||
| 212 | /** @} |
239 | /** @} |
| 213 | */ |
240 | */ |