From 9d42a5757f9c020c358b54d5bdf359819a6c4f1d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 26 Aug 2014 14:51:53 -0600 Subject: up_coherent_dcache should do nothing the the length is zero --- nuttx/arch/arm/src/armv7-a/arm_coherent_dcache.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nuttx/arch/arm/src/armv7-a/arm_coherent_dcache.c b/nuttx/arch/arm/src/armv7-a/arm_coherent_dcache.c index 6c0d4d7ce..1cb134c92 100644 --- a/nuttx/arch/arm/src/armv7-a/arm_coherent_dcache.c +++ b/nuttx/arch/arm/src/armv7-a/arm_coherent_dcache.c @@ -82,13 +82,16 @@ void up_coherent_dcache(uintptr_t addr, size_t len) { - /* Perform the operation on the L1 cache */ + if (len > 0) + { + /* Perform the operation on the L1 cache */ - cp15_coherent_dcache(addr, addr+len); + cp15_coherent_dcache(addr, addr + len - 1); #ifdef CONFIG_ARCH_L2CACHE - /* If we have an L2 cache, then there more things that need to done */ + /* If we have an L2 cache, then there more things that need to done */ # warning This is insufficient #endif + } } -- cgit v1.2.3