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:
Sebastian Huber
2024-04-23 21:06:52 +02:00
committed by Amar Takhar
parent ef570cf157
commit 123e0e6fb6

View File

@@ -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(