summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-05-15 20:34:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-05-15 20:34:34 +0200
commit3f66e8dc57d0dd05e22d321786da39810ba6b7ff (patch)
tree0e3f62a46c2fb05f50f73d7575ff1fff3688e520
parentcff2d83a86a83d8cd0535e0c8edd364f91039270 (diff)
parent69ee684695209036e0e134324a1c310efbd4b46d (diff)
downloadbarebox-3f66e8dc57d0dd05e22d321786da39810ba6b7ff.tar.gz
barebox-3f66e8dc57d0dd05e22d321786da39810ba6b7ff.tar.xz
Merge branch 'pu/magicvar' into next
-rw-r--r--common/bootargs.c4
-rw-r--r--include/magicvar.h8
2 files changed, 10 insertions, 2 deletions
diff --git a/common/bootargs.c b/common/bootargs.c
index b17e6d15a..60e936da3 100644
--- a/common/bootargs.c
+++ b/common/bootargs.c
@@ -22,6 +22,7 @@
#include <common.h>
#include <boot.h>
#include <malloc.h>
+#include <magicvar.h>
#include <globalvar.h>
#include <environment.h>
@@ -77,3 +78,6 @@ int linux_bootargs_overwrite(const char *bootargs)
return 0;
}
+
+BAREBOX_MAGICVAR_NAMED(global_linux_bootargs_, global.linux.bootargs.*, "Linux bootargs variables");
+BAREBOX_MAGICVAR_NAMED(global_linux_mtdparts_, global.linux.mtdparts.*, "Linux mtdparts variables");
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