* [PATCH] arm: remove backtrace.s when ARM_UNWIND enable
@ 2010-08-11 16:08 janboe
2010-08-11 17:18 ` Catalin Marinas
0 siblings, 1 reply; 3+ messages in thread
From: janboe @ 2010-08-11 16:08 UTC (permalink / raw)
To: linux-arm-kernel
backtrace.s can only work with FRAME_POINTER, so disable when
ARM_UNWIND enabled
Signed-off-by: janboe <janboe.ye@gmail.com>
---
arch/arm/include/asm/system.h | 5 +++++
arch/arm/kernel/armksyms.c | 3 ++-
arch/arm/kernel/traps.c | 2 ++
arch/arm/lib/Makefile | 5 ++++-
4 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 5f4f480..0a05462 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -88,8 +88,13 @@ void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
#define xchg(ptr,x) \
((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
+#ifdef CONFIG_ARM_UNWIND
+#define __backtrace() \
+ (dump_stack())
+#else
extern asmlinkage void __backtrace(void);
extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
+#endif
struct mm_struct;
extern void show_pte(struct mm_struct *mm, unsigned long addr);
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 8214bfe..aa0eb0c 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -49,8 +49,9 @@ extern void __aeabi_ulcmp(void);
extern void fpundefinstr(void);
-
+#ifndef CONFIG_ARM_UNWIND
EXPORT_SYMBOL(__backtrace);
+#endif
/* platform dependent support */
EXPORT_SYMBOL(__udelay);
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 1621e53..5b3f3bf 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -603,7 +603,9 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
dump_instr("", regs);
if (user_mode(regs)) {
__show_regs(regs);
+#ifdef CONFIG_ARM_UNWIND
c_backtrace(regs->ARM_fp, processor_mode(regs));
+#endif
}
}
#endif
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 030ba72..e5699d5 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -4,7 +4,7 @@
# Copyright (C) 1995-2000 Russell King
#
-lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
+lib-y := changebit.o csumipv6.o csumpartial.o \
csumpartialcopy.o csumpartialcopyuser.o clearbit.o \
delay.o findbit.o memchr.o memcpy.o \
memmove.o memset.o memzero.o setbit.o \
@@ -14,6 +14,9 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
ucmpdi2.o lib1funcs.o div64.o sha1.o \
io-readsb.o io-writesb.o io-readsl.o io-writesl.o
+ifneq ($(CONFIG_ARM_UNWIND),y)
+ lib-y += backtrace.o
+endif
mmu-y := clear_user.o copy_page.o getuser.o putuser.o
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] arm: remove backtrace.s when ARM_UNWIND enable
2010-08-11 16:08 [PATCH] arm: remove backtrace.s when ARM_UNWIND enable janboe
@ 2010-08-11 17:18 ` Catalin Marinas
2010-08-11 17:24 ` ye janboe
0 siblings, 1 reply; 3+ messages in thread
From: Catalin Marinas @ 2010-08-11 17:18 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, 2010-08-11 at 17:08 +0100, janboe wrote:
> backtrace.s can only work with FRAME_POINTER, so disable when
> ARM_UNWIND enabled
>
> Signed-off-by: janboe <janboe.ye@gmail.com>
[...]
> +ifneq ($(CONFIG_ARM_UNWIND),y)
> + lib-y += backtrace.o
> +endif
Could we use CONFIG_FRAME_POINTER (and negate the conditions in your
patch)? The above would be:
lib-$(CONFIG_FRAME_POINTER) += backtrace.o
--
Catalin
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] arm: remove backtrace.s when ARM_UNWIND enable
2010-08-11 17:18 ` Catalin Marinas
@ 2010-08-11 17:24 ` ye janboe
0 siblings, 0 replies; 3+ messages in thread
From: ye janboe @ 2010-08-11 17:24 UTC (permalink / raw)
To: linux-arm-kernel
backtrace.o also need to be linked when FRAME_POINTER is not set.
At this situation, __backtrace and c_backtrace are empty functions.
Janboe
2010/8/12 Catalin Marinas <catalin.marinas@arm.com>:
> On Wed, 2010-08-11 at 17:08 +0100, janboe wrote:
>> backtrace.s can only work with FRAME_POINTER, so disable when
>> ARM_UNWIND enabled
>>
>> Signed-off-by: janboe <janboe.ye@gmail.com>
> [...]
>> +ifneq ($(CONFIG_ARM_UNWIND),y)
>> + ?lib-y ? ? ? ?+= backtrace.o
>> +endif
>
> Could we use CONFIG_FRAME_POINTER (and negate the conditions in your
> patch)? The above would be:
>
> lib-$(CONFIG_FRAME_POINTER) += backtrace.o
>
> --
> Catalin
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-08-11 17:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-11 16:08 [PATCH] arm: remove backtrace.s when ARM_UNWIND enable janboe
2010-08-11 17:18 ` Catalin Marinas
2010-08-11 17:24 ` ye janboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.