Lines Matching refs:state
658 static int advance_loc(unsigned long delta, struct unwind_state *state) in advance_loc() argument
660 state->loc += delta * state->codeAlign; in advance_loc()
665 unw_debug("delta %3lu => loc 0x%lx: ", delta, state->loc); in advance_loc()
670 struct unwind_state *state) in set_rule() argument
672 if (reg < ARRAY_SIZE(state->regs)) { in set_rule()
673 state->regs[reg].where = where; in set_rule()
674 state->regs[reg].value = value; in set_rule()
699 signed ptrType, struct unwind_state *state) in processCFI() argument
709 if (start != state->cieStart) { in processCFI()
710 state->loc = state->org; in processCFI()
712 processCFI(state->cieStart, state->cieEnd, 0, ptrType, in processCFI()
713 state); in processCFI()
714 if (targetLoc == 0 && state->label == NULL) in processCFI()
729 state->loc = read_pointer(&ptr.p8, end, in processCFI()
731 if (state->loc == 0) in processCFI()
733 unw_debug("cfa_set_loc: 0x%lx ", state->loc); in processCFI()
738 && advance_loc(*ptr.p8++, state); in processCFI()
746 && advance_loc(value, state); in processCFI()
751 && advance_loc(*ptr.p32++, state); in processCFI()
757 get_uleb128(&ptr.p8, end), state); in processCFI()
762 get_uleb128(&ptr.p8, end), state); in processCFI()
767 get_sleb128(&ptr.p8, end), state); in processCFI()
772 get_sleb128(&ptr.p8, end), state); in processCFI()
781 state); in processCFI()
788 get_uleb128(&ptr.p8, end), state); in processCFI()
792 if (ptr.p8 == state->label) { in processCFI()
793 state->label = NULL; in processCFI()
796 if (state->stackDepth >= MAX_STACK_DEPTH) in processCFI()
798 state->stack[state->stackDepth++] = ptr.p8; in processCFI()
802 if (state->stackDepth) { in processCFI()
803 const uleb128_t loc = state->loc; in processCFI()
804 const u8 *label = state->label; in processCFI()
806 state->label = in processCFI()
807 state->stack[state->stackDepth - 1]; in processCFI()
808 memcpy(&state->cfa, &badCFA, in processCFI()
809 sizeof(state->cfa)); in processCFI()
810 memset(state->regs, 0, in processCFI()
811 sizeof(state->regs)); in processCFI()
812 state->stackDepth = 0; in processCFI()
815 state); in processCFI()
816 state->loc = loc; in processCFI()
817 state->label = label; in processCFI()
822 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
823 unw_debug("cfa_def_cfa: r%lu ", state->cfa.reg); in processCFI()
826 state->cfa.offs = get_uleb128(&ptr.p8, end); in processCFI()
828 state->cfa.offs); in processCFI()
831 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
834 state->cfa.offs = get_sleb128(&ptr.p8, end) in processCFI()
835 * state->dataAlign; in processCFI()
839 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
853 state); in processCFI()
864 result = advance_loc(*ptr.p8++ & 0x3f, state); in processCFI()
870 state); in processCFI()
874 set_rule(*ptr.p8++ & 0x3f, Nowhere, 0, state); in processCFI()
880 if (result && targetLoc != 0 && targetLoc < state->loc) in processCFI()
888 targetLoc < state->loc && */ state->label == NULL)); in processCFI()
904 struct unwind_state state; in arc_unwind() local
1013 memset(&state, 0, sizeof(state)); in arc_unwind()
1014 state.cieEnd = ptr; /* keep here temporarily */ in arc_unwind()
1045 state.codeAlign = get_uleb128(&ptr, end); in arc_unwind()
1047 state.dataAlign = get_sleb128(&ptr, end); in arc_unwind()
1048 if (state.codeAlign == 0 || state.dataAlign == 0 || ptr >= end) in arc_unwind()
1052 state.version <= 1 ? *ptr++ : get_uleb128(&ptr, in arc_unwind()
1057 unw_debug("data Align: %ld\n", state.dataAlign); in arc_unwind()
1058 unw_debug("code Align: %lu\n", state.codeAlign); in arc_unwind()
1073 state.cieStart = ptr; in arc_unwind()
1074 ptr = state.cieEnd; in arc_unwind()
1075 state.cieEnd = end; in arc_unwind()
1129 state.org = startLoc; in arc_unwind()
1130 memcpy(&state.cfa, &badCFA, sizeof(state.cfa)); in arc_unwind()
1139 if (!processCFI(ptr, end, pc, ptrType, &state) in arc_unwind()
1140 || state.loc > endLoc in arc_unwind()
1142 || state.cfa.reg >= ARRAY_SIZE(reg_info) in arc_unwind()
1143 || reg_info[state.cfa.reg].width != sizeof(unsigned long) in arc_unwind()
1144 || state.cfa.offs % sizeof(unsigned long)) in arc_unwind()
1151 for (i = 0; i < ARRAY_SIZE(state.regs); ++i) { in arc_unwind()
1156 switch (state.regs[i].where) { in arc_unwind()
1160 unw_debug(" r%d: c(%lu),", i, state.regs[i].value); in arc_unwind()
1163 unw_debug(" r%d: r(%lu),", i, state.regs[i].value); in arc_unwind()
1166 unw_debug(" r%d: v(%lu),", i, state.regs[i].value); in arc_unwind()
1177 && !UNW_DEFAULT_RA(state.regs[retAddrReg], state.dataAlign)) in arc_unwind()
1180 cfa = FRAME_REG(state.cfa.reg, unsigned long) + state.cfa.offs; in arc_unwind()
1189 state.cfa.reg, state.cfa.offs, cfa); in arc_unwind()
1191 for (i = 0; i < ARRAY_SIZE(state.regs); ++i) { in arc_unwind()
1193 if (state.regs[i].where == Nowhere) in arc_unwind()
1197 switch (state.regs[i].where) { in arc_unwind()
1201 if (state.regs[i].value >= ARRAY_SIZE(reg_info) in arc_unwind()
1202 || REG_INVALID(state.regs[i].value) in arc_unwind()
1204 reg_info[state.regs[i].value].width) in arc_unwind()
1206 switch (reg_info[state.regs[i].value].width) { in arc_unwind()
1208 state.regs[i].value = in arc_unwind()
1209 FRAME_REG(state.regs[i].value, const u8); in arc_unwind()
1212 state.regs[i].value = in arc_unwind()
1213 FRAME_REG(state.regs[i].value, const u16); in arc_unwind()
1216 state.regs[i].value = in arc_unwind()
1217 FRAME_REG(state.regs[i].value, const u32); in arc_unwind()
1221 state.regs[i].value = in arc_unwind()
1222 FRAME_REG(state.regs[i].value, const u64); in arc_unwind()
1234 for (i = 0; i < ARRAY_SIZE(state.regs); ++i, fptr++) { in arc_unwind()
1238 switch (state.regs[i].where) { in arc_unwind()
1249 FRAME_REG(i, u8) = state.regs[i].value; in arc_unwind()
1252 FRAME_REG(i, u16) = state.regs[i].value; in arc_unwind()
1255 FRAME_REG(i, u32) = state.regs[i].value; in arc_unwind()
1259 FRAME_REG(i, u64) = state.regs[i].value; in arc_unwind()
1269 FRAME_REG(i, unsigned long) = cfa + state.regs[i].value in arc_unwind()
1270 * state.dataAlign; in arc_unwind()
1273 addr = cfa + state.regs[i].value * state.dataAlign; in arc_unwind()
1275 if ((state.regs[i].value * state.dataAlign) in arc_unwind()