summaryrefslogtreecommitdiffstats
path: root/include/globalvar.h
Commit message (Collapse)AuthorAgeFilesLines
* nv: add device parameter overwrites to completion listSascha Hauer2017-11-231-1/+2
| | | | | | | | nv variables in the form dev.<devname>.* can be used to make device parameters persistent. Add these to the completion list to make setting these variables more convenient. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "globalvar: make globalvar functions more consistent"Sascha Hauer2017-06-131-96/+13
| | | | This reverts commit 1b4a05c9263ae26083526acfabdea1ef96531a1d.
* globalvar: make globalvar functions more consistentSascha Hauer2017-04-111-13/+96
| | | | | | | | | Similar to the device parameter functions also make the globalvar functions more consistent. This also adds support for readonly globalvars and changes several existing globalvars which should really be readonly to readonly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: remove unused globalvar_add()Sascha Hauer2017-04-071-12/+0
| | | | | | globalvar_add() is unused in the tree. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nvvar: add static inline dummy for nvvar_saveLucas Stach2017-01-091-0/+5
| | | | | | | | Just as the other NVVAR functions, when support for NVVAR isn't compiled in. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* complete: Add completion for nv and globalvar commandsSascha Hauer2016-10-181-0/+2
| | | | | | | | The 'nv' command is often used to create a nv variable for an existing global variable, so add a command completion function for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: introduce globalvar_add_simple_bitmaskSascha Hauer2016-09-221-0/+10
| | | | | | | Using the just introduced param_bitmask this adds the corresponding globalvar convenience function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: Move static inline functions to common/Sascha Hauer2016-09-221-69/+7
| | | | | | | These functions will get bigger in the next patch which disqualifies them as static inline functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nv: Save nv variables on shutdownSascha Hauer2016-07-221-0/+3
| | | | | | | | | | | | | | | | | | | With this patch nv variables are automatically saved whenever barebox shuts down (that is 'reset' is executed or a kernel is started). With this the additional 'saveenv' step becomes unnecessary. The nv variables are stored in the environment and the estasblished behaviour is that files in the environment must be manually saved using 'saveenv'. This behaviour shall be kept for now, so this patch cannot just call 'saveenv' since that would save the modified environment files aswell. Instead we read the environment from the device, modifiy the nv variables and save the environment back. Since this changes a long existing behaviour messages are printed the first time a nv variable is modified and during shutdown when the variables are actually saved. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Introduce non volatile device variablesSascha Hauer2016-07-061-0/+6
| | | | | | | | | | | | | | Non volatile device variables are used to make device parameters persistent. They are like normal non volatile variables, but set the values of the device parameters with the corresponding name. Every nv variable beginning with nv.dev is a non volatile device variable. They have the form nv.dev.<devname>.<paramname> and act on the parameter <paramname> of the device named <devname>. The non volatile device variables are designated for example for video modes, ethernet device ip addresses or mtd partitioning. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nvvar: add missing static inline stubsLucas Stach2016-05-301-0/+12
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: add missing static inline stubsLucas Stach2016-05-301-0/+4
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: Allow to remove globalvarsSascha Hauer2016-04-291-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* param_enum: Make name strings constSascha Hauer2015-08-261-2/+2
| | | | | | | | Not only the array containing the pointers should be const but also the strings themselves, so instead of using const char ** use const char * const *. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add globalvar_add_simple_string functionSascha Hauer2015-06-181-0/+19
| | | | | | | | This adds a globalvar string function to pass a pointer to a string. With this we can directly access the string to get the variable and don't have to getenv() the string first. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: Add support for printing all global variablesSascha Hauer2014-11-061-0/+1
| | | | | | | | | This could previously only be done with 'devinfo global'. While this is still possible this adds a more direct access via the globalvar command. This variant also adds a '*' in front of the variable if the corresponding non volatile variable exists. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add support for non volatile variablesSascha Hauer2014-11-061-0/+12
| | | | | | | | | | | | | | | This adds (back) support for non volatile variables. Non volatile variables are variables which are stored in the environment over reboot. They are used in the same way as the global variables, but with a 'nv' command and device. The variables are stored under /env/nv/, one variable per file. Adding a nv variable automatically adds a global variable with the same name. Changing a nv variable also changes the same global variable, but not the other way round. This allows for example to configure the username as: nv user=sha; saveenv Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: add globalvar_add_simple_int/bool/enum/ip supportJean-Christophe PLAGNIOL-VILLARD2013-09-181-0/+84
| | | | | | | so we can types var Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: Allow to set initial valueSascha Hauer2013-08-161-2/+2
| | | | | | | Calling globalvar_add_simple() and setting a value is more than common. Add a parameter for the initial value. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: add missing includeSascha Hauer2013-08-141-0/+2
| | | | | | include/globalvar.h needs struct param_d, so include <param.h> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Fix typo seperate -> separateSascha Hauer2013-05-211-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: add support to set a value to of all globalvars beginning with ↵Jean-Christophe PLAGNIOL-VILLARD2012-09-141-0/+3
| | | | | | | | 'match' via c global_set_match and global -r Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* globalvar: add inline when not enabledJean-Christophe PLAGNIOL-VILLARD2012-09-141-0/+20
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add 'global' commandSascha Hauer2012-05-141-0/+12
This implements global shell variable support. This is done by registering a new device named 'global', so global variables are just plain device parameters. Global variables are useful for storing the global state in the environment. Currently we do this by sourcing scripts instead of executing them which is quite limiting. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>