summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-09-12 14:59:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-22 11:32:00 +0200
commit18697b7afcfb1688920b3eede30b85064b7b5b54 (patch)
tree78c5f3fc362e3ff3081bdfb741ca68532f0fda89 /include
parent5cc00c3e2aee8c639e1632122f182b31309e7e37 (diff)
downloadbarebox-18697b7afcfb1688920b3eede30b85064b7b5b54.tar.gz
barebox-18697b7afcfb1688920b3eede30b85064b7b5b54.tar.xz
param: introduce param_bitmask
param_bitmask behaves similar to an enum, except that with a bitmask multiple values can be specified. On the command line the bits are represented as a space separated list of strings. In memory a unsigned long * is used as backend storage, this can be modified using the regular bitmap functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/param.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/param.h b/include/param.h
index 68e08a254e..0f7d2446a2 100644
--- a/include/param.h
+++ b/include/param.h
@@ -53,6 +53,11 @@ struct param_d *dev_add_param_enum(struct device_d *dev, const char *name,
int (*get)(struct param_d *p, void *priv),
int *value, const char * const *names, int max, void *priv);
+struct param_d *dev_add_param_bitmask(struct device_d *dev, const char *name,
+ int (*set)(struct param_d *p, void *priv),
+ int (*get)(struct param_d *p, void *priv),
+ unsigned long *value, const char * const *names, int max, void *priv);
+
struct param_d *dev_add_param_int_ro(struct device_d *dev, const char *name,
int value, const char *format);