diff --git a/pmon/arch/mips/mips_machdep.c b/pmon/arch/mips/mips_machdep.c index fdba4e83..1bb82b74 100644 --- a/pmon/arch/mips/mips_machdep.c +++ b/pmon/arch/mips/mips_machdep.c @@ -268,6 +268,22 @@ void delay1(int microseconds) }; } +unsigned int get_timer(unsigned int base) +{ + unsigned int clkperms; + static unsigned int high, low; + unsigned int now; + clkperms = tgt_pipefreq() / 2 /1000; + now = CPU_GetCOUNT(); + if (!base) + high = 0; + else + high += (now < low); + low = now; + return (high*0x100000000ULL+low)/clkperms - base; +} + + u_int __res_randomid(void); u_int __res_randomid() diff --git a/sys/arch/mips/include/cpu.h b/sys/arch/mips/include/cpu.h index 1661bfa2..ae7395e1 100644 --- a/sys/arch/mips/include/cpu.h +++ b/sys/arch/mips/include/cpu.h @@ -460,6 +460,7 @@ void flushicache __P((void *, size_t)); void flushdcache __P((void *, size_t)); void syncicache __P((void *, size_t)); void delay __P((int)); +unsigned int get_timer(unsigned int base); int CPU_ConfigCache __P((void)); void CPU_SetWIRED __P((int));