@@ -39,34 +39,28 @@ const CBP_SW_SET_MASK: u32 = 0x1FF << CBP_SW_SET_POS;
39
39
40
40
impl CBP {
41
41
/// I-cache invalidate all to PoU
42
- #[ inline]
42
+ #[ inline( always ) ]
43
43
pub fn iciallu ( & mut self ) {
44
- unsafe {
45
- self . iciallu . write ( 0 ) ;
46
- }
44
+ unsafe { self . iciallu . write ( 0 ) } ;
47
45
}
48
46
49
47
/// I-cache invalidate by MVA to PoU
50
- #[ inline]
48
+ #[ inline( always ) ]
51
49
pub fn icimvau ( & mut self , mva : u32 ) {
52
- unsafe {
53
- self . icimvau . write ( mva) ;
54
- }
50
+ unsafe { self . icimvau . write ( mva) } ;
55
51
}
56
52
57
53
/// D-cache invalidate by MVA to PoC
58
- #[ inline]
59
- pub fn dcimvac ( & mut self , mva : u32 ) {
60
- unsafe {
61
- self . dcimvac . write ( mva) ;
62
- }
54
+ #[ inline( always) ]
55
+ pub unsafe fn dcimvac ( & mut self , mva : u32 ) {
56
+ self . dcimvac . write ( mva) ;
63
57
}
64
58
65
59
/// D-cache invalidate by set-way
66
60
///
67
61
/// `set` is masked to be between 0 and 3, and `way` between 0 and 511.
68
- #[ inline]
69
- pub fn dcisw ( & mut self , set : u16 , way : u16 ) {
62
+ #[ inline( always ) ]
63
+ pub unsafe fn dcisw ( & mut self , set : u16 , way : u16 ) {
70
64
// The ARMv7-M Architecture Reference Manual, as of Revision E.b, says these set/way
71
65
// operations have a register data format which depends on the implementation's
72
66
// associativity and number of sets. Specifically the 'way' and 'set' fields have
@@ -76,24 +70,22 @@ impl CBP {
76
70
// Generic User Guide section 4.8.3. Since no other ARMv7-M implementations except the
77
71
// Cortex-M7 have a DCACHE or ICACHE at all, it seems safe to do the same thing as the
78
72
// CMSIS-Core implementation and use fixed values.
79
- unsafe {
80
- self . dcisw . write (
81
- ( ( u32:: from ( way) & ( CBP_SW_WAY_MASK >> CBP_SW_WAY_POS ) ) << CBP_SW_WAY_POS )
82
- | ( ( u32:: from ( set) & ( CBP_SW_SET_MASK >> CBP_SW_SET_POS ) ) << CBP_SW_SET_POS ) ,
83
- ) ;
84
- }
73
+ self . dcisw . write (
74
+ ( ( u32:: from ( way) & ( CBP_SW_WAY_MASK >> CBP_SW_WAY_POS ) ) << CBP_SW_WAY_POS )
75
+ | ( ( u32:: from ( set) & ( CBP_SW_SET_MASK >> CBP_SW_SET_POS ) ) << CBP_SW_SET_POS ) ,
76
+ ) ;
85
77
}
86
78
87
79
/// D-cache clean by MVA to PoU
88
- #[ inline]
80
+ #[ inline( always ) ]
89
81
pub fn dccmvau ( & mut self , mva : u32 ) {
90
82
unsafe {
91
83
self . dccmvau . write ( mva) ;
92
84
}
93
85
}
94
86
95
87
/// D-cache clean by MVA to PoC
96
- #[ inline]
88
+ #[ inline( always ) ]
97
89
pub fn dccmvac ( & mut self , mva : u32 ) {
98
90
unsafe {
99
91
self . dccmvac . write ( mva) ;
@@ -103,7 +95,7 @@ impl CBP {
103
95
/// D-cache clean by set-way
104
96
///
105
97
/// `set` is masked to be between 0 and 3, and `way` between 0 and 511.
106
- #[ inline]
98
+ #[ inline( always ) ]
107
99
pub fn dccsw ( & mut self , set : u16 , way : u16 ) {
108
100
// See comment for dcisw() about the format here
109
101
unsafe {
@@ -115,7 +107,7 @@ impl CBP {
115
107
}
116
108
117
109
/// D-cache clean and invalidate by MVA to PoC
118
- #[ inline]
110
+ #[ inline( always ) ]
119
111
pub fn dccimvac ( & mut self , mva : u32 ) {
120
112
unsafe {
121
113
self . dccimvac . write ( mva) ;
@@ -125,7 +117,7 @@ impl CBP {
125
117
/// D-cache clean and invalidate by set-way
126
118
///
127
119
/// `set` is masked to be between 0 and 3, and `way` between 0 and 511.
128
- #[ inline]
120
+ #[ inline( always ) ]
129
121
pub fn dccisw ( & mut self , set : u16 , way : u16 ) {
130
122
// See comment for dcisw() about the format here
131
123
unsafe {
@@ -137,7 +129,7 @@ impl CBP {
137
129
}
138
130
139
131
/// Branch predictor invalidate all
140
- #[ inline]
132
+ #[ inline( always ) ]
141
133
pub fn bpiall ( & mut self ) {
142
134
unsafe {
143
135
self . bpiall . write ( 0 ) ;
0 commit comments