Commit 899abcf5 authored by bellard's avatar bellard
Browse files

fixed random register (Ralf Baechle)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1469 c046a42c-6fe2-441c-8c8c-71466251a162
parent dfae6487
......@@ -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 +
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment