Skip to content

Commit 6fe01fd

Browse files
committed
Change Pmpcfgx module functions from _write to _set. Fix comment typos.
1 parent 8d3aff4 commit 6fe01fd

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/register/pmpcfgx.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl PmpByte {
6666
}
6767

6868
/// Physical memory protection configuration
69-
/// Pmpcf0 struct contains pmp0cfg - pmp3cfg for 32-bit arch, or pmp0cfg - pmp7cfg for 64-bit arch
69+
/// Pmpcfg0 struct contains pmp0cfg - pmp3cfg for RV32, or pmp0cfg - pmp7cfg for RV64
7070
/// get_byte() method retrieves a single pmp<x>cfg held in a PmpByte struct
7171
pub mod pmpcfg0 {
7272
use super::{BitField, Permission, PmpByte, Range};
@@ -104,7 +104,7 @@ pub mod pmpcfg0 {
104104
#[cfg(riscv64)]
105105
assert!(index < 8);
106106

107-
_write((permission as usize) << (index * 8));
107+
_set((permission as usize) << (index * 8));
108108
}
109109

110110
#[inline]
@@ -115,7 +115,7 @@ pub mod pmpcfg0 {
115115
#[cfg(riscv64)]
116116
assert!(index < 8);
117117

118-
_write((range as usize) << (3 + (index * 8)));
118+
_set((range as usize) << (3 + (index * 8)));
119119
}
120120

121121
#[inline]
@@ -141,8 +141,8 @@ pub mod pmpcfg0 {
141141
}
142142
}
143143

144-
/// Physical memory protection configuration, RV32 only
145-
/// Pmpcf1 struct contains pmp4cfg - pmp7cfg for 32-bit arch only
144+
/// Physical memory protection configuration
145+
/// Pmpcfg1 struct contains pmp4cfg - pmp7cfg for RV32 only
146146
/// get_byte() method retrieves a single pmp<x>cfg held in a PmpByte struct
147147
pub mod pmpcfg1 {
148148
use super::{BitField, Permission, PmpByte, Range};
@@ -174,7 +174,7 @@ pub mod pmpcfg1 {
174174
#[cfg(riscv64)]
175175
assert!(index < 8);
176176

177-
_write((permission as usize) << (index * 8));
177+
_set((permission as usize) << (index * 8));
178178
}
179179

180180
#[inline]
@@ -185,7 +185,7 @@ pub mod pmpcfg1 {
185185
#[cfg(riscv64)]
186186
assert!(index < 8);
187187

188-
_write((range as usize) << (3 + (index * 8)));
188+
_set((range as usize) << (3 + (index * 8)));
189189
}
190190

191191
#[inline]
@@ -212,7 +212,7 @@ pub mod pmpcfg1 {
212212
}
213213

214214
/// Physical memory protection configuration
215-
/// Pmpcf0 struct contains pmp8cfg - pmp11cfg for 32-bit arch, or pmp8cfg - pmp15cfg for 64-bit arch
215+
/// Pmpcfg0 struct contains pmp8cfg - pmp11cfg for RV32, or pmp8cfg - pmp15cfg for RV64
216216
/// get_byte() method retrieves a single pmp<x>cfg held in a PmpByte struct
217217
pub mod pmpcfg2 {
218218
use super::{BitField, Permission, PmpByte, Range};
@@ -244,7 +244,7 @@ pub mod pmpcfg2 {
244244
#[cfg(riscv64)]
245245
assert!(index < 8);
246246

247-
_write((permission as usize) << (index * 8));
247+
_set((permission as usize) << (index * 8));
248248
}
249249

250250
#[inline]
@@ -255,7 +255,7 @@ pub mod pmpcfg2 {
255255
#[cfg(riscv64)]
256256
assert!(index < 8);
257257

258-
_write((range as usize) << (3 + (index * 8)));
258+
_set((range as usize) << (3 + (index * 8)));
259259
}
260260

261261
#[inline]
@@ -281,8 +281,8 @@ pub mod pmpcfg2 {
281281
}
282282
}
283283

284-
/// Physical memory protection configuration, RV32 only
285-
/// Pmpcf0 struct contains pmp12cfg - pmp15cfg for 32-bit arch only
284+
/// Physical memory protection configuration
285+
/// Pmpcfg0 struct contains pmp12cfg - pmp15cfg for RV32 only
286286
/// get_byte() method retrieves a single pmp<x>cfg held in a PmpByte struct
287287
pub mod pmpcfg3 {
288288
use super::{BitField, Permission, PmpByte, Range};
@@ -313,7 +313,7 @@ pub mod pmpcfg3 {
313313
#[cfg(riscv64)]
314314
assert!(index < 8);
315315

316-
_write((permission as usize) << (index * 8));
316+
_set((permission as usize) << (index * 8));
317317
}
318318

319319
#[inline]
@@ -324,7 +324,7 @@ pub mod pmpcfg3 {
324324
#[cfg(riscv64)]
325325
assert!(index < 8);
326326

327-
_write((range as usize) << (3 + (index * 8)));
327+
_set((range as usize) << (3 + (index * 8)));
328328
}
329329

330330
#[inline]

0 commit comments

Comments
 (0)