Lines Matching refs:state
14 unsigned long unwind_get_return_address(struct unwind_state *state) in unwind_get_return_address() argument
16 if (unwind_done(state)) in unwind_get_return_address()
18 return __kernel_text_address(state->ip) ? state->ip : 0; in unwind_get_return_address()
22 static bool outside_of_stack(struct unwind_state *state, unsigned long sp) in outside_of_stack() argument
24 return (sp <= state->sp) || in outside_of_stack()
25 (sp > state->stack_info.end - sizeof(struct stack_frame)); in outside_of_stack()
28 static bool update_stack_info(struct unwind_state *state, unsigned long sp) in update_stack_info() argument
30 struct stack_info *info = &state->stack_info; in update_stack_info()
31 unsigned long *mask = &state->stack_mask; in update_stack_info()
34 if (get_stack_info(sp, state->task, info, mask) != 0 || in update_stack_info()
41 static inline bool is_final_pt_regs(struct unwind_state *state, in is_final_pt_regs() argument
45 if (task_pt_regs(state->task) == regs) in is_final_pt_regs()
49 return state->stack_info.type == STACK_TYPE_IRQ && in is_final_pt_regs()
50 state->stack_info.end - sizeof(struct pt_regs) == (unsigned long)regs && in is_final_pt_regs()
56 bool unwind_next_frame(struct unwind_state *state) in unwind_next_frame() argument
58 struct stack_info *info = &state->stack_info; in unwind_next_frame()
64 regs = state->regs; in unwind_next_frame()
66 sp = state->sp; in unwind_next_frame()
72 if (!__kernel_text_address(ip) || state->ip == unwind_recover_ret_addr(state, ip)) { in unwind_next_frame()
73 state->regs = NULL; in unwind_next_frame()
74 return unwind_next_frame(state); in unwind_next_frame()
77 sf = (struct stack_frame *) state->sp; in unwind_next_frame()
81 if (unlikely(outside_of_stack(state, sp))) { in unwind_next_frame()
82 if (!update_stack_info(state, sp)) in unwind_next_frame()
90 sp = state->sp + STACK_FRAME_OVERHEAD; in unwind_next_frame()
94 if (is_final_pt_regs(state, regs)) in unwind_next_frame()
98 if (unlikely(outside_of_stack(state, sp))) { in unwind_next_frame()
99 if (!update_stack_info(state, sp)) in unwind_next_frame()
111 state->sp = sp; in unwind_next_frame()
112 state->regs = regs; in unwind_next_frame()
113 state->reliable = reliable; in unwind_next_frame()
114 state->ip = unwind_recover_ret_addr(state, ip); in unwind_next_frame()
118 state->error = true; in unwind_next_frame()
120 state->stack_info.type = STACK_TYPE_UNKNOWN; in unwind_next_frame()
127 void __unwind_start(struct unwind_state *state, struct task_struct *task, in __unwind_start() argument
130 struct stack_info *info = &state->stack_info; in __unwind_start()
134 memset(state, 0, sizeof(*state)); in __unwind_start()
135 state->task = task; in __unwind_start()
136 state->regs = regs; in __unwind_start()
155 if (!update_stack_info(state, sp)) { in __unwind_start()
158 state->error = true; in __unwind_start()
169 state->sp = sp; in __unwind_start()
170 state->reliable = true; in __unwind_start()
171 state->ip = unwind_recover_ret_addr(state, ip); in __unwind_start()
176 while (!unwind_done(state)) { in __unwind_start()
177 if (on_stack(&state->stack_info, first_frame, sizeof(struct stack_frame))) { in __unwind_start()
178 if (state->sp >= first_frame) in __unwind_start()
181 unwind_next_frame(state); in __unwind_start()