Ignore:
Timestamp:
2017-08-22T16:08:00Z (7 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b93ea46a
Parents:
d639eaa
Message:

riscv64: cycle performance counter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/riscv64/include/arch/cycle.h

    rd639eaa r0a78e4f  
    4040NO_TRACE static inline uint64_t get_cycle(void)
    4141{
    42         return 0;
     42        uint64_t cycle;
     43       
     44        asm volatile (
     45                "rdcycle %[cycle]\n"
     46                : [cycle] "=r" (cycle)
     47        );
     48       
     49        return cycle;
    4350}
    4451
Note: See TracChangeset for help on using the changeset viewer.