summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell2018-02-05 16:04:26 +0100
committerPeter Maydell2018-02-09 11:55:40 +0100
commitbbba7757bacc9f890a3f028d328b4b429dbe78ec (patch)
tree20ec2e25be5c4c4a4f4547cb5d0012af6623b031 /hw
parenttarget/arm/translate.c: Fix missing 'break' for TT insns (diff)
downloadqemu-bbba7757bacc9f890a3f028d328b4b429dbe78ec.tar.gz
qemu-bbba7757bacc9f890a3f028d328b4b429dbe78ec.tar.xz
qemu-bbba7757bacc9f890a3f028d328b4b429dbe78ec.zip
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: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180205150426.20542-1-peter.maydell@linaro.org
Diffstat (limited to 'hw')
-rw-r--r--hw/core/generic-loader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c
index 46012673c3..cb0e68486d 100644
--- a/hw/core/generic-loader.c
+++ b/hw/core/generic-loader.c
@@ -105,7 +105,7 @@ static void generic_loader_realize(DeviceState *dev, Error **errp)
error_setg(errp, "data can not be specified when setting a "
"program counter");
return;
- } else if (!s->cpu_num) {
+ } else if (s->cpu_num == CPU_NONE) {
error_setg(errp, "cpu_num must be specified when setting a "
"program counter");
return;