提交 bbba7757 编写于 作者: P Peter Maydell

hw/core/generic-loader: Allow PC to be set on command line

The documentation for the generic loader claims that you can
set the PC for a CPU with an option of the form
  -device loader,cpu-num=0,addr=0x10000004

However if you try this QEMU complains:
  cpu_num must be specified when setting a program counter

This is because we were testing against 0 rather than CPU_NONE.
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NAlistair Francis <alistair.francis@xilinx.com>
Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180205150426.20542-1-peter.maydell@linaro.org
上级 384c6c03
...@@ -105,7 +105,7 @@ static void generic_loader_realize(DeviceState *dev, Error **errp) ...@@ -105,7 +105,7 @@ static void generic_loader_realize(DeviceState *dev, Error **errp)
error_setg(errp, "data can not be specified when setting a " error_setg(errp, "data can not be specified when setting a "
"program counter"); "program counter");
return; return;
} else if (!s->cpu_num) { } else if (s->cpu_num == CPU_NONE) {
error_setg(errp, "cpu_num must be specified when setting a " error_setg(errp, "cpu_num must be specified when setting a "
"program counter"); "program counter");
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册