Lines Matching defs:state

12 unsigned long unwind_get_return_address(struct unwind_state *state)
14 if (unwind_done(state))
16 return __kernel_text_address(state->ip) ? state->ip : 0;
20 static bool outside_of_stack(struct unwind_state *state, unsigned long sp)
22 return (sp <= state->sp) ||
23 (sp > state->stack_info.end - sizeof(struct stack_frame));
26 static bool update_stack_info(struct unwind_state *state, unsigned long sp)
28 struct stack_info *info = &state->stack_info;
29 unsigned long *mask = &state->stack_mask;
32 if (get_stack_info(sp, state->task, info, mask) != 0 ||
39 static inline bool is_final_pt_regs(struct unwind_state *state,
43 if (task_pt_regs(state->task) == regs)
47 return state->stack_info.type == STACK_TYPE_IRQ &&
48 state->stack_info.end - sizeof(struct pt_regs) == (unsigned long)regs &&
52 bool unwind_next_frame(struct unwind_state *state)
54 struct stack_info *info = &state->stack_info;
60 regs = state->regs;
62 sp = state->sp;
69 state->regs = NULL;
70 return unwind_next_frame(state);
73 sf = (struct stack_frame *) state->sp;
77 if (unlikely(outside_of_stack(state, sp))) {
78 if (!update_stack_info(state, sp))
86 sp = state->sp + STACK_FRAME_OVERHEAD;
90 if (is_final_pt_regs(state, regs))
94 if (unlikely(outside_of_stack(state, sp))) {
95 if (!update_stack_info(state, sp))
106 ip = ftrace_graph_ret_addr(state->task, &state->graph_idx, ip, (void *) sp);
108 /* Update unwind state */
109 state->sp = sp;
110 state->ip = ip;
111 state->regs = regs;
112 state->reliable = reliable;
116 state->error = true;
118 state->stack_info.type = STACK_TYPE_UNKNOWN;
123 void __unwind_start(struct unwind_state *state, struct task_struct *task,
126 struct stack_info *info = &state->stack_info;
130 memset(state, 0, sizeof(*state));
131 state->task = task;
132 state->regs = regs;
151 if (!update_stack_info(state, sp)) {
154 state->error = true;
164 ip = ftrace_graph_ret_addr(state->task, &state->graph_idx, ip, NULL);
166 /* Update unwind state */
167 state->sp = sp;
168 state->ip = ip;
169 state->reliable = true;
174 while (!unwind_done(state)) {
175 if (on_stack(&state->stack_info, first_frame, sizeof(struct stack_frame))) {
176 if (state->sp >= first_frame)
179 unwind_next_frame(state);