소스 검색

Fix mstatus register value.

David Craven 7 년 전
부모
커밋
cd5200c5fa
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/register/mstatus.rs

+ 2 - 2
src/register/mstatus.rs

@@ -102,7 +102,7 @@ pub fn read() -> Mstatus {
 unsafe fn set(bits: usize) {
     match () {
         #[cfg(target_arch = "riscv")]
-        () => asm!("csrrs x0, 0x305, $0" :: "r"(bits) :: "volatile"),
+        () => asm!("csrrs x0, 0x300, $0" :: "r"(bits) :: "volatile"),
         #[cfg(not(target_arch = "riscv"))]
         () => unimplemented!(),
     }
@@ -114,7 +114,7 @@ unsafe fn set(bits: usize) {
 unsafe fn clear(bits: usize) {
     match () {
         #[cfg(target_arch = "riscv")]
-        () => asm!("csrrc x0, 0x305, $0" :: "r"(bits) :: "volatile"),
+        () => asm!("csrrc x0, 0x300, $0" :: "r"(bits) :: "volatile"),
         #[cfg(not(target_arch = "riscv"))]
         () => unimplemented!(),
     }