forked from Imagelibrary/rtems
bsps/cache: Fix ARM CP-15 get cache size
The rtems_cache_get_data_cache_size() and rtems_cache_get_instruction_cache_size() functions shall return the entire cache size for a level of 0. Levels greater than 0 shall return the size of the associated level. Update #4982.
This commit is contained in:
committed by
Amar Takhar
parent
ef570cf157
commit
123e0e6fb6
8
bsps/arm/shared/cache/cache-cp15.c
vendored
8
bsps/arm/shared/cache/cache-cp15.c
vendored
@@ -222,12 +222,12 @@ static inline size_t arm_cp15_get_cache_size(
|
||||
clidr = arm_cp15_get_cache_level_id();
|
||||
loc = arm_clidr_get_level_of_coherency(clidr);
|
||||
|
||||
if (level >= loc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (level == 0) {
|
||||
level = loc - 1;
|
||||
} else if (level - 1 >= loc) {
|
||||
return 0;
|
||||
} else {
|
||||
--level;
|
||||
}
|
||||
|
||||
ccsidr = arm_cp15_get_cache_size_id_for_level(
|
||||
|
||||
Reference in New Issue
Block a user