From: Rob Herring <robherring2@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
Russell King <linux@arm.linux.org.uk>,
Rob Herring <robh@kernel.org>
Subject: [RFC PATCH 3/4] vmlinuz.lds: define OF table sections with macros
Date: Thu, 27 Mar 2014 14:41:56 -0500 [thread overview]
Message-ID: <1395949317-8738-4-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1395949317-8738-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <robh@kernel.org>
OF table sections all have the same pattern, so create a macro to define
them and insure consistency.
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
---
include/asm-generic/vmlinux.lds.h | 58 ++++++++++-----------------------------
1 file changed, 14 insertions(+), 44 deletions(-)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index d09e670..000a0f30 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -139,52 +139,22 @@
#define TRACE_SYSCALLS()
#endif
-#ifdef CONFIG_CLKSRC_OF
-#define CLKSRC_OF_TABLES() . = ALIGN(8); \
- VMLINUX_SYMBOL(__clksrc_of_table) = .; \
- *(__clksrc_of_table) \
- *(__clksrc_of_table_end)
-#else
-#define CLKSRC_OF_TABLES()
-#endif
-#ifdef CONFIG_IRQCHIP
-#define IRQCHIP_OF_MATCH_TABLE() \
+#define ___OF_TABLE(cfg, name) _OF_TABLE_##cfg(name)
+#define __OF_TABLE(cfg, name) ___OF_TABLE(cfg, name)
+#define OF_TABLE(cfg, name) __OF_TABLE(config_enabled(cfg), name)
+#define _OF_TABLE_0(name)
+#define _OF_TABLE_1(name) \
. = ALIGN(8); \
- VMLINUX_SYMBOL(__irqchip_of_table) = .; \
- *(__irqchip_of_table) \
- *(__irqchip_of_table_end)
-#else
-#define IRQCHIP_OF_MATCH_TABLE()
-#endif
-
-#ifdef CONFIG_COMMON_CLK
-#define CLK_OF_TABLES() . = ALIGN(8); \
- VMLINUX_SYMBOL(__clk_of_table) = .; \
- *(__clk_of_table) \
- *(__clk_of_table_end)
-#else
-#define CLK_OF_TABLES()
-#endif
-
-#ifdef CONFIG_SMP
-#define CPU_METHOD_OF_TABLES() . = ALIGN(8); \
- VMLINUX_SYMBOL(__cpu_method_of_table) = .; \
- *(__cpu_method_of_table) \
- *(__cpu_method_of_table_end)
-#else
-#define CPU_METHOD_OF_TABLES()
-#endif
-
-#ifdef CONFIG_OF_RESERVED_MEM
-#define RESERVEDMEM_OF_TABLES() \
- . = ALIGN(8); \
- VMLINUX_SYMBOL(__reservedmem_of_table) = .; \
- *(__reservedmem_of_table) \
- *(__reservedmem_of_table_end)
-#else
-#define RESERVEDMEM_OF_TABLES()
-#endif
+ VMLINUX_SYMBOL(__##name##_of_table) = .; \
+ *(__##name##_of_table) \
+ *(__##name##_of_table_end)
+
+#define CLKSRC_OF_TABLES() OF_TABLE(CONFIG_CLKSRC_OF, clksrc)
+#define IRQCHIP_OF_MATCH_TABLE() OF_TABLE(CONFIG_IRQCHIP, irqchip)
+#define CLK_OF_TABLES() OF_TABLE(CONFIG_COMMON_CLK, clk)
+#define CPU_METHOD_OF_TABLES() OF_TABLE(CONFIG_SMP, cpu_method)
+#define RESERVEDMEM_OF_TABLES() OF_TABLE(CONFIG_OF_RESERVED_MEM, reservedmem)
#define KERNEL_DTB() \
STRUCT_ALIGN(); \
--
1.8.3.2
next prev parent reply other threads:[~2014-03-27 19:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-27 19:41 [RFC PATCH 0/4] vmlinux.lds.h clean-ups Rob Herring
2014-03-27 19:41 ` [RFC PATCH 1/4] irqchip: align irqchip OF match table section naming Rob Herring
2014-03-27 19:41 ` Rob Herring
2014-03-27 19:41 ` [RFC PATCH 2/4] ARM: align cpu_method_of_table naming Rob Herring
2014-03-27 19:41 ` Rob Herring [this message]
2014-03-27 19:41 ` [RFC PATCH 3/4] vmlinuz.lds: define OF table sections with macros Rob Herring
2014-03-27 19:41 ` [RFC PATCH 4/4] vmlinux.lds: define conditional " Rob Herring
2014-04-15 20:34 ` [RFC PATCH 0/4] vmlinux.lds.h clean-ups Rob Herring
2014-04-24 13:23 ` Arnd Bergmann
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=1395949317-8738-4-git-send-email-robherring2@gmail.com \
--to=robherring2@gmail.com \
--cc=arnd@arndb.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=robh@kernel.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).