From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1Q8D6k-000198-Rb for barebox@lists.infradead.org; Fri, 08 Apr 2011 14:56:26 +0000 From: Sascha Hauer Date: Fri, 8 Apr 2011 16:56:18 +0200 Message-Id: <1302274579-11158-8-git-send-email-s.hauer@pengutronix.de> In-Reply-To: <1302274579-11158-1-git-send-email-s.hauer@pengutronix.de> References: <1302274579-11158-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 7/8] ARM: make exception handling optional To: barebox@lists.infradead.org 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 --- 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 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox