[rtems commit] riscv: Implement CPU counter

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 12 20:41:29 UTC 2018



----- Am 6. Jul 2018 um 15:11 schrieb Hesham Almatary heshamelmatary at gmail.com:

> On Fri, 6 Jul 2018 at 1:28 pm, Sebastian Huber <sebh at rtems.org> wrote:
[...]
>> -CPU_Counter_ticks _CPU_Counter_read( void );
>> +static inline CPU_Counter_ticks _CPU_Counter_read( void )
>> +{
>> +  unsigned long ticks;
>> +
>> +  __asm__ volatile ( "rdtime %0" : "=&r" ( ticks ) );
>> +
> 
> Shouldn’t this be “rdcycle” instead of “rdtime”?

The rdcycle is affected by power saving states. If you want to use the CPU counter for fast timestamps, then this is bad.


More information about the devel mailing list