dslinux/linux-2.6.x/arch/arm/mm cache-v4wb.S

amadeus dslinux_amadeus at user.in-berlin.de
Fri Aug 25 14:09:23 CEST 2006


Update of /cvsroot/dslinux/dslinux/linux-2.6.x/arch/arm/mm
In directory antilope:/tmp/cvs-serv18193/linux-2.6.x/arch/arm/mm

Modified Files:
	cache-v4wb.S 
Log Message:
Minor cleanup, safety first

Index: cache-v4wb.S
===================================================================
RCS file: /cvsroot/dslinux/dslinux/linux-2.6.x/arch/arm/mm/cache-v4wb.S,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cache-v4wb.S	25 Aug 2006 10:35:02 -0000	1.5
+++ cache-v4wb.S	25 Aug 2006 12:09:21 -0000	1.6
@@ -118,7 +118,6 @@
  *	- end	 - virtual end address
  */
 ENTRY(v4wb_dma_flush_range)
-	bic	r0, r0, #CACHE_DLINESIZE - 1
 	/* FALLTHROUGH */
 
 /*
@@ -134,6 +133,7 @@
 	sub	ip, r1, r0			@ calculate total size
 	cmp	ip, #CACHE_DLIMIT		@ total size >= limit?
 	bhs	v4wb_flush_dcache_all		@ yes: flush the complete d-cache
+	bic	r0, r0, #CACHE_DLINESIZE - 1	@ safety first: adjust start pointer to cache line
 1:
 #ifdef CONFIG_ARCH_NDS				/* we can clean and invalidate at once */
 	mcr	p15, 0, r0, c7, c14, 1		@ clean and flush a D-cache line
@@ -184,7 +184,6 @@
  *	- end	 - virtual end address
  */
 ENTRY(v4wb_coherent_user_range)
-	bic	r0, r0, #CACHE_DLINESIZE - 1	@ align to cache line
 	/* fall through */
 /*
  *	flush_cache_range(start, end)
@@ -199,6 +198,7 @@
 	sub	ip, r1, r0			@ calculate total size
 	cmp	ip, #CACHE_DLIMIT		@ total size >= limit?
 	bhs	v4wb_flush_kern_cache_all	@ yes: flush the complete i+d-cache
+	bic	r0, r0, #CACHE_DLINESIZE - 1	@ safety first: adjust start pointer to cache line
 2:
 #ifdef CONFIG_ARCH_NDS				/* we can clean and invalidate at once */
 	mcr	p15, 0, r0, c7, c14, 1		@ clean and flush a D-cache line
@@ -228,8 +228,11 @@
 	tst	r0, #CACHE_DLINESIZE - 1
 	bic	r0, r0, #CACHE_DLINESIZE - 1
 	mcrne	p15, 0, r0, c7, c10, 1		@ clean D entry
+
 	tst	r1, #CACHE_DLINESIZE - 1
-	mcrne	p15, 0, r1, c7, c10, 1		@ clean D entry
+	bicne	r2, r1, #CACHE_DLINESIZE - 1
+	mcrne	p15, 0, r2, c7, c10, 1		@ clean D entry
+
 1:	mcr	p15, 0, r0, c7, c6, 1		@ invalidate D entry
 	add	r0, r0, #CACHE_DLINESIZE
 	cmp	r0, r1
@@ -247,10 +250,10 @@
  *	- end	 - virtual end address
  */
 ENTRY(v4wb_dma_clean_range)
-	bic	r0, r0, #CACHE_DLINESIZE - 1
 	sub	ip, r1, r0			@ calculate total size
 	cmp	ip, #CACHE_DLIMIT		@ total size >= limit?
 	bhs	v4wb_dma_clean_all		@ yes: clean the complete d-cache
+	bic	r0, r0, #CACHE_DLINESIZE - 1
 1:	mcr	p15, 0, r0, c7, c10, 1		@ clean D entry
 	add	r0, r0, #CACHE_DLINESIZE
 	cmp	r0, r1




More information about the dslinux-commit mailing list