Lines Matching refs:state
645 static int advance_loc(unsigned long delta, struct unwind_state *state) in advance_loc() argument
647 state->loc += delta * state->codeAlign; in advance_loc()
652 unw_debug("delta %3lu => loc 0x%lx: ", delta, state->loc); in advance_loc()
657 struct unwind_state *state) in set_rule() argument
659 if (reg < ARRAY_SIZE(state->regs)) { in set_rule()
660 state->regs[reg].where = where; in set_rule()
661 state->regs[reg].value = value; in set_rule()
686 signed ptrType, struct unwind_state *state) in processCFI() argument
696 if (start != state->cieStart) { in processCFI()
697 state->loc = state->org; in processCFI()
699 processCFI(state->cieStart, state->cieEnd, 0, ptrType, in processCFI()
700 state); in processCFI()
701 if (targetLoc == 0 && state->label == NULL) in processCFI()
716 state->loc = read_pointer(&ptr.p8, end, in processCFI()
718 if (state->loc == 0) in processCFI()
720 unw_debug("cfa_set_loc: 0x%lx ", state->loc); in processCFI()
725 && advance_loc(*ptr.p8++, state); in processCFI()
733 && advance_loc(value, state); in processCFI()
738 && advance_loc(*ptr.p32++, state); in processCFI()
744 get_uleb128(&ptr.p8, end), state); in processCFI()
749 get_uleb128(&ptr.p8, end), state); in processCFI()
754 get_sleb128(&ptr.p8, end), state); in processCFI()
759 get_sleb128(&ptr.p8, end), state); in processCFI()
768 state); in processCFI()
775 get_uleb128(&ptr.p8, end), state); in processCFI()
779 if (ptr.p8 == state->label) { in processCFI()
780 state->label = NULL; in processCFI()
783 if (state->stackDepth >= MAX_STACK_DEPTH) in processCFI()
785 state->stack[state->stackDepth++] = ptr.p8; in processCFI()
789 if (state->stackDepth) { in processCFI()
790 const uleb128_t loc = state->loc; in processCFI()
791 const u8 *label = state->label; in processCFI()
793 state->label = in processCFI()
794 state->stack[state->stackDepth - 1]; in processCFI()
795 memcpy(&state->cfa, &badCFA, in processCFI()
796 sizeof(state->cfa)); in processCFI()
797 memset(state->regs, 0, in processCFI()
798 sizeof(state->regs)); in processCFI()
799 state->stackDepth = 0; in processCFI()
802 state); in processCFI()
803 state->loc = loc; in processCFI()
804 state->label = label; in processCFI()
809 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
810 unw_debug("cfa_def_cfa: r%lu ", state->cfa.reg); in processCFI()
813 state->cfa.offs = get_uleb128(&ptr.p8, end); in processCFI()
815 state->cfa.offs); in processCFI()
818 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
821 state->cfa.offs = get_sleb128(&ptr.p8, end) in processCFI()
822 * state->dataAlign; in processCFI()
826 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
840 state); in processCFI()
851 result = advance_loc(*ptr.p8++ & 0x3f, state); in processCFI()
857 state); in processCFI()
861 set_rule(*ptr.p8++ & 0x3f, Nowhere, 0, state); in processCFI()
867 if (result && targetLoc != 0 && targetLoc < state->loc) in processCFI()
875 targetLoc < state->loc && */ state->label == NULL)); in processCFI()
891 struct unwind_state state; in arc_unwind() local
1029 memset(&state, 0, sizeof(state)); in arc_unwind()
1030 state.cieEnd = ptr; /* keep here temporarily */ in arc_unwind()
1034 if ((state.version = *ptr) != 1) in arc_unwind()
1063 state.codeAlign = get_uleb128(&ptr, end); in arc_unwind()
1065 state.dataAlign = get_sleb128(&ptr, end); in arc_unwind()
1066 if (state.codeAlign == 0 || state.dataAlign == 0 || ptr >= end) in arc_unwind()
1070 state.version <= 1 ? *ptr++ : get_uleb128(&ptr, in arc_unwind()
1075 unw_debug("data Align: %ld\n", state.dataAlign); in arc_unwind()
1076 unw_debug("code Align: %lu\n", state.codeAlign); in arc_unwind()
1091 state.cieStart = ptr; in arc_unwind()
1092 ptr = state.cieEnd; in arc_unwind()
1093 state.cieEnd = end; in arc_unwind()
1147 state.org = startLoc; in arc_unwind()
1148 memcpy(&state.cfa, &badCFA, sizeof(state.cfa)); in arc_unwind()
1157 if (!processCFI(ptr, end, pc, ptrType, &state) in arc_unwind()
1158 || state.loc > endLoc in arc_unwind()
1160 || state.cfa.reg >= ARRAY_SIZE(reg_info) in arc_unwind()
1161 || reg_info[state.cfa.reg].width != sizeof(unsigned long) in arc_unwind()
1162 || state.cfa.offs % sizeof(unsigned long)) in arc_unwind()
1169 for (i = 0; i < ARRAY_SIZE(state.regs); ++i) { in arc_unwind()
1174 switch (state.regs[i].where) { in arc_unwind()
1178 unw_debug(" r%d: c(%lu),", i, state.regs[i].value); in arc_unwind()
1181 unw_debug(" r%d: r(%lu),", i, state.regs[i].value); in arc_unwind()
1184 unw_debug(" r%d: v(%lu),", i, state.regs[i].value); in arc_unwind()
1195 && !UNW_DEFAULT_RA(state.regs[retAddrReg], state.dataAlign)) in arc_unwind()
1198 cfa = FRAME_REG(state.cfa.reg, unsigned long) + state.cfa.offs; in arc_unwind()
1207 state.cfa.reg, state.cfa.offs, cfa); in arc_unwind()
1209 for (i = 0; i < ARRAY_SIZE(state.regs); ++i) { in arc_unwind()
1211 if (state.regs[i].where == Nowhere) in arc_unwind()
1215 switch (state.regs[i].where) { in arc_unwind()
1219 if (state.regs[i].value >= ARRAY_SIZE(reg_info) in arc_unwind()
1220 || REG_INVALID(state.regs[i].value) in arc_unwind()
1222 reg_info[state.regs[i].value].width) in arc_unwind()
1224 switch (reg_info[state.regs[i].value].width) { in arc_unwind()
1226 state.regs[i].value = in arc_unwind()
1227 FRAME_REG(state.regs[i].value, const u8); in arc_unwind()
1230 state.regs[i].value = in arc_unwind()
1231 FRAME_REG(state.regs[i].value, const u16); in arc_unwind()
1234 state.regs[i].value = in arc_unwind()
1235 FRAME_REG(state.regs[i].value, const u32); in arc_unwind()
1239 state.regs[i].value = in arc_unwind()
1240 FRAME_REG(state.regs[i].value, const u64); in arc_unwind()
1252 for (i = 0; i < ARRAY_SIZE(state.regs); ++i, fptr++) { in arc_unwind()
1256 switch (state.regs[i].where) { in arc_unwind()
1267 FRAME_REG(i, u8) = state.regs[i].value; in arc_unwind()
1270 FRAME_REG(i, u16) = state.regs[i].value; in arc_unwind()
1273 FRAME_REG(i, u32) = state.regs[i].value; in arc_unwind()
1277 FRAME_REG(i, u64) = state.regs[i].value; in arc_unwind()
1287 FRAME_REG(i, unsigned long) = cfa + state.regs[i].value in arc_unwind()
1288 * state.dataAlign; in arc_unwind()
1291 addr = cfa + state.regs[i].value * state.dataAlign; in arc_unwind()
1293 if ((state.regs[i].value * state.dataAlign) in arc_unwind()