Win32 build fix.
[qemu] / hw / mips_r4k.c
index 6b6b6cb..f104300 100644 (file)
@@ -27,11 +27,14 @@ void cpu_mips_irqctrl_init (void)
 {
 }
 
+/* XXX: do not use a global */
 uint32_t cpu_mips_get_random (CPUState *env)
 {
-    uint32_t now = qemu_get_clock(vm_clock);
-
-    return now % (MIPS_TLB_NB - env->CP0_Wired) + env->CP0_Wired;
+    static uint32_t seed = 0;
+    uint32_t idx;
+    seed = seed * 314159 + 1;
+    idx = (seed >> 16) % (MIPS_TLB_NB - env->CP0_Wired) + env->CP0_Wired;
+    return idx;
 }
 
 /* MIPS R4K timer */
@@ -211,14 +214,10 @@ 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);
-    printf("%s: load BIOS '%s' size %d\n", __func__, buf, BIOS_SIZE);
     ret = load_image(buf, phys_ram_base + bios_offset);
     if (ret == BIOS_SIZE) {
        cpu_register_physical_memory((uint32_t)(0x1fc00000),
                                     BIOS_SIZE, bios_offset | IO_MEM_ROM);
-       env->PC = 0xBFC00000;
-       if (!kernel_filename)
-           return;
     } else {
        /* not fatal */
         fprintf(stderr, "qemu: Warning, could not load MIPS bios '%s'\n",