@@ -35,7 +35,7 @@ pub struct PmpEntry {
35
35
pub index : usize ,
36
36
pub permission : Option < Permission > ,
37
37
pub range : Option < Range > ,
38
- pub locked : bool
38
+ pub locked : bool ,
39
39
}
40
40
41
41
impl Pmpcfg {
@@ -52,16 +52,18 @@ impl Pmpcfg {
52
52
index,
53
53
permission : self . get_permission ( index) ,
54
54
range : self . get_range ( index) ,
55
- locked : self . is_locked ( index)
55
+ locked : self . is_locked ( index) ,
56
56
}
57
57
}
58
58
59
59
/// PmpByte methods to get a pmp configuration attributes
60
- pub fn get_byte ( & self , index : usize ) -> usize { self . bits . get_bits ( 8 * index..=( 8 * index) + 7 ) as usize }
60
+ pub fn get_byte ( & self , index : usize ) -> usize {
61
+ self . bits . get_bits ( 8 * index..=( 8 * index) + 7 ) as usize
62
+ }
61
63
62
64
#[ inline]
63
65
pub fn is_locked ( & self , index : usize ) -> bool {
64
- self . bits . get_bit ( 7 + ( 8 * index) )
66
+ self . bits . get_bit ( 7 + 8 * index)
65
67
}
66
68
67
69
#[ inline]
@@ -111,7 +113,7 @@ pub mod pmpcfg0 {
111
113
assert ! ( index < 8 ) ;
112
114
113
115
let mut value = _read ( ) ;
114
- value. set_bits ( 8 * index..=8 * index + 2 , permission as usize ) ;
116
+ value. set_bits ( 8 * index..=8 * index + 2 , permission as usize ) ;
115
117
_write ( value) ;
116
118
}
117
119
@@ -124,7 +126,7 @@ pub mod pmpcfg0 {
124
126
assert ! ( index < 8 ) ;
125
127
126
128
let mut value = _read ( ) ;
127
- value. set_bits ( 8 * index + 3 ..=8 * index + 4 , range as usize ) ;
129
+ value. set_bits ( 8 * index + 3 ..=8 * index + 4 , range as usize ) ;
128
130
_write ( value) ;
129
131
}
130
132
@@ -161,7 +163,7 @@ pub mod pmpcfg1 {
161
163
assert ! ( index < 8 ) ;
162
164
163
165
let mut value = _read ( ) ;
164
- value. set_bits ( 8 * index..=8 * index + 2 , permission as usize ) ;
166
+ value. set_bits ( 8 * index..=8 * index + 2 , permission as usize ) ;
165
167
_write ( value) ;
166
168
}
167
169
@@ -174,7 +176,7 @@ pub mod pmpcfg1 {
174
176
assert ! ( index < 8 ) ;
175
177
176
178
let mut value = _read ( ) ;
177
- value. set_bits ( 8 * index + 3 ..=8 * index + 4 , range as usize ) ;
179
+ value. set_bits ( 8 * index + 3 ..=8 * index + 4 , range as usize ) ;
178
180
_write ( value) ;
179
181
}
180
182
@@ -211,7 +213,7 @@ pub mod pmpcfg2 {
211
213
assert ! ( index < 8 ) ;
212
214
213
215
let mut value = _read ( ) ;
214
- value. set_bits ( 8 * index..=8 * index + 2 , permission as usize ) ;
216
+ value. set_bits ( 8 * index..=8 * index + 2 , permission as usize ) ;
215
217
_write ( value) ;
216
218
}
217
219
@@ -224,7 +226,7 @@ pub mod pmpcfg2 {
224
226
assert ! ( index < 8 ) ;
225
227
226
228
let mut value = _read ( ) ;
227
- value. set_bits ( 8 * index + 3 ..=8 * index + 4 , range as usize ) ;
229
+ value. set_bits ( 8 * index + 3 ..=8 * index + 4 , range as usize ) ;
228
230
_write ( value) ;
229
231
}
230
232
@@ -261,7 +263,7 @@ pub mod pmpcfg3 {
261
263
assert ! ( index < 8 ) ;
262
264
263
265
let mut value = _read ( ) ;
264
- value. set_bits ( 8 * index..=8 * index + 2 , permission as usize ) ;
266
+ value. set_bits ( 8 * index..=8 * index + 2 , permission as usize ) ;
265
267
_write ( value) ;
266
268
}
267
269
@@ -274,7 +276,7 @@ pub mod pmpcfg3 {
274
276
assert ! ( index < 8 ) ;
275
277
276
278
let mut value = _read ( ) ;
277
- value. set_bits ( 8 * index + 3 ..=8 * index + 4 , range as usize ) ;
279
+ value. set_bits ( 8 * index + 3 ..=8 * index + 4 , range as usize ) ;
278
280
_write ( value) ;
279
281
}
280
282
0 commit comments