summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Jones <davej@suse.de>2002-11-25 02:36:41 -0800
committerDave Jones <davej@codemonkey.org.uk>2002-11-25 02:36:41 -0800
commitcf2dbf6401d4f786a75193b84dff19db060e38a6 (patch)
treeb7630b7e5ff66007225addc94fccacdcc3f20030
parentc7830dae29208aad2d9170d7f00dd756b53dd852 (diff)
[PATCH] CONFIG_FRAME_POINTER
From 2.4, this adds a CONFIG_ option to disable the usage of -fomit-frame-pointer
-rw-r--r--Makefile5
-rw-r--r--arch/i386/Kconfig8
-rw-r--r--arch/i386/kernel/semaphore.c24
3 files changed, 36 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e9d34e1f81e7..7708c84f2a3b 100644
--- a/Makefile
+++ b/Makefile
@@ -168,7 +168,10 @@ NOSTDINC_FLAGS = -nostdinc -iwithprefix include
CPPFLAGS := -D__KERNEL__ -Iinclude
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
- -fomit-frame-pointer -fno-strict-aliasing -fno-common
+ -fno-strict-aliasing -fno-common
+ifndef CONFIG_FRAME_POINTER
+CFLAGS += -fomit-frame-pointer
+endif
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 05e0c272ce68..cf8b7fb50fad 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -1618,6 +1618,14 @@ config DEBUG_SPINLOCK_SLEEP
If you say Y here, various routines which may sleep will become very
noisy if they are called with a spinlock held.
+config FRAME_POINTER
+ bool "Compile the kernel with frame pointers"
+ help
+ If you say Y here the resulting kernel image will be slightly larger
+ and slower, but it will give very useful debugging information.
+ If you don't debug the kernel, you can say N, but we may not be able
+ to solve problems without frame pointers.
+
config X86_EXTRA_IRQS
bool
depends on X86_LOCAL_APIC
diff --git a/arch/i386/kernel/semaphore.c b/arch/i386/kernel/semaphore.c
index e015553534fc..dcdb19179640 100644
--- a/arch/i386/kernel/semaphore.c
+++ b/arch/i386/kernel/semaphore.c
@@ -191,6 +191,10 @@ asm(
".align 4\n"
".globl __down_failed\n"
"__down_failed:\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "pushl %ebp\n\t"
+ "movl %esp,%ebp\n\t"
+#endif
"pushl %eax\n\t"
"pushl %edx\n\t"
"pushl %ecx\n\t"
@@ -198,6 +202,10 @@ asm(
"popl %ecx\n\t"
"popl %edx\n\t"
"popl %eax\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "movl %ebp,%esp\n\t"
+ "popl %ebp\n\t"
+#endif
"ret"
);
@@ -206,11 +214,19 @@ asm(
".align 4\n"
".globl __down_failed_interruptible\n"
"__down_failed_interruptible:\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "pushl %ebp\n\t"
+ "movl %esp,%ebp\n\t"
+#endif
"pushl %edx\n\t"
"pushl %ecx\n\t"
"call __down_interruptible\n\t"
"popl %ecx\n\t"
"popl %edx\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "movl %ebp,%esp\n\t"
+ "popl %ebp\n\t"
+#endif
"ret"
);
@@ -219,11 +235,19 @@ asm(
".align 4\n"
".globl __down_failed_trylock\n"
"__down_failed_trylock:\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "pushl %ebp\n\t"
+ "movl %esp,%ebp\n\t"
+#endif
"pushl %edx\n\t"
"pushl %ecx\n\t"
"call __down_trylock\n\t"
"popl %ecx\n\t"
"popl %edx\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "movl %ebp,%esp\n\t"
+ "popl %ebp\n\t"
+#endif
"ret"
);