diff options
author | Alistair Francis | 2016-11-12 03:51:20 +0100 |
---|---|---|
committer | Peter Maydell | 2016-11-28 12:25:58 +0100 |
commit | 6aa3a61657a60ad2c422c720bfaa31589a6e7334 (patch) | |
tree | e481ee6a78631d50fc69187bf4b9cf89b0d0f3b0 /hw/core | |
parent | Update version for v2.8.0-rc1 release (diff) | |
download | qemu-6aa3a61657a60ad2c422c720bfaa31589a6e7334.tar.gz qemu-6aa3a61657a60ad2c422c720bfaa31589a6e7334.tar.xz qemu-6aa3a61657a60ad2c422c720bfaa31589a6e7334.zip |
generic-loader: file: Only set a PC if a CPU is specified
This patch fixes the generic-loader file loading to only set the program
counter if a CPU is specified. This follows what is written in the
documentation and was always part of the original intention.
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 537bf4d08be7acf7a89b590cff69e19db7f0a6cd.1478908712.git.alistair.francis@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/core')
-rw-r--r-- | hw/core/generic-loader.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index 79ab6df357..208f549dff 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -93,7 +93,12 @@ static void generic_loader_realize(DeviceState *dev, Error **errp) "image"); return; } - s->set_pc = true; + /* The user specified a file, only set the PC if they also specified + * a CPU to use. + */ + if (s->cpu_num != CPU_NONE) { + s->set_pc = true; + } } else if (s->addr) { /* User is setting the PC */ if (s->data || s->data_len || s->data_be) { |