aboutsummaryrefslogtreecommitdiff
path: root/hw/mips/malta.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/mips/malta.c')
-rw-r--r--hw/mips/malta.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index cbdbb21..02da629 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -52,6 +52,7 @@
#include "system/qtest.h"
#include "system/reset.h"
#include "system/runstate.h"
+#include "system/system.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "system/kvm.h"
@@ -1190,7 +1191,7 @@ void mips_malta_init(MachineState *machine)
* In little endian mode the 32bit words in the bios are swapped,
* a neat trick which allows bi-endian firmware.
*/
- if (!TARGET_BIG_ENDIAN) {
+ if (!TARGET_BIG_ENDIAN && bios_size > 0) {
uint32_t *end, *addr;
const size_t swapsize = MIN(bios_size, 0x3e0000);
addr = rom_ptr(FLASH_ADDRESS, swapsize);