diff options
author | Andrew Waterman <waterman@eecs.berkeley.edu> | 2014-02-06 01:38:03 -0800 |
---|---|---|
committer | Andrew Waterman <waterman@eecs.berkeley.edu> | 2014-02-06 01:38:03 -0800 |
commit | 2cc2860d5e1992fe15449041834c2d4d39553622 (patch) | |
tree | bbce38046a25904a879405db360e743c58d37b31 /encoding.h | |
parent | 53cc1d5f2b8e9d87fc72132d7c962286967691ca (diff) | |
download | riscv-opcodes-2cc2860d5e1992fe15449041834c2d4d39553622.zip riscv-opcodes-2cc2860d5e1992fe15449041834c2d4d39553622.tar.gz riscv-opcodes-2cc2860d5e1992fe15449041834c2d4d39553622.tar.bz2 |
Reserve 16 uarch-specific read-only userspace counters
Diffstat (limited to 'encoding.h')
-rw-r--r-- | encoding.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -77,10 +77,18 @@ asm volatile ("csrrc %0, " #reg ", %1" : "=r"(__tmp) : "r"(bit)); \ __tmp; }) +#define rdtime() ({ unsigned long __tmp; \ + asm volatile ("rdtime %0" : "=r"(__tmp)); \ + __tmp; }) + #define rdcycle() ({ unsigned long __tmp; \ asm volatile ("rdcycle %0" : "=r"(__tmp)); \ __tmp; }) +#define rdinstret() ({ unsigned long __tmp; \ + asm volatile ("rdinstret %0" : "=r"(__tmp)); \ + __tmp; }) + #endif #endif |