forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/arch/arm64/kernel/return_address.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * arch/arm64/kernel/return_address.c
34 *
45 * Copyright (C) 2013 Linaro Limited
56 * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118
129 #include <linux/export.h>
....@@ -21,16 +18,16 @@
2118 void *addr;
2219 };
2320
24
-static int save_return_addr(struct stackframe *frame, void *d)
21
+static bool save_return_addr(void *d, unsigned long pc)
2522 {
2623 struct return_address_data *data = d;
2724
2825 if (!data->level) {
29
- data->addr = (void *)frame->pc;
30
- return 1;
26
+ data->addr = (void *)pc;
27
+ return false;
3128 } else {
3229 --data->level;
33
- return 0;
30
+ return true;
3431 }
3532 }
3633 NOKPROBE_SYMBOL(save_return_addr);
....@@ -43,12 +40,9 @@
4340 data.level = level + 2;
4441 data.addr = NULL;
4542
46
- frame.fp = (unsigned long)__builtin_frame_address(0);
47
- frame.pc = (unsigned long)return_address; /* dummy */
48
-#ifdef CONFIG_FUNCTION_GRAPH_TRACER
49
- frame.graph = current->curr_ret_stack;
50
-#endif
51
-
43
+ start_backtrace(&frame,
44
+ (unsigned long)__builtin_frame_address(0),
45
+ (unsigned long)return_address);
5246 walk_stackframe(current, &frame, save_return_addr, &data);
5347
5448 if (!data.level)