2
0
Эх сурвалжийг харах

riscv: Resolve full path of the given bios image

At present when "-bios image" is supplied, we just use the straight
path without searching for the configured data directories. Like
"-bios default", we add the same logic so that "-L" actually works.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Bin Meng 6 жил өмнө
parent
commit
49dd180e4f
1 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 3 3
      hw/riscv/boot.c

+ 3 - 3
hw/riscv/boot.c

@@ -72,14 +72,14 @@ void riscv_find_and_load_firmware(MachineState *machine,
         firmware_filename = riscv_find_firmware(default_machine_firmware);
         firmware_filename = riscv_find_firmware(default_machine_firmware);
     } else {
     } else {
         firmware_filename = machine->firmware;
         firmware_filename = machine->firmware;
+        if (strcmp(firmware_filename, "none")) {
+            firmware_filename = riscv_find_firmware(firmware_filename);
+        }
     }
     }
 
 
     if (strcmp(firmware_filename, "none")) {
     if (strcmp(firmware_filename, "none")) {
         /* If not "none" load the firmware */
         /* If not "none" load the firmware */
         riscv_load_firmware(firmware_filename, firmware_load_addr);
         riscv_load_firmware(firmware_filename, firmware_load_addr);
-    }
-
-    if (!strcmp(machine->firmware, "default")) {
         g_free(firmware_filename);
         g_free(firmware_filename);
     }
     }
 }
 }