Bläddra i källkod

Include all types in the macros

dkhayes117 3 år sedan
förälder
incheckning
96aa35987d
2 ändrade filer med 6 tillägg och 6 borttagningar
  1. 2 2
      src/register/macros.rs
  2. 4 4
      src/register/pmpcfgx.rs

+ 2 - 2
src/register/macros.rs

@@ -272,10 +272,10 @@ macro_rules! read_composite_csr {
 }
 
 macro_rules! set_pmp {
-     {$range:ty, $permission:ty} => {
+     () => {
         /// Set the pmp configuration corresponding to the index
         #[inline]
-        pub unsafe fn set_pmp(index: usize, range: $range, permission: $permission, locked: bool) {
+        pub unsafe fn set_pmp(index: usize, range: Range, permission: Permission, locked: bool) {
             #[cfg(riscv32)]
             assert!(index < 4);
 

+ 4 - 4
src/register/pmpcfgx.rs

@@ -86,7 +86,7 @@ pub mod pmpcfg0 {
     read_csr_as!(Pmpcsr, 0x3A0, __read_pmpcfg0);
     write_csr_as_usize!(0x3A0, __write_pmpcfg0);
 
-    set_pmp!(Range,Permission);
+    set_pmp!();
     clear_pmp!();
 }
 
@@ -100,7 +100,7 @@ pub mod pmpcfg1 {
     read_csr_as!(Pmpcsr, 0x3A1, __read_pmpcfg1);
     write_csr_as_usize_rv32!(0x3A1, __write_pmpcfg1);
 
-    set_pmp!(Range,Permission);
+    set_pmp!();
     clear_pmp!();
 }
 
@@ -113,7 +113,7 @@ pub mod pmpcfg2 {
     read_csr_as!(Pmpcsr, 0x3A2, __read_pmpcfg2);
     write_csr_as_usize!(0x3A2, __write_pmpcfg2);
 
-    set_pmp!(Range,Permission);
+    set_pmp!();
     clear_pmp!();
 }
 
@@ -127,6 +127,6 @@ pub mod pmpcfg3 {
     read_csr_as!(Pmpcsr, 0x3A3, __read_pmpcfg3);
     write_csr_as_usize_rv32!(0x3A3, __write_pmpcfg3);
 
-    set_pmp!(Range,Permission);
+    set_pmp!();
     clear_pmp!();
 }