aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/armv7m.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@amazon.com>2013-11-05 10:33:32 -0800
committerAnthony Liguori <aliguori@amazon.com>2013-11-05 10:33:32 -0800
commita30b377e0a921bf93349dc4adb94580a3bec7ea4 (patch)
treeac3d4a52357d07b7c3d6928fc6001845fcb06c45 /hw/arm/armv7m.c
parentc905c5012ac0c6fde3b8094d2206a3139deddba2 (diff)
parent80bbaee66ac38bcb5fe5a6f285e20457afcc8bec (diff)
Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging
QOM device refactorings * QTest coverage for all machines * QOM realize for Milkymist UART * QOM realize for ARM MPCore * device_add bug fixes and cleanups * QOM for PCMCIA/MicroDrive (last legacy IDE device) # gpg: Signature made Tue 05 Nov 2013 09:07:03 AM PST using RSA key ID 3E7E013F # gpg: Can't check signature: public key not found # By Andreas Färber (49) and others # Via Andreas Färber * afaerber/tags/qom-devices-for-anthony: (54 commits) pcmcia/pxa2xx: QOM'ify PXA2xxPCMCIAState ide: Drop ide_init2_with_non_qdev_drives() microdrive: Coding Style cleanups pcmcia: QOM'ify PCMCIACardState and MicroDriveState pxa: Fix typo "dettach" qom: Fix pointer to int property helpers' documentation qdev-monitor: Inline qdev_init() for device_add qdev-monitor: Avoid qdev as variable name qdev: Drop misleading qdev_free() function qdev-monitor: Unref device when device_add fails qdev-monitor: Fix crash when device_add is called with abstract driver qdev-monitor: Clean up qdev_device_add() variable naming arm11mpcore: Split off RealView MPCore arm11mpcore: Prepare for QOM embedding arm11mpcore: Convert mpcore_rirq_state to QOM realize realview_gic: Prepare for QOM embedding realview_gic: Convert to QOM realize arm11mpcore: Convert ARM11MPCorePriveState to QOM realize arm11mpcore: Split off SCU device arm11mpcore: Create container MemoryRegion in instance_init ...
Diffstat (limited to 'hw/arm/armv7m.c')
-rw-r--r--hw/arm/armv7m.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index 89a9015de7..397e8dfb37 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -11,6 +11,8 @@
#include "hw/arm/arm.h"
#include "hw/loader.h"
#include "elf.h"
+#include "sysemu/qtest.h"
+#include "qemu/error-report.h"
/* Bitbanded IO. Each word corresponds to a single bit. */
@@ -232,21 +234,22 @@ qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
big_endian = 0;
#endif
- if (!kernel_filename) {
+ if (!kernel_filename && !qtest_enabled()) {
fprintf(stderr, "Guest image must be specified (using -kernel)\n");
exit(1);
}
- image_size = load_elf(kernel_filename, NULL, NULL, &entry, &lowaddr,
- NULL, big_endian, ELF_MACHINE, 1);
- if (image_size < 0) {
- image_size = load_image_targphys(kernel_filename, 0, flash_size);
- lowaddr = 0;
- }
- if (image_size < 0) {
- fprintf(stderr, "qemu: could not load kernel '%s'\n",
- kernel_filename);
- exit(1);
+ if (kernel_filename) {
+ image_size = load_elf(kernel_filename, NULL, NULL, &entry, &lowaddr,
+ NULL, big_endian, ELF_MACHINE, 1);
+ if (image_size < 0) {
+ image_size = load_image_targphys(kernel_filename, 0, flash_size);
+ lowaddr = 0;
+ }
+ if (image_size < 0) {
+ error_report("Could not load kernel '%s'", kernel_filename);
+ exit(1);
+ }
}
/* Hack to map an additional page of ram at the top of the address