aboutsummaryrefslogtreecommitdiff
path: root/hw/mips_r4k.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-01-06 01:37:51 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-01-06 01:37:51 +0000
commitf7bcd4e373193fd3d78d7ee24c0a1bcca9dcc3a3 (patch)
treeebcaf850d203aac2b8fe0551dd2958b3661263c1 /hw/mips_r4k.c
parent43c1b7e4c35f1dc7ee073733ddb16339c216183b (diff)
downloadqemu-f7bcd4e373193fd3d78d7ee24c0a1bcca9dcc3a3.zip
qemu-f7bcd4e373193fd3d78d7ee24c0a1bcca9dcc3a3.tar.gz
qemu-f7bcd4e373193fd3d78d7ee24c0a1bcca9dcc3a3.tar.bz2
Different MIPS BIOS binary names per endianness, and more relaxed size
rules for the binaries, by Alec Voropay. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2302 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/mips_r4k.c')
-rw-r--r--hw/mips_r4k.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index eee2970..5f5b799 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -9,7 +9,11 @@
*/
#include "vl.h"
+#ifdef TARGET_BIG_ENDIAN
#define BIOS_FILENAME "mips_bios.bin"
+#else
+#define BIOS_FILENAME "mipsel_bios.bin"
+#endif
//#define BIOS_FILENAME "system.bin"
#ifdef MIPS_HAS_MIPS64
#define INITRD_LOAD_ADDR (int64_t)(int32_t)0x80800000
@@ -136,7 +140,7 @@ void mips_r4k_init (int ram_size, int vga_ram_size, int boot_device,
{
char buf[1024];
unsigned long bios_offset;
- int ret;
+ int bios_size;
CPUState *env;
static RTCState *rtc_state;
int i;
@@ -160,8 +164,8 @@ void mips_r4k_init (int ram_size, int vga_ram_size, int boot_device,
run. */
bios_offset = ram_size + vga_ram_size;
snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
- ret = load_image(buf, phys_ram_base + bios_offset);
- if (ret == BIOS_SIZE) {
+ bios_size = load_image(buf, phys_ram_base + bios_offset);
+ if (bios_size > 0 & bios_size <= BIOS_SIZE) {
cpu_register_physical_memory((uint32_t)(0x1fc00000),
BIOS_SIZE, bios_offset | IO_MEM_ROM);
} else {