| // SPDX-License-Identifier: GPL-2.0 |
| * arch/sh/kernel/return_address.c |
| * Copyright (C) 2009 Matt Fleming |
| * Copyright (C) 2009 Paul Mundt |
| #include <linux/kernel.h> |
| #include <linux/module.h> |
| #ifdef CONFIG_DWARF_UNWINDER |
| void *return_address(unsigned int depth) |
| struct dwarf_frame *frame; |
| for (i = 0, frame = NULL, ra = 0; i <= depth; i++) { |
| tmp = dwarf_unwind_stack(ra, frame); |
| if (!frame || !frame->return_addr) |
| /* Failed to unwind the stack to the specified depth. */ |
| void *return_address(unsigned int depth) |
| EXPORT_SYMBOL_GPL(return_address); |