Prechádzať zdrojové kódy

fix(prototyper): rename csr_test to has_csr

Signed-off-by: Woshiluo Luo <woshiluo.luo@outlook.com>
Woshiluo Luo 4 mesiacov pred
rodič
commit
c19e2601f1

+ 1 - 1
prototyper/src/macros.rs

@@ -26,7 +26,7 @@ macro_rules! println {
 }
 
 #[allow(unused)]
-macro_rules! csr_test {
+macro_rules! has_csr {
     ($($x: expr)*) => {{
             use core::arch::asm;
             use riscv::register::mtvec;

+ 3 - 3
prototyper/src/sbi/extensions.rs

@@ -91,11 +91,11 @@ pub fn privileged_version_detection() {
         const CSR_MCOUNTINHIBIT: u64 = 0x320;
         const CSR_MENVCFG: u64 = 0x30a;
 
-        if csr_test!(CSR_MCOUNTEREN) {
+        if has_csr!(CSR_MCOUNTEREN) {
             current_priv_ver = PrivilegedVersion::Version1_10;
-            if csr_test!(CSR_MCOUNTINHIBIT) {
+            if has_csr!(CSR_MCOUNTINHIBIT) {
                 current_priv_ver = PrivilegedVersion::Version1_11;
-                if csr_test!(CSR_MENVCFG) {
+                if has_csr!(CSR_MENVCFG) {
                     current_priv_ver = PrivilegedVersion::Version1_12;
                 }
             }