Lines Matching defs:state

93 static inline bool unwind_state_fixup(struct unwind_state *state)
95 if (!fix_exception(state->pc) && !fix_ftrace(state->pc))
98 state->reset = true;
110 static bool unwind_by_prologue(struct unwind_state *state)
116 struct stack_info *info = &state->stack_info;
119 if (state->sp >= info->end || state->sp < info->begin)
122 if (state->reset) {
123 regs = (struct pt_regs *)state->sp;
124 state->first = true;
125 state->reset = false;
126 state->pc = regs->csr_era;
127 state->ra = regs->regs[1];
128 state->sp = regs->regs[3];
136 pc = state->pc - (state->first ? 0 : LOONGARCH_INSN_SIZE);
157 if (state->first)
175 if (state->first) {
176 state->sp = state->sp + frame_size;
182 state->pc = *(unsigned long *)(state->sp + frame_ra);
183 state->sp = state->sp + frame_size;
187 state->pc = state->ra;
190 state->first = false;
191 return unwind_state_fixup(state) || __kernel_text_address(state->pc);
194 static bool next_frame(struct unwind_state *state)
198 struct stack_info *info = &state->stack_info;
200 if (unwind_done(state))
204 if (unwind_by_prologue(state)) {
205 state->pc = unwind_graph_addr(state, state->pc, state->sp);
209 if (info->type == STACK_TYPE_IRQ && info->end == state->sp) {
216 state->first = true;
217 state->pc = pc;
218 state->ra = regs->regs[1];
219 state->sp = regs->regs[3];
220 get_stack_info(state->sp, state->task, info);
225 state->sp = info->next_sp;
227 } while (!get_stack_info(state->sp, state->task, info));
230 state->stack_info.type = STACK_TYPE_UNKNOWN;
234 unsigned long unwind_get_return_address(struct unwind_state *state)
236 return __unwind_get_return_address(state);
240 void unwind_start(struct unwind_state *state, struct task_struct *task,
243 __unwind_start(state, task, regs);
244 state->type = UNWINDER_PROLOGUE;
245 state->first = true;
252 if (!__kernel_text_address(state->pc)) {
253 state->type = UNWINDER_GUESS;
254 if (!unwind_done(state))
255 unwind_next_frame(state);
260 bool unwind_next_frame(struct unwind_state *state)
262 return state->type == UNWINDER_PROLOGUE ?
263 next_frame(state) : default_next_frame(state);