diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-08-31 10:06:53 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-08-31 10:06:53 +0100 |
commit | e351818d402419da30bcd2e13ec0896d66b990d6 (patch) | |
tree | f13dc7244d9e40e583dc7366d72622e55e61bfd7 /xen/include/xen/init.h | |
parent | 2ea33061b38d5997323293da150b1bda8c6beba2 (diff) | |
download | xen-e351818d402419da30bcd2e13ec0896d66b990d6.tar.gz xen-e351818d402419da30bcd2e13ec0896d66b990d6.tar.bz2 xen-e351818d402419da30bcd2e13ec0896d66b990d6.zip |
introduce size_param()
With there being several instances of custom_param() where the handler
is just invoking parse_size_and_unit(), it seems to make sense to
introduce a simplifying abstraction.
Also fix serial_txbufsz not having been guaranteed to be a power of
two.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/include/xen/init.h')
-rw-r--r-- | xen/include/xen/init.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h index 7e79e52fe3..4f9019afe0 100644 --- a/xen/include/xen/init.h +++ b/xen/include/xen/init.h @@ -78,7 +78,14 @@ extern initcall_t __initcall_start, __initcall_end; */ struct kernel_param { const char *name; - enum { OPT_STR, OPT_UINT, OPT_BOOL, OPT_INVBOOL, OPT_CUSTOM } type; + enum { + OPT_STR, + OPT_UINT, + OPT_BOOL, + OPT_INVBOOL, + OPT_SIZE, + OPT_CUSTOM + } type; void *var; unsigned int len; }; @@ -101,6 +108,10 @@ extern struct kernel_param __setup_start, __setup_end; static char __setup_str_##_var[] __initdata = _name; \ static struct kernel_param __setup_##_var __attribute_used__ \ __initsetup = { __setup_str_##_var, OPT_UINT, &_var, sizeof(_var) } +#define size_param(_name, _var) \ + static char __setup_str_##_var[] __initdata = _name; \ + static struct kernel_param __setup_##_var __attribute_used__ \ + __initsetup = { __setup_str_##_var, OPT_SIZE, &_var, sizeof(_var) } #define string_param(_name, _var) \ static char __setup_str_##_var[] __initdata = _name; \ static struct kernel_param __setup_##_var __attribute_used__ \ |