From ecc69bda00f2544638f61a400dde5cdecac465e1 Mon Sep 17 00:00:00 2001 From: M Farkas-Dyck Date: Sat, 18 Aug 2018 10:10:01 -0800 Subject: [PATCH] mepc is word-size --- src/register/mepc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/register/mepc.rs b/src/register/mepc.rs index 1da2248..3a1a7d0 100644 --- a/src/register/mepc.rs +++ b/src/register/mepc.rs @@ -2,7 +2,7 @@ /// Reads the CSR #[inline] -pub fn read() -> u32 { +pub fn read() -> usize { match () { #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] () => { @@ -10,7 +10,7 @@ pub fn read() -> u32 { unsafe { asm!("csrrs $0, 0x341, x0" : "=r"(r) ::: "volatile"); } - r as u32 + r }, #[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))] () => unimplemented!(),