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/common/kernel.c | |
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/common/kernel.c')
-rw-r--r-- | xen/common/kernel.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 971d723109..9dadffec73 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -92,6 +92,21 @@ void cmdline_parse(char *cmdline) bool_assert = !bool_assert; *(int *)param->var = bool_assert; break; + case OPT_SIZE: { + uint64_t sz = parse_size_and_unit(optval, NULL); + switch ( param->len ) + { + case sizeof(uint32_t): + *(uint32_t *)param->var = sz; + break; + case sizeof(uint64_t): + *(uint64_t *)param->var = sz; + break; + default: + BUG(); + } + break; + } case OPT_CUSTOM: ((void (*)(const char *))param->var)(optval); break; |