From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 7/8] ARM: make exception handling optional
Date: Fri, 8 Apr 2011 16:56:18 +0200 [thread overview]
Message-ID: <1302274579-11158-8-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1302274579-11158-1-git-send-email-s.hauer@pengutronix.de>
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@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
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-04-08 14:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-08 14:56 Size reduction patches Sascha Hauer
2011-04-08 14:56 ` [PATCH 1/8] env: Make environment variable support optional Sascha Hauer
2011-04-08 14:56 ` [PATCH 2/8] make command " Sascha Hauer
2011-04-08 14:56 ` [PATCH 3/8] add noshell support Sascha Hauer
2011-04-08 14:56 ` [PATCH 4/8] arm: compile icache command only when command support is present Sascha Hauer
2011-04-08 14:56 ` [PATCH 5/8] malloc: put common memory functions to seperate file Sascha Hauer
2011-04-08 14:56 ` [PATCH 6/8] add dummy_malloc functions Sascha Hauer
2011-04-08 14:56 ` Sascha Hauer [this message]
2011-04-08 14:56 ` [PATCH 8/8] nand: make reading oob optional Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1302274579-11158-8-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox