[PATCH 7/8] ARM: make exception handling optional

Sascha Hauer s.hauer at pengutronix.de
Fri Apr 8 10:56:18 EDT 2011


On several boards without MMU support the vectors cannot be mapped
to 0x0 and exception support is nonfunctional anyway, so make this
configurable.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/Kconfig      |    5 +++++
 arch/arm/cpu/Makefile |    4 ++--
 arch/arm/cpu/start.c  |   10 ++++++++++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4392620..6b2b400 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -120,9 +120,14 @@ config ARM_OPTIMZED_STRING_FUNCTIONS
 	  These functions work much faster than the normal versions but
 	  increase your binary size.
 
+config ARM_EXCEPTIONS
+	bool "enable arm exception handling support"
+	default y
+
 config ARM_UNWIND
 	bool "enable stack unwinding support"
 	depends on AEABI
+	depends on ARM_EXCEPTIONS
 	help
 	  This option enables stack unwinding support in barebox
 	  using the information automatically generated by the
diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile
index 036768e..e30ae1c 100644
--- a/arch/arm/cpu/Makefile
+++ b/arch/arm/cpu/Makefile
@@ -1,6 +1,6 @@
 obj-y += cpu.o
-obj-y += exceptions.o
-obj-y += interrupts.o
+obj-$(CONFIG_ARM_EXCEPTIONS) += exceptions.o
+obj-$(CONFIG_ARM_EXCEPTIONS) += interrupts.o
 obj-y += start.o
 
 #
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index ddb65e8..ff6bea2 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -31,6 +31,7 @@ void __naked __section(.text_entry) exception_vectors(void)
 {
 	__asm__ __volatile__ (
 		"b reset\n"				/* reset */
+#ifdef CONFIG_ARM_EXCEPTIONS
 		"ldr pc, =undefined_instruction\n"	/* undefined instruction */
 		"ldr pc, =software_interrupt\n"		/* software interrupt (SWI) */
 		"ldr pc, =prefetch_abort\n"		/* prefetch abort */
@@ -38,6 +39,15 @@ void __naked __section(.text_entry) exception_vectors(void)
 		"ldr pc, =not_used\n"			/* (reserved) */
 		"ldr pc, =irq\n"			/* irq (interrupt) */
 		"ldr pc, =fiq\n"			/* fiq (fast interrupt) */
+#else
+		"1: bne 1b\n"				/* undefined instruction */
+		"1: bne 1b\n"				/* software interrupt (SWI) */
+		"1: bne 1b\n"				/* prefetch abort */
+		"1: bne 1b\n"				/* data abort */
+		"1: bne 1b\n"				/* (reserved) */
+		"1: bne 1b\n"				/* irq (interrupt) */
+		"1: bne 1b\n"				/* fiq (fast interrupt) */
+#endif
 		".word 0x65726162\n"			/* 'BARE' */
 		".word 0x00786f62\n"			/* 'BOX' */
 		".word _text\n"				/* text base. If copied there,
-- 
1.7.2.3




More information about the barebox mailing list