Changeset View
Changeset View
Standalone View
Standalone View
sys/riscv/include/cpufunc.h
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | 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 rdcycle() csr_read64(cycle) | ||||
#define rdtime() csr_read64(time) | #define rdtime() csr_read64(time) | ||||
#define rdinstret() csr_read64(instret) | #define rdinstret() csr_read64(instret) | ||||
#define rdhpmcounter(n) csr_read64(hpmcounter##n) | #define rdhpmcounter(n) csr_read64(hpmcounter##n) | ||||
static __inline void | |||||
load_satp(uint64_t val) | |||||
{ | |||||
__asm __volatile("csrw satp, %0" :: "r"(val)); | |||||
} | |||||
#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_ */ |