summaryrefslogtreecommitdiffstats
path: root/discover/parser-utils.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2009-01-02 18:27:00 +0900
committerJeremy Kerr <jk@ozlabs.org>2009-01-02 18:27:00 +0900
commit89ccc8e6dc81bc1d613454b9944c2f3324d43e2a (patch)
treeaab4c63f6e29336ae423c905b55acf4329e6db15 /discover/parser-utils.h
parentce5eab024583af5a4725503bad6ed2aee452b1aa (diff)
downloadtalos-petitboot-89ccc8e6dc81bc1d613454b9944c2f3324d43e2a.tar.gz
talos-petitboot-89ccc8e6dc81bc1d613454b9944c2f3324d43e2a.zip
Use separate section for parsers array
Instead of hardcoding the array of parsers, use the linker to do the work for us. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/parser-utils.h')
-rw-r--r--discover/parser-utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/discover/parser-utils.h b/discover/parser-utils.h
index e82e3f9..955f5f4 100644
--- a/discover/parser-utils.h
+++ b/discover/parser-utils.h
@@ -7,6 +7,16 @@
#define artwork_pathname(file) (PKG_SHARE_DIR "/artwork/" file)
+#define define_parser(__name, __priority, __parse_fn) \
+ struct parser \
+ __attribute__((unused, section("parsers"))) \
+ __ ## __name ## _parser = { \
+ .name = #__name, \
+ .priority = __priority, \
+ .parse = __parse_fn, \
+ };
+
+
void device_add_boot_option(struct device *device,
struct boot_option *boot_option);
OpenPOWER on IntegriCloud