Lines Matching full:frame
32 /* ... with 4 registers per frame. */
53 * @frame: the DWARF frame whose list of registers we insert on
58 * dwarf registers for @frame.
62 static struct dwarf_reg *dwarf_frame_alloc_reg(struct dwarf_frame *frame, in dwarf_frame_alloc_reg() argument
81 list_add(®->link, &frame->reg_list); in dwarf_frame_alloc_reg()
86 static void dwarf_frame_free_regs(struct dwarf_frame *frame) in dwarf_frame_free_regs() argument
90 list_for_each_entry_safe(reg, n, &frame->reg_list, link) { in dwarf_frame_free_regs()
98 * @frame: the DWARF frame to search in for @reg_num
101 * Lookup and return the dwarf reg @reg_num for this frame. Return
104 static struct dwarf_reg *dwarf_frame_reg(struct dwarf_frame *frame, in dwarf_frame_reg() argument
109 list_for_each_entry(reg, &frame->reg_list, link) { in dwarf_frame_reg()
388 * @frame: the instructions calculate the CFA for this frame
391 * Execute the Call Frame instruction sequence starting at
393 * how to calculate the Canonical Frame Address of a stackframe.
394 * Store the results in @frame.
400 struct dwarf_frame *frame, in dwarf_cfa_execute_insns() argument
410 while (current_insn < insn_end && frame->pc <= pc) { in dwarf_cfa_execute_insns()
421 frame->pc += delta; in dwarf_cfa_execute_insns()
429 regp = dwarf_frame_alloc_reg(frame, reg); in dwarf_cfa_execute_insns()
449 frame->pc += delta * cie->code_alignment_factor; in dwarf_cfa_execute_insns()
454 frame->pc += delta * cie->code_alignment_factor; in dwarf_cfa_execute_insns()
459 frame->pc += delta * cie->code_alignment_factor; in dwarf_cfa_execute_insns()
475 regp = dwarf_frame_alloc_reg(frame, reg); in dwarf_cfa_execute_insns()
480 &frame->cfa_register); in dwarf_cfa_execute_insns()
483 &frame->cfa_offset); in dwarf_cfa_execute_insns()
486 frame->flags |= DWARF_FRAME_CFA_REG_OFFSET; in dwarf_cfa_execute_insns()
490 &frame->cfa_register); in dwarf_cfa_execute_insns()
492 frame->flags |= DWARF_FRAME_CFA_REG_OFFSET; in dwarf_cfa_execute_insns()
497 frame->cfa_offset = offset; in dwarf_cfa_execute_insns()
503 frame->cfa_expr = current_insn; in dwarf_cfa_execute_insns()
504 frame->cfa_expr_len = expr_len; in dwarf_cfa_execute_insns()
507 frame->flags |= DWARF_FRAME_CFA_REG_EXP; in dwarf_cfa_execute_insns()
515 regp = dwarf_frame_alloc_reg(frame, reg); in dwarf_cfa_execute_insns()
524 regp = dwarf_frame_alloc_reg(frame, reg); in dwarf_cfa_execute_insns()
538 regp = dwarf_frame_alloc_reg(frame, reg); in dwarf_cfa_execute_insns()
553 * dwarf_free_frame - free the memory allocated for @frame
554 * @frame: the frame to free
556 void dwarf_free_frame(struct dwarf_frame *frame) in dwarf_free_frame() argument
558 dwarf_frame_free_regs(frame); in dwarf_free_frame()
559 mempool_free(frame, dwarf_frame_pool); in dwarf_free_frame()
570 * Return a struct dwarf_frame representing the most recent frame
577 struct dwarf_frame *frame; in dwarf_unwind_stack() local
623 frame = mempool_alloc(dwarf_frame_pool, GFP_ATOMIC); in dwarf_unwind_stack()
624 if (!frame) { in dwarf_unwind_stack()
625 printk(KERN_ERR "Unable to allocate a dwarf frame\n"); in dwarf_unwind_stack()
629 INIT_LIST_HEAD(&frame->reg_list); in dwarf_unwind_stack()
630 frame->flags = 0; in dwarf_unwind_stack()
631 frame->prev = prev; in dwarf_unwind_stack()
632 frame->return_addr = 0; in dwarf_unwind_stack()
640 * a) pc has no asscociated DWARF frame info and so in dwarf_unwind_stack()
641 * we don't know how to unwind this frame. This is in dwarf_unwind_stack()
643 * frame that was called from some assembly code in dwarf_unwind_stack()
656 frame->pc = fde->initial_location; in dwarf_unwind_stack()
661 frame, pc); in dwarf_unwind_stack()
665 fde, frame, pc); in dwarf_unwind_stack()
668 switch (frame->flags) { in dwarf_unwind_stack()
671 reg = dwarf_frame_reg(prev, frame->cfa_register); in dwarf_unwind_stack()
676 frame->cfa = __raw_readl(addr); in dwarf_unwind_stack()
683 * the Canonical Frame Address for this in dwarf_unwind_stack()
686 frame->cfa = dwarf_read_arch_reg(frame->cfa_register); in dwarf_unwind_stack()
689 frame->cfa += frame->cfa_offset; in dwarf_unwind_stack()
695 reg = dwarf_frame_reg(frame, DWARF_ARCH_RA_REG); in dwarf_unwind_stack()
707 addr = frame->cfa + reg->addr; in dwarf_unwind_stack()
708 frame->return_addr = __raw_readl(addr); in dwarf_unwind_stack()
716 * just after the frame pointer (r14) had been restored. The in dwarf_unwind_stack()
718 * reached by using the value of the frame pointer before it was in dwarf_unwind_stack()
726 frame->return_addr = 0; in dwarf_unwind_stack()
728 return frame; in dwarf_unwind_stack()
731 dwarf_free_frame(frame); in dwarf_unwind_stack()
914 /* Call frame instructions. */ in dwarf_parse_fde()
963 struct dwarf_frame *frame, *_frame; in dwarf_unwinder_dump() local
970 frame = dwarf_unwind_stack(return_addr, _frame); in dwarf_unwinder_dump()
975 _frame = frame; in dwarf_unwinder_dump()
977 if (!frame || !frame->return_addr) in dwarf_unwinder_dump()
980 return_addr = frame->return_addr; in dwarf_unwinder_dump()
984 if (frame) in dwarf_unwinder_dump()
985 dwarf_free_frame(frame); in dwarf_unwinder_dump()