summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-07-02 15:13:42 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-07-02 15:13:42 +0000
commit899abcf5131ee7e433935a599ca3d22e51bf18ac (patch)
tree40abb3809eb11deffe7a2967bdd3d4b9c3805cba /hw
parentdfae6487c048d9888820737f1546bac438030a31 (diff)
downloadqemu-899abcf5131ee7e433935a599ca3d22e51bf18ac.tar.gz
fixed random register (Ralf Baechle)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1469 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/mips_r4k.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index 528ff2b8df..27f636530a 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -78,14 +78,14 @@ void cpu_mips_irqctrl_init (void)
{
}
-/* MIPS R4K timer */
uint32_t cpu_mips_get_random (CPUState *env)
{
- uint64_t now = qemu_get_clock(vm_clock);
+ uint32_t now = qemu_get_clock(vm_clock);
- return (uint32_t)now & 0x0000000F;
+ return now % (MIPS_TLB_NB - env->CP0_Wired) + env->CP0_Wired;
}
+/* MIPS R4K timer */
uint32_t cpu_mips_get_count (CPUState *env)
{
return env->CP0_Count +