HV:- Refine strtol() & strtoul()

- replace 'strtol()' with 'strtol_deci()'
    -- supports string with decimal format

 - replace 'strtoul()' with 'strtoul_hex()'
    -- support string with hex format

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yonghua Huang
2018-06-29 03:09:56 +08:00
committed by lijinxia
parent 41b39c5e1f
commit bbdb204750
4 changed files with 32 additions and 227 deletions

View File

@@ -46,7 +46,7 @@ static void handle_cmd(const char *cmd, int len)
/* set uart disabled*/
uart16550_set_property(0, 0, 0);
} else if ((i == IDX_PORT_UART) || (i == IDX_MMIO_UART)) {
uint64_t addr = strtoul(cmd + tmp, NULL, 16);
uint64_t addr = strtoul_hex(cmd + tmp);
dev_dbg(ACRN_DBG_PARSE, "uart addr=0x%llx", addr);