Blackfin arch: fix bug - dmacopy test case fail on all platform

The cache code I added flushes 1 line too little if the start address is
not aligned to the cache size. Cache align the start address so that when
we straddle cache aligns, we get the right count.

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
This commit is contained in:
Mike Frysinger 2008-11-18 17:48:22 +08:00 committed by Bryan Wu
parent 4ee1c45337
commit 39e96c8835
1 changed files with 5 additions and 1 deletions

View File

@ -25,9 +25,13 @@
*/ */
.macro do_flush flushins:req optflushins optnopins label .macro do_flush flushins:req optflushins optnopins label
R2 = -L1_CACHE_BYTES;
/* start = (start & -L1_CACHE_BYTES) */
R0 = R0 & R2;
/* end = ((end - 1) & -L1_CACHE_BYTES) + L1_CACHE_BYTES; */ /* end = ((end - 1) & -L1_CACHE_BYTES) + L1_CACHE_BYTES; */
R1 += -1; R1 += -1;
R2 = -L1_CACHE_BYTES;
R1 = R1 & R2; R1 = R1 & R2;
R1 += L1_CACHE_BYTES; R1 += L1_CACHE_BYTES;