* Unwind a single stack frame. * Return 0 on success or 1 if the stack cannot be unwound any further. * * XXX The can_lock argument is no longer germane; a sweep of callers should be * made to remove it after this new code has proven itself for a while. */
| 545 | * made to remove it after this new code has proven itself for a while. |
| 546 | */ |
| 547 | int |
| 548 | unwind_stack_one(struct unwind_state *state, int can_lock __unused) |
| 549 | { |
| 550 | struct unwind_idx *index; |
| 551 | |
| 552 | /* Reset the mask of updated registers */ |
| 553 | state->update_mask = 0; |
| 554 | |
| 555 | /* The pc value is correct and will be overwritten, save it */ |
| 556 | state->start_pc = state->registers[PC]; |
| 557 | |
| 558 | /* Find the item to run */ |
| 559 | index = find_index(state->start_pc); |
| 560 | if (index == NULL || index->insn == EXIDX_CANTUNWIND) |
| 561 | return 1; |
| 562 | |
| 563 | if (index->insn & (1U << 31)) { |
| 564 | /* The data is within the instruction */ |
| 565 | state->insn = &index->insn; |
| 566 | } else { |
| 567 | /* A prel31 offset to the unwind table */ |
| 568 | state->insn = (uint32_t *) |
| 569 | ((uintptr_t)&index->insn + |
| 570 | expand_prel31(index->insn)); |
| 571 | } |
| 572 | |
| 573 | /* Run the unwind function, return its finished/not-finished status. */ |
| 574 | return (unwind_tab(state)); |
| 575 | } |
no test coverage detected