[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1324174076.2844.11.camel@deadeye>
Date: Sun, 18 Dec 2011 02:07:56 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: LKML <linux-kernel@...r.kernel.org>,
David Woodhouse <dwmw2@...radead.org>
Subject: [RFC][PATCH 1/2] firmware, module: Keep names of firmware blobs
required by built-in drivers
[This belongs before the previous patch, which should be considered
2/2.]
Change MODULE_FIRMWARE() to include the given blob name to the object
file even when not building a module. Discard that information when
linking vmlinux.
This will allow us to stop repeating this information in
firmware/Makefile.
---
include/asm-generic/vmlinux.lds.h | 1 +
include/linux/module.h | 7 +++++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index b5e2e4c..7d1f1d7 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -678,6 +678,7 @@
EXIT_CALL \
*(.discard) \
*(.discard.*) \
+ *(.firmware_wanted) \
}
/**
diff --git a/include/linux/module.h b/include/linux/module.h
index 3cb7839..2cc323d 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -176,7 +176,14 @@ extern const struct gtype##_id __mod_##gtype##_table \
/* Optional firmware file (or files) needed by the module
* format is simply firmware file name. Multiple firmware
* files require multiple MODULE_FIRMWARE() specifiers */
+#ifdef MODULE
#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
+#else
+#define MODULE_FIRMWARE(_firmware) \
+ static const char __module_cat(firmware, __LINE__)[] \
+ __used __attribute__((section(".firmware_wanted"), unused, aligned(1))) \
+ = _firmware
+#endif
/* Given an address, look for it in the exception tables */
const struct exception_table_entry *search_exception_tables(unsigned long add);
--
1.7.7.3
Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)
Powered by blists - more mailing lists