Changeset View
Changeset View
Standalone View
Standalone View
head/sys/riscv/include/cpufunc.h
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | |||||
static __inline void | static __inline void | ||||
sfence_vma_page(uintptr_t addr) | sfence_vma_page(uintptr_t addr) | ||||
{ | { | ||||
__asm __volatile("sfence.vma %0" :: "r" (addr) : "memory"); | __asm __volatile("sfence.vma %0" :: "r" (addr) : "memory"); | ||||
} | } | ||||
#define rdcycle() csr_read64(cycle) | |||||
#define rdtime() csr_read64(time) | |||||
#define rdinstret() csr_read64(instret) | |||||
#define rdhpmcounter(n) csr_read64(hpmcounter##n) | |||||
#define cpufunc_nullop() riscv_nullop() | #define cpufunc_nullop() riscv_nullop() | ||||
void riscv_nullop(void); | void riscv_nullop(void); | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* _MACHINE_CPUFUNC_H_ */ | #endif /* _MACHINE_CPUFUNC_H_ */ |