mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Add magicvar description for flexible bootargs
@ 2012-05-15  7:07 Sascha Hauer
  2012-05-15  7:07 ` [PATCH 1/2] magicvar: Add magicvar macro with additional name argument Sascha Hauer
  2012-05-15  7:07 ` [PATCH 2/2] flexible bootargs: Add magicvar descriptions Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Sascha Hauer @ 2012-05-15  7:07 UTC (permalink / raw)
  To: barebox

----------------------------------------------------------------
Sascha Hauer (2):
      magicvar: Add magicvar macro with additional name argument
      flexible bootargs: Add magicvar descriptions

 common/bootargs.c  |    4 ++++
 include/magicvar.h |    8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] magicvar: Add magicvar macro with additional name argument
  2012-05-15  7:07 Add magicvar description for flexible bootargs Sascha Hauer
@ 2012-05-15  7:07 ` Sascha Hauer
  2012-05-15  7:07 ` [PATCH 2/2] flexible bootargs: Add magicvar descriptions Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2012-05-15  7:07 UTC (permalink / raw)
  To: barebox

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>
---
 include/magicvar.h |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/magicvar.h b/include/magicvar.h
index d27a2e3..bb5bd25 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
 
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] flexible bootargs: Add magicvar descriptions
  2012-05-15  7:07 Add magicvar description for flexible bootargs Sascha Hauer
  2012-05-15  7:07 ` [PATCH 1/2] magicvar: Add magicvar macro with additional name argument Sascha Hauer
@ 2012-05-15  7:07 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2012-05-15  7:07 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/bootargs.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/bootargs.c b/common/bootargs.c
index b17e6d1..60e936d 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");
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-15  7:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15  7:07 Add magicvar description for flexible bootargs Sascha Hauer
2012-05-15  7:07 ` [PATCH 1/2] magicvar: Add magicvar macro with additional name argument Sascha Hauer
2012-05-15  7:07 ` [PATCH 2/2] flexible bootargs: Add magicvar descriptions Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox