1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2022-2023 Loongson Technology Corporation Limited
5 #include <linux/kernel.h>
6 #include <linux/ftrace.h>
8 #include <asm/unwind.h>
10 bool default_next_frame(struct unwind_state *state)
12 struct stack_info *info = &state->stack_info;
15 if (unwind_done(state))
19 for (state->sp += sizeof(unsigned long);
20 state->sp < info->end; state->sp += sizeof(unsigned long)) {
21 addr = *(unsigned long *)(state->sp);
22 state->pc = unwind_graph_addr(state, addr, state->sp + 8);
23 if (__kernel_text_address(state->pc))
27 state->sp = info->next_sp;
29 } while (!get_stack_info(state->sp, state->task, info));