Commit 899abcf5131ee7e433935a599ca3d22e51bf18ac

Authored by bellard
1 parent dfae6487

fixed random register (Ralf Baechle)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1469 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 3 deletions
hw/mips_r4k.c
... ... @@ -78,14 +78,14 @@ void cpu_mips_irqctrl_init (void)
78 78 {
79 79 }
80 80  
81   -/* MIPS R4K timer */
82 81 uint32_t cpu_mips_get_random (CPUState *env)
83 82 {
84   - uint64_t now = qemu_get_clock(vm_clock);
  83 + uint32_t now = qemu_get_clock(vm_clock);
85 84  
86   - return (uint32_t)now & 0x0000000F;
  85 + return now % (MIPS_TLB_NB - env->CP0_Wired) + env->CP0_Wired;
87 86 }
88 87  
  88 +/* MIPS R4K timer */
89 89 uint32_t cpu_mips_get_count (CPUState *env)
90 90 {
91 91 return env->CP0_Count +
... ...