Lines Matching refs:state
153 static bool unwind_exec_read_byte(struct unwind_state_arm32 *state, in unwind_exec_read_byte() argument
158 if (!copy_in(&insn, (void *)state->insn, sizeof(insn))) in unwind_exec_read_byte()
162 *ret_insn = (insn >> (state->byte * 8)) & 0xff; in unwind_exec_read_byte()
165 if (state->byte == 0) { in unwind_exec_read_byte()
166 state->byte = 3; in unwind_exec_read_byte()
167 state->insn += sizeof(uint32_t); in unwind_exec_read_byte()
168 state->entries--; in unwind_exec_read_byte()
170 state->byte--; in unwind_exec_read_byte()
191 static bool unwind_exec_insn(struct unwind_state_arm32 *state, vaddr_t stack, in unwind_exec_insn() argument
195 vaddr_t vsp = state->registers[SP]; in unwind_exec_insn()
199 if (!unwind_exec_read_byte(state, &insn)) in unwind_exec_insn()
203 state->registers[SP] += ((insn & INSN_VSP_SIZE_MASK) << 2) + 4; in unwind_exec_insn()
206 state->registers[SP] -= ((insn & INSN_VSP_SIZE_MASK) << 2) + 4; in unwind_exec_insn()
213 if (!unwind_exec_read_byte(state, &mask)) in unwind_exec_insn()
227 if (!pop_vsp(&state->registers[reg], &vsp, in unwind_exec_insn()
230 state->update_mask |= 1 << reg; in unwind_exec_insn()
242 state->registers[SP] = in unwind_exec_insn()
243 state->registers[insn & INSN_STD_DATA_MASK]; in unwind_exec_insn()
256 if (!pop_vsp(&state->registers[reg], &vsp, in unwind_exec_insn()
259 state->update_mask |= 1 << reg; in unwind_exec_insn()
264 if (!pop_vsp(&state->registers[14], &vsp, in unwind_exec_insn()
271 state->entries = 0; in unwind_exec_insn()
277 if (!unwind_exec_read_byte(state, &mask)) in unwind_exec_insn()
288 if (!pop_vsp(&state->registers[reg], &vsp, in unwind_exec_insn()
291 state->update_mask |= 1 << reg; in unwind_exec_insn()
299 if (!unwind_exec_read_byte(state, &uleb128)) in unwind_exec_insn()
302 state->registers[SP] += 0x204 + (uleb128 << 2); in unwind_exec_insn()
311 state->registers[SP] = vsp; in unwind_exec_insn()
317 static bool unwind_tab(struct unwind_state_arm32 *state, vaddr_t stack, in unwind_tab() argument
324 state->registers[PC] = 0; in unwind_tab()
326 if (!copy_in(&insn, (void *)state->insn, sizeof(insn))) { in unwind_tab()
327 DMSG("Bad insn addr %p", (void *)state->insn); in unwind_tab()
335 state->byte = 2; in unwind_tab()
336 state->entries = 1; in unwind_tab()
338 state->byte = 1; in unwind_tab()
339 state->entries = ((insn >> 16) & 0xFF) + 1; in unwind_tab()
345 while (state->entries > 0) { in unwind_tab()
346 if (!unwind_exec_insn(state, stack, stack_size)) in unwind_tab()
353 if (state->registers[PC] == 0) { in unwind_tab()
354 state->registers[PC] = state->registers[LR]; in unwind_tab()
359 if (state->start_pc != state->registers[PC]) in unwind_tab()
360 state->update_mask |= 1 << PC; in unwind_tab()
366 bool unwind_stack_arm32(struct unwind_state_arm32 *state, in unwind_stack_arm32() argument
373 state->update_mask = 0; in unwind_stack_arm32()
376 state->start_pc = state->registers[PC]; in unwind_stack_arm32()
384 index = find_index(state->start_pc - 2); in unwind_stack_arm32()
392 state->insn = (vaddr_t)&index->insn; in unwind_stack_arm32()
395 state->insn = (vaddr_t)&index->insn + in unwind_stack_arm32()
400 finished = unwind_tab(state, stack, stack_size); in unwind_stack_arm32()
410 void print_stack_arm32(struct unwind_state_arm32 *state, in print_stack_arm32() argument
416 state->registers[PC]); in print_stack_arm32()
417 } while (unwind_stack_arm32(state, stack, stack_size)); in print_stack_arm32()