Merge #8
8: mepc is word-size r=dvc94ch a=strake Co-authored-by: M Farkas-Dyck <strake888@gmail.com>
This commit is contained in:
commit
489b88f66b
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/// Reads the CSR
|
/// Reads the CSR
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn read() -> u32 {
|
pub fn read() -> usize {
|
||||||
match () {
|
match () {
|
||||||
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
|
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
|
||||||
() => {
|
() => {
|
||||||
|
@ -10,7 +10,7 @@ pub fn read() -> u32 {
|
||||||
unsafe {
|
unsafe {
|
||||||
asm!("csrrs $0, 0x341, x0" : "=r"(r) ::: "volatile");
|
asm!("csrrs $0, 0x341, x0" : "=r"(r) ::: "volatile");
|
||||||
}
|
}
|
||||||
r as u32
|
r
|
||||||
},
|
},
|
||||||
#[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))]
|
#[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))]
|
||||||
() => unimplemented!(),
|
() => unimplemented!(),
|
||||||
|
|
Loading…
Reference in New Issue