Ignore:
Timestamp:
Jul 6, 2018, 6:12:40 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
bca36d9
Parents:
6418c91d
git-author:
Sebastian Huber <sebastian.huber@…> (07/06/18 06:12:40)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/06/18 11:46:46)
Message:

riscv: Implement CPU counter

Update #3433.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/riscv/include/rtems/score/cpu.h

    r6418c91d rdd32e2b2  
    371371uint32_t _CPU_Counter_frequency( void );
    372372
    373 CPU_Counter_ticks _CPU_Counter_read( void );
     373static inline CPU_Counter_ticks _CPU_Counter_read( void )
     374{
     375  unsigned long ticks;
     376
     377  __asm__ volatile ( "rdtime %0" : "=&r" ( ticks ) );
     378
     379  return (uint32_t) ticks;
     380}
     381
     382static inline CPU_Counter_ticks _CPU_Counter_difference(
     383  CPU_Counter_ticks second,
     384  CPU_Counter_ticks first
     385)
     386{
     387  return second - first;
     388}
    374389
    375390#ifdef RTEMS_SMP
Note: See TracChangeset for help on using the changeset viewer.