summary refs log tree commit diff stats
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/mips_malta.c4
-rw-r--r--hw/mips_pica61.c4
-rw-r--r--hw/mips_r4k.c4
-rw-r--r--hw/pc.c4
-rw-r--r--hw/ppc405_boards.c8
-rw-r--r--hw/ppc_chrp.c4
-rw-r--r--hw/ppc_prep.c4
-rw-r--r--hw/shix.c8
-rw-r--r--hw/sun4m.c4
-rw-r--r--hw/sun4u.c4
10 files changed, 35 insertions, 13 deletions
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index 3b37596d19..6f0edf9a3b 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -791,7 +791,9 @@ void mips_malta_init (int ram_size, int vga_ram_size, int boot_device,
 
     /* Load a BIOS image unless a kernel image has been specified. */
     if (!kernel_filename) {
-        snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
+        if (bios_name == NULL)
+            bios_name = BIOS_FILENAME;
+        snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
         ret = load_image(buf, phys_ram_base + bios_offset);
         if (ret < 0 || ret > BIOS_SIZE) {
             fprintf(stderr,
diff --git a/hw/mips_pica61.c b/hw/mips_pica61.c
index 2c44150176..9584046176 100644
--- a/hw/mips_pica61.c
+++ b/hw/mips_pica61.c
@@ -94,7 +94,9 @@ void mips_pica61_init (int ram_size, int vga_ram_size, int boot_device,
 
     /* load a BIOS image */
     bios_offset = ram_size + vga_ram_size;
-    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
+    if (bios_name == NULL)
+        bios_name = BIOS_FILENAME;
+    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
     bios_size = load_image(buf, phys_ram_base + bios_offset);
     if ((bios_size <= 0) || (bios_size > BIOS_SIZE)) {
         /* fatal */
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index 5769ade968..47b51c7b0d 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -179,7 +179,9 @@ void mips_r4k_init (int ram_size, int vga_ram_size, int boot_device,
        preloaded we also initialize the hardware, since the BIOS wasn't
        run. */
     bios_offset = ram_size + vga_ram_size;
-    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
+    if (bios_name == NULL)
+        bios_name = BIOS_FILENAME;
+    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
     bios_size = load_image(buf, phys_ram_base + bios_offset);
     if ((bios_size > 0) && (bios_size <= BIOS_SIZE)) {
 	cpu_register_physical_memory(0x1fc00000,
diff --git a/hw/pc.c b/hw/pc.c
index ace0cee1ff..5bc0b63e79 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -706,7 +706,9 @@ static void pc_init1(int ram_size, int vga_ram_size, int boot_device,
     vga_ram_addr = qemu_ram_alloc(vga_ram_size);
 
     /* BIOS load */
-    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
+    if (bios_name == NULL)
+        bios_name = BIOS_FILENAME;
+    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
     bios_size = get_image_size(buf);
     if (bios_size <= 0 ||
         (bios_size % 65536) != 0) {
diff --git a/hw/ppc405_boards.c b/hw/ppc405_boards.c
index ebf160cb75..8c00148d7f 100644
--- a/hw/ppc405_boards.c
+++ b/hw/ppc405_boards.c
@@ -236,7 +236,9 @@ static void ref405ep_init (int ram_size, int vga_ram_size, int boot_device,
 #ifdef DEBUG_BOARD_INIT
         printf("Load BIOS from file\n");
 #endif
-        snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
+        if (bios_name == NULL)
+            bios_name = BIOS_FILENAME;
+        snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
         bios_size = load_image(buf, phys_ram_base + bios_offset);
         if (bios_size < 0 || bios_size > BIOS_SIZE) {
             fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n", buf);
@@ -549,7 +551,9 @@ static void taihu_405ep_init(int ram_size, int vga_ram_size, int boot_device,
 #ifdef DEBUG_BOARD_INIT
         printf("Load BIOS from file\n");
 #endif
-        snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
+        if (bios_name == NULL)
+            bios_name = BIOS_FILENAME;
+        snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
         bios_size = load_image(buf, phys_ram_base + bios_offset);
         if (bios_size < 0 || bios_size > BIOS_SIZE) {
             fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n", buf);
diff --git a/hw/ppc_chrp.c b/hw/ppc_chrp.c
index 653f7c3a7c..f53c85b855 100644
--- a/hw/ppc_chrp.c
+++ b/hw/ppc_chrp.c
@@ -349,7 +349,9 @@ static void ppc_chrp_init (int ram_size, int vga_ram_size, int boot_device,
 
     /* allocate and load BIOS */
     bios_offset = ram_size + vga_ram_size;
-    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
+    if (bios_name == NULL)
+        bios_name = BIOS_FILENAME;
+    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
     bios_size = load_image(buf, phys_ram_base + bios_offset);
     if (bios_size < 0 || bios_size > BIOS_SIZE) {
         cpu_abort(env, "qemu: could not load PowerPC bios '%s'\n", buf);
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 9e2a4403a5..16d8915e5f 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -564,7 +564,9 @@ static void ppc_prep_init (int ram_size, int vga_ram_size, int boot_device,
 
     /* allocate and load BIOS */
     bios_offset = ram_size + vga_ram_size;
-    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
+    if (bios_name == NULL)
+        bios_name = BIOS_FILENAME;
+    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
     bios_size = load_image(buf, phys_ram_base + bios_offset);
     if (bios_size < 0 || bios_size > BIOS_SIZE) {
         cpu_abort(env, "qemu: could not load PPC PREP bios '%s'\n", buf);
diff --git a/hw/shix.c b/hw/shix.c
index e668426c89..884178e94f 100644
--- a/hw/shix.c
+++ b/hw/shix.c
@@ -83,12 +83,14 @@ void shix_init(int ram_size, int vga_ram_size, int boot_device,
     cpu_register_physical_memory(0x0c000000, 0x01000000, 0x01004000);
 
     /* Load BIOS in 0 (and access it through P2, 0xA0000000) */
-    printf("%s: load BIOS '%s'\n", __func__, BIOS_FILENAME);
-    ret = load_image(BIOS_FILENAME, phys_ram_base);
+    if (bios_name == NULL)
+        bios_name = BIOS_FILENAME;
+    printf("%s: load BIOS '%s'\n", __func__, bios_name);
+    ret = load_image(bios_name, phys_ram_base);
     if (ret < 0) {		/* Check bios size */
 	fprintf(stderr, "ret=%d\n", ret);
 	fprintf(stderr, "qemu: could not load SHIX bios '%s'\n",
-		BIOS_FILENAME);
+		bios_name);
 	exit(1);
     }
 
diff --git a/hw/sun4m.c b/hw/sun4m.c
index 76b0e7ee8f..f9961c7739 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -430,7 +430,9 @@ static void sun4m_load_kernel(long vram_size, int RAM_size, int boot_device,
                                  (PROM_SIZE_MAX + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK,
                                  prom_offset | IO_MEM_ROM);
 
-    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, PROM_FILENAME);
+    if (bios_name == NULL)
+        bios_name = PROM_FILENAME;
+    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
     ret = load_elf(buf, PROM_PADDR - PROM_VADDR, NULL, NULL, NULL);
     if (ret < 0) {
 	fprintf(stderr, "qemu: could not load prom '%s'\n",
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 0e9e72e35a..cc5e200838 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -382,7 +382,9 @@ static void sun4u_init(int ram_size, int vga_ram_size, int boot_device,
                                  (PROM_SIZE_MAX + TARGET_PAGE_SIZE) & TARGET_PAGE_MASK,
                                  prom_offset | IO_MEM_ROM);
 
-    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, PROM_FILENAME);
+    if (bios_name == NULL)
+        bios_name = PROM_FILENAME;
+    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
     ret = load_elf(buf, PROM_ADDR - PROM_VADDR, NULL, NULL, NULL);
     if (ret < 0) {
 	fprintf(stderr, "qemu: could not load prom '%s'\n",