patch-2.4.20 linux-2.4.20/arch/x86_64/lib/clear_page.S

Next file: linux-2.4.20/arch/x86_64/lib/copy_page.S
Previous file: linux-2.4.20/arch/x86_64/lib/bitstr.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/arch/x86_64/lib/clear_page.S linux-2.4.20/arch/x86_64/lib/clear_page.S
@@ -0,0 +1,34 @@
+	#include <linux/linkage.h>
+
+/*
+ * Zero a page. 	
+ * rdi	page
+ */			
+ENTRY(clear_page)
+	xorl   %eax,%eax
+	movl   $4096/128,%ecx
+	movl   $128,%edx
+loop:
+#define PUT(x) movq %rax,x*8(%rdi) 
+	PUT(0)
+	PUT(1)
+	PUT(2)
+	PUT(3)
+	PUT(4)
+	PUT(5)
+	PUT(6)
+	PUT(7)
+	PUT(8)
+	PUT(9)
+	PUT(10)
+	PUT(11)
+	PUT(12)
+	PUT(13)
+	PUT(14)
+	PUT(15)
+	addq    %rdx,%rdi
+	decl	%ecx
+	jnz	loop
+	sfence	
+	ret
+	    	

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