@@ -1019,8 +1019,8 @@ impl Cbp {
1019
1019
// Cortex-M7 have a DCACHE or ICACHE at all, it seems safe to do the same thing as the
1020
1020
// CMSIS-Core implementation and use fixed values.
1021
1021
unsafe { self . dcisw . write (
1022
- ( ( ( way as u32 ) << CBP_SW_WAY_POS ) & CBP_SW_WAY_MASK ) |
1023
- ( ( ( set as u32 ) << CBP_SW_SET_POS ) & CBP_SW_SET_MASK ) ) ;
1022
+ ( ( ( way as u32 ) & ( CBP_SW_WAY_MASK >> CBP_SW_WAY_POS ) ) << CBP_SW_WAY_POS ) |
1023
+ ( ( ( set as u32 ) & ( CBP_SW_SET_MASK >> CBP_SW_SET_POS ) ) << CBP_SW_SET_POS ) ) ;
1024
1024
}
1025
1025
}
1026
1026
@@ -1043,8 +1043,8 @@ impl Cbp {
1043
1043
pub fn dccsw ( & self , set : u16 , way : u16 ) {
1044
1044
// See comment for dcisw() about the format here
1045
1045
unsafe { self . dccsw . write (
1046
- ( ( ( way as u32 ) << CBP_SW_WAY_POS ) & CBP_SW_WAY_MASK ) |
1047
- ( ( ( set as u32 ) << CBP_SW_SET_POS ) & CBP_SW_SET_MASK ) ) ;
1046
+ ( ( ( way as u32 ) & ( CBP_SW_WAY_MASK >> CBP_SW_WAY_POS ) ) << CBP_SW_WAY_POS ) |
1047
+ ( ( ( set as u32 ) & ( CBP_SW_SET_MASK >> CBP_SW_SET_POS ) ) << CBP_SW_SET_POS ) ) ;
1048
1048
}
1049
1049
}
1050
1050
@@ -1061,8 +1061,8 @@ impl Cbp {
1061
1061
pub fn dccisw ( & self , set : u16 , way : u16 ) {
1062
1062
// See comment for dcisw() about the format here
1063
1063
unsafe { self . dccisw . write (
1064
- ( ( ( way as u32 ) << CBP_SW_WAY_POS ) & CBP_SW_WAY_MASK ) |
1065
- ( ( ( set as u32 ) << CBP_SW_SET_POS ) & CBP_SW_SET_MASK ) ) ;
1064
+ ( ( ( way as u32 ) & ( CBP_SW_WAY_MASK >> CBP_SW_WAY_POS ) ) << CBP_SW_WAY_POS ) |
1065
+ ( ( ( set as u32 ) & ( CBP_SW_SET_MASK >> CBP_SW_SET_POS ) ) << CBP_SW_SET_POS ) ) ;
1066
1066
}
1067
1067
}
1068
1068
0 commit comments