File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/constance_port_arm/src/startup Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -91,14 +91,14 @@ extern "C" fn reset_handler1<System: EntryPoint + StartupOptions>() {
91
91
// coherency.”
92
92
let clidr = arm:: CLIDR . extract ( ) ;
93
93
let level_of_coherency = clidr. read ( arm:: CLIDR :: LoC ) ;
94
- for level_and_d in 0 ..level_of_coherency * 2 {
95
- let cache_type = ( clidr. get ( ) >> ( ( level_and_d >> 1 ) * 3 ) ) & 0b111 ;
94
+ for level in 0 ..level_of_coherency {
95
+ let cache_type = ( clidr. get ( ) >> ( level * 3 ) ) & 0b111 ;
96
96
97
97
// Does this cache level include a data or unified cache?
98
98
if cache_type >= 2 {
99
- // Level = level_and_d / 2 , InD = level_and_d % 2
99
+ // Level = level , InD = 0
100
100
// Use `isb` to make sure the change to CSSELR takes effect.
101
- arm:: CSSELR . set ( level_and_d ) ;
101
+ arm:: CSSELR . set ( level * 2 ) ;
102
102
unsafe { llvm_asm ! ( "isb" ) } ;
103
103
104
104
let cssidr = arm:: CCSIDR . extract ( ) ;
@@ -110,7 +110,7 @@ extern "C" fn reset_handler1<System: EntryPoint + StartupOptions>() {
110
110
111
111
for way in ( 0 ..=max_way_index) . rev ( ) {
112
112
for set in ( 0 ..=max_set_index) . rev ( ) {
113
- let set_way = level_and_d | ( way << way_offset) | ( set << log2_line_size) ;
113
+ let set_way = ( level << 1 ) | ( way << way_offset) | ( set << log2_line_size) ;
114
114
115
115
// Invalidate by set/way
116
116
arm:: DCISW . set ( set_way) ;
You can’t perform that action at this time.
0 commit comments