[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help in finding the cycle counter for mips and mipsel



You wrote:
> First, if the linux kernel can be believed, the way to access the
> cycle counter can be found in linux/include/asm-mips/timex.h. This is
I think this will cause an "Illegal instruction" when used from user
mode since this uses the bfc0 instruction. I'm not sure if you can
access the cycle counter from user mode at all.

> #if defined(__GNUC__) && defined(__mips__) && !defined(HAVE_TICK_COUNTER)
__mips__ is defined for mips{,el}{,64} if you need to distinguish
between mips and mipsel use __MIPSEB__ and __MIPSEL__. For n64 you can
check for (_MIPS_SZLONG == 64).
Hope this helps,
 -- Guido



Reply to: