From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Add SMP and UP macros for inline assembly
Date: Wed, 1 Sep 2010 15:02:50 -0700 [thread overview]
Message-ID: <mailman.226.1283447719.27306.linux-arm-kernel@lists.infradead.org> (raw)
We can't use the macros in asm/assembler.h in C inline functions.
Signed-off-by: Tony Lindgren <tony@atomide.com>
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index 55974d2..340795c 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -154,6 +154,10 @@
.long 9999b,9001f; \
.popsection
+/*
+ * SMP and UP defines for assembly code. See also asm/smp_plat.h
+ * for the SMP and UP defines for inline code.
+ */
#ifdef CONFIG_SMP
#define SMP(instr...) \
9998: instr
diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h
index e621530..8db3512 100644
--- a/arch/arm/include/asm/smp_plat.h
+++ b/arch/arm/include/asm/smp_plat.h
@@ -18,4 +18,25 @@ static inline int cache_ops_need_broadcast(void)
return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 1;
}
+/*
+ * SMP and UP defines for inline functions. See also asm/assembler.h
+ * for the SMP and UP defines for assembly code.
+ */
+#ifdef CONFIG_SMP
+#define _str(s...) #s
+#define _9998(s...) _str(9998: s\n)
+
+#define SMP(instr...) \
+ _9998(instr)
+
+#define UP(instr...) \
+ _str(.pushsection ".smpalt.init", "a"\n) \
+ _str(.word 9998b\n) \
+ _str(instr\n) \
+ _str(.popsection\n)
+#else
+#define SMP(instr...)
+#define UP(instr...) _str(instr)
+#endif
+
#endif
reply other threads:[~2010-09-01 22:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=mailman.226.1283447719.27306.linux-arm-kernel@lists.infradead.org \
--to=tony@atomide.com \
--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).