[<prev] [next>] [day] [month] [year] [list]
Message-ID: <COL130-W34BEE3D969E7F3A4136956B9300@phx.gbl>
Date: Tue, 13 Oct 2015 23:46:21 +0800
From: Chen Gang <xili_gchen_5257@...mail.com>
To: "realmz6@...il.com" <realmz6@...il.com>,
"Zhang, Sonic" <sonic.zhang@...log.com>,
Richard Weinberger <richard.weinberger@...il.com>
CC: "adi-buildroot-devel@...ts.sourceforge.net"
<adi-buildroot-devel@...ts.sourceforge.net>,
kernel mailing list <linux-kernel@...r.kernel.org>,
"bschmidt@...hat.com" <bschmidt@...hat.com>
Subject: [PATCH] arch/blackfin/kernel/stacktrace.c: Use
__builtin_frame_address instead of asm("FP")
>From 97df54f9625dae3c61f65e1f0da794718262cd69 Mon Sep 17 00:00:00 2001
From: Chen Gang <gang.chen.5i5j@...il.com>
Date: Tue, 13 Oct 2015 23:24:02 +0800
Subject: [PATCH] arch/blackfin/kernel/stacktrace.c: Use __builtin_frame_address instead of asm("FP")
When latest gcc build kernel with "-fno-omit-frame-pointer -pg", it will
cause building break. For getting address on the stack, kernel need to
use __builtin_frame_address instead of. The related error:
CC arch/blackfin/kernel/stacktrace.o
arch/blackfin/kernel/stacktrace.c: In function 'save_stack_trace':
arch/blackfin/kernel/stacktrace.c:23:6: error: frame pointer required, but reserved
void save_stack_trace(struct stack_trace *trace)
^
arch/blackfin/kernel/stacktrace.c:13:24: note: for 'current_frame_pointer'
register unsigned long current_frame_pointer asm("FP");
^
Signed-off-by: Chen Gang <gang.chen.5i5j@...il.com>
---
arch/blackfin/kernel/stacktrace.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/blackfin/kernel/stacktrace.c b/arch/blackfin/kernel/stacktrace.c
index 30301e1..1d48aee 100644
--- a/arch/blackfin/kernel/stacktrace.c
+++ b/arch/blackfin/kernel/stacktrace.c
@@ -10,8 +10,6 @@
#include <linux/thread_info.h>
#include <linux/module.h>
-register unsigned long current_frame_pointer asm("FP");
-
struct stackframe {
unsigned long fp;
unsigned long rets;
@@ -29,7 +27,7 @@ void save_stack_trace(struct stack_trace *trace)
low = (unsigned long)task_stack_page(current);
high = low + THREAD_SIZE;
- fp = current_frame_pointer;
+ fp = (unsigned long)__builtin_frame_address(0);
while (fp>= low && fp <= (high - sizeof(*frame))) {
frame = (struct stackframe *)fp;
--
1.9.3
Download attachment "0001-arch-blackfin-kernel-stacktrace.c-Use-__builtin_fram.patch" of type "application/octet-stream" (1759 bytes)
Powered by blists - more mailing lists