From: gilles.chanteperdrix@xenomai.org (Gilles Chanteperdrix)
To: linux-arm-kernel@lists.infradead.org
Subject: Loading handle_arch_irq with a PC relative load
Date: Fri, 13 Jul 2012 21:05:59 +0200 [thread overview]
Message-ID: <50007197.8030403@xenomai.org> (raw)
I do not know if it is really useful, but it seems it would be possible
to reduce the number of memory accesses to just one in the irq_handler
macro in the case where CONFIG_MULTI_IRQ_HANDLER is enabled, by using a
PC relative load, with something like the following patch:
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 0d1851c..48ee46a 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -37,10 +37,9 @@
*/
.macro irq_handler
#ifdef CONFIG_MULTI_IRQ_HANDLER
- ldr r1, =handle_arch_irq
mov r0, sp
adr lr, BSYM(9997f)
- ldr pc, [r1]
+ ldr pc, handle_arch_irq
#else
arch_irq_handler_default
#endif
@@ -325,6 +324,12 @@ ENDPROC(__pabt_svc)
#endif
.LCfp:
.word fp_enter
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+ .globl handle_arch_irq
+handle_arch_irq:
+ .space 4
+#endif
+
/*
* User mode handlers
@@ -1151,9 +1156,3 @@ cr_alignment:
.space 4
cr_no_alignment:
.space 4
-
-#ifdef CONFIG_MULTI_IRQ_HANDLER
- .globl handle_arch_irq
-handle_arch_irq:
- .space 4
-#endif
--
Gilles.
next reply other threads:[~2012-07-13 19:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-13 19:05 Gilles Chanteperdrix [this message]
2012-07-13 19:40 ` Loading handle_arch_irq with a PC relative load Nicolas Pitre
2012-07-13 19:51 ` Gilles Chanteperdrix
2012-07-13 20:09 ` Nicolas Pitre
2012-07-13 20:13 ` Gilles Chanteperdrix
2012-07-14 10:39 ` Gilles Chanteperdrix
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=50007197.8030403@xenomai.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).