summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-05-14 22:55:25 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-05-15 09:05:51 +0200
commite58f05ae2add56dec9ffdb3a6179d4345880551a (patch)
treedb4d8cfa1e4d41d110affb0e2d2b41efd716334a /include
parentffd5d1eadf0e514a83c77f59b3671b2066987274 (diff)
downloadbarebox-e58f05ae2add56dec9ffdb3a6179d4345880551a.tar.gz
barebox-e58f05ae2add56dec9ffdb3a6179d4345880551a.tar.xz
magicvar: Add magicvar macro with additional name argument
Currently magicvar fails on variables containing a '.' because we can't use these as C names. Overcome this by adding a new macro which allows to specify a name seperately. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/magicvar.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/magicvar.h b/include/magicvar.h
index d27a2e32a..bb5bd2591 100644
--- a/include/magicvar.h
+++ b/include/magicvar.h
@@ -18,14 +18,18 @@ extern struct magicvar __barebox_magicvar_end;
#endif
#ifdef CONFIG_CMD_MAGICVAR
-#define BAREBOX_MAGICVAR(_name, _description) \
+#define BAREBOX_MAGICVAR_NAMED(_name, _varname, _description) \
extern const struct magicvar __barebox_magicvar_##_name; \
const struct magicvar __barebox_magicvar_##_name \
__attribute__ ((unused,section (".barebox_magicvar_" __stringify(_name)))) = { \
- .name = #_name, \
+ .name = #_varname, \
.description = MAGICVAR_DESCRIPTION(_description), \
};
+
+#define BAREBOX_MAGICVAR(_name, _description) \
+ BAREBOX_MAGICVAR_NAMED(_name, _name, _description)
#else
+#define BAREBOX_MAGICVAR_NAMED(_name, _varname, _description)
#define BAREBOX_MAGICVAR(_name, _description)
#endif