patch-2.3.99-pre4 linux/arch/sparc64/lib/blockops.S

Next file: linux/arch/sparc64/mm/Makefile
Previous file: linux/arch/sparc64/lib/bitops.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre3/linux/arch/sparc64/lib/blockops.S linux/arch/sparc64/lib/blockops.S
@@ -1,4 +1,4 @@
-/* $Id: blockops.S,v 1.22 2000/03/15 07:18:55 davem Exp $
+/* $Id: blockops.S,v 1.24 2000/03/27 10:38:41 davem Exp $
  * blockops.S: UltraSparc block zero optimized routines.
  *
  * Copyright (C) 1996, 1998, 1999, 2000 David S. Miller (davem@redhat.com)
@@ -38,21 +38,21 @@
 	sethi		%hi(8192), %o2
 1:	TOUCH(f0, f2, f4, f6, f8, f10, f12, f14)
 	ldda		[%o1] ASI_BLK_P, %f32
+	stda		%f48, [%o0] ASI_BLK_P
 	add		%o1, 0x40, %o1
 	sub		%o2, 0x40, %o2
-	stda		%f48, [%o0] ASI_BLK_P
 	add		%o0, 0x40, %o0
 	TOUCH(f16, f18, f20, f22, f24, f26, f28, f30)
 	ldda		[%o1] ASI_BLK_P, %f0
+	stda		%f48, [%o0] ASI_BLK_P
 	add		%o1, 0x40, %o1
 	sub		%o2, 0x40, %o2
-	stda		%f48, [%o0] ASI_BLK_P
 	add		%o0, 0x40, %o0
 	TOUCH(f32, f34, f36, f38, f40, f42, f44, f46)
 	ldda		[%o1] ASI_BLK_P, %f16
-	add		%o1, 0x40, %o1
-	sub		%o2, 0x40, %o2
 	stda		%f48, [%o0] ASI_BLK_P
+	sub		%o2, 0x40, %o2
+	add		%o1, 0x40, %o1
 	cmp		%o2, 0x80
 	bne,pt		%xcc, 1b
 	 add		%o0, 0x40, %o0
@@ -122,7 +122,11 @@
 	stxa		%g2, [%o3] ASI_DTLB_DATA_ACCESS
 	membar		#Sync
 
-	membar		#LoadStore | #StoreStore | #StoreLoad
+	ldub		[%g6 + AOFF_task_thread + AOFF_thread_use_blkcommit], %g2
+	cmp		%g2, 0
+	bne,pn		%xcc, copy_page_using_blkcommit
+	 nop
+
 	ldda		[%o1] ASI_BLK_P, %f0
 	add		%o1, 0x40, %o1
 	ldda		[%o1] ASI_BLK_P, %f16
@@ -130,21 +134,21 @@
 	sethi		%hi(8192), %o2
 1:	TOUCH(f0, f2, f4, f6, f8, f10, f12, f14)
 	ldda		[%o1] ASI_BLK_P, %f32
+	stda		%f48, [%o0] ASI_BLK_P
 	add		%o1, 0x40, %o1
 	sub		%o2, 0x40, %o2
-	stda		%f48, [%o0] ASI_BLK_P
 	add		%o0, 0x40, %o0
 	TOUCH(f16, f18, f20, f22, f24, f26, f28, f30)
 	ldda		[%o1] ASI_BLK_P, %f0
+	stda		%f48, [%o0] ASI_BLK_P
 	add		%o1, 0x40, %o1
 	sub		%o2, 0x40, %o2
-	stda		%f48, [%o0] ASI_BLK_P
 	add		%o0, 0x40, %o0
 	TOUCH(f32, f34, f36, f38, f40, f42, f44, f46)
 	ldda		[%o1] ASI_BLK_P, %f16
-	add		%o1, 0x40, %o1
-	sub		%o2, 0x40, %o2
 	stda		%f48, [%o0] ASI_BLK_P
+	sub		%o2, 0x40, %o2
+	add		%o1, 0x40, %o1
 	cmp		%o2, 0x80
 	bne,pt		%xcc, 1b
 	 add		%o0, 0x40, %o0
@@ -152,6 +156,7 @@
 	stda		%f0, [%o0] ASI_BLK_P
 	add		%o0, 0x40, %o0
 	stda		%f16, [%o0] ASI_BLK_P
+copy_user_page_continue:
 	membar		#Sync
 	VISExit
 
@@ -166,6 +171,39 @@
 	jmpl		%o7 + 0x8, %g0
 	 wrpr		%g3, 0x0, %pstate
 
+copy_page_using_blkcommit:
+	membar		#LoadStore | #StoreStore | #StoreLoad
+	ldda		[%o1] ASI_BLK_P, %f0
+	add		%o1, 0x40, %o1
+	ldda		[%o1] ASI_BLK_P, %f16
+	add		%o1, 0x40, %o1
+	sethi		%hi(8192), %o2
+1:	TOUCH(f0, f2, f4, f6, f8, f10, f12, f14)
+	ldda		[%o1] ASI_BLK_P, %f32
+	stda		%f48, [%o0] ASI_BLK_COMMIT_P
+	add		%o1, 0x40, %o1
+	sub		%o2, 0x40, %o2
+	add		%o0, 0x40, %o0
+	TOUCH(f16, f18, f20, f22, f24, f26, f28, f30)
+	ldda		[%o1] ASI_BLK_P, %f0
+	stda		%f48, [%o0] ASI_BLK_COMMIT_P
+	add		%o1, 0x40, %o1
+	sub		%o2, 0x40, %o2
+	add		%o0, 0x40, %o0
+	TOUCH(f32, f34, f36, f38, f40, f42, f44, f46)
+	ldda		[%o1] ASI_BLK_P, %f16
+	stda		%f48, [%o0] ASI_BLK_COMMIT_P
+	sub		%o2, 0x40, %o2
+	add		%o1, 0x40, %o1
+	cmp		%o2, 0x80
+	bne,pt		%xcc, 1b
+	 add		%o0, 0x40, %o0
+	membar		#Sync
+	stda		%f0, [%o0] ASI_BLK_COMMIT_P
+	add		%o0, 0x40, %o0
+	ba,pt		%xcc, copy_user_page_continue
+	 stda		%f16, [%o0] ASI_BLK_COMMIT_P
+
 	.align		32
 	.globl		clear_page
 	.type		clear_page,@function
@@ -213,6 +251,7 @@
 	mov		1, %o4
 
 clear_page_common:
+	membar		#StoreLoad | #StoreStore | #LoadStore	! LSU	Group
 	fzero		%f0				! FPA	Group
 	mov		32, %o1				! IEU0
 	fzero		%f2				! FPA	Group
@@ -223,7 +262,6 @@
 
 	faddd		%f0, %f2, %f12			! FPA	Group
 	fmuld		%f0, %f2, %f14			! FPM
-	membar		#StoreLoad | #StoreStore | #LoadStore	! LSU	Group
 1:	stda		%f0, [%o0 + %g0] ASI_BLK_P	! Store	Group
 	add		%o0, 0x40, %o0			! IEU0
 	stda		%f0, [%o0 + %g0] ASI_BLK_P	! Store	Group

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)