Fixed mcycle function

This commit is contained in:
imi415 2020-06-02 00:35:53 +08:00
parent a5c589c0a2
commit 15703025b0
Signed by: imi415
GPG Key ID: 17F01E106F9F5E0A
1 changed files with 1 additions and 2 deletions

View File

@ -29,8 +29,7 @@ uint64_t __read_mcycle(void) {
__csrr("mcycle", mcycle);
__csrr("mcycleh", mcycleh);
uint64_t ret = mcycleh << 31;
ret <<= 1;
uint64_t ret = (uint64_t)mcycleh << 32;
ret |= mcycle;
return ret;