[PATCH] rtems_cache_invalidate_multiple_instruction_lines() addresses range fix

Aleksandr Platonov pam at wolpike.com
Tue Jan 14 13:29:20 UTC 2014


According with comment in 
rtems_cache_invalidate_multiple_instruction_lines(),
final_address indicates the last address_t which needs to be invalidated.
But if in while loop we got final_address == i_addr condition then loop 
breaks and
final_address will not be invalidated.



diff --git a/c/src/lib/libcpu/shared/src/cache_manager.c 
b/c/src/lib/libcpu/shared/src/cache_manager.c
index 69c422f..c2c460a 100644
--- a/c/src/lib/libcpu/shared/src/cache_manager.c
+++ b/c/src/lib/libcpu/shared/src/cache_manager.c
@@ -235,7 +235,7 @@ rtems_cache_invalidate_multiple_instruction_lines( 
const void * i_addr, size_t n

    final_address = (void *)((size_t)i_addr + n_bytes - 1);
    i_addr = (void *)((size_t)i_addr & ~(CPU_INSTRUCTION_CACHE_ALIGNMENT 
- 1));
-  while( final_address > i_addr ) {
+  while( final_address >= i_addr ) {
      _CPU_cache_invalidate_1_instruction_line( i_addr );
      i_addr = (void *)((size_t)i_addr + CPU_INSTRUCTION_CACHE_ALIGNMENT);
    }



More information about the devel mailing list