You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/11/24 18:14:58 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4878: cache_invalidate: fix unalign cacheline invalidate & add cache coherence config for semihosting option

xiaoxiang781216 commented on a change in pull request #4878:
URL: https://github.com/apache/incubator-nuttx/pull/4878#discussion_r756327274



##########
File path: arch/arm/src/armv7-m/arm_cache.c
##########
@@ -422,7 +428,12 @@ void up_invalidate_dcache(uintptr_t start, uintptr_t end)
 
       start += ssize;
     }
-  while (start < end);
+  while (start + ssize <= end);
+
+  if (start != end)

Review comment:
       Yes, we forget to consider so small range, please try this:
   ```
    while (start + ssize <= end)
       {
         /* The below store causes the cache to check its directory and
          * determine if this address is contained in the cache. If so, it
          * invalidate that cache line. Only the cache way containing the
          * address is invalidated. If the address is not in the cache, then
          * nothing is invalidated.
          */
         putreg32(start, NVIC_DCIMVAC);
         /* Increment the address by the size of one cache line. */
   
         start += ssize;
       }
   
     if (start < end)
       {
         putreg32(start, NVIC_DCCIMVAC);
       }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org