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;
68 if (!__kernel_text_address(ip) || state->ip == unwind_recover_ret_addr(state, ip)) {
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 /* Update unwind state */
107 state->sp = sp;
108 state->regs = regs;
109 state->reliable = reliable;
110 state->ip = unwind_recover_ret_addr(state, ip);
114 state->error = true;
116 state->stack_info.type = STACK_TYPE_UNKNOWN;
121 void __unwind_start(struct unwind_state *state, struct task_struct *task,
124 struct stack_info *info = &state->stack_info;
128 memset(state, 0, sizeof(*state));
129 state->task = task;
130 state->regs = regs;
149 if (!update_stack_info(state, sp)) {
152 state->error = true;
162 /* Update unwind state */
163 state->sp = sp;
164 state->reliable = true;
165 state->ip = unwind_recover_ret_addr(state, ip);
170 while (!unwind_done(state)) {
171 if (on_stack(&state->stack_info, first_frame, sizeof(struct stack_frame))) {
172 if (state->sp >= first_frame)
175 unwind_next_frame(state);