ia64/xen-unstable

view xen/arch/x86/clear_page.S @ 15425:79b180596baf

x86: introduce specialized clear_page()

More than doubles performance of page clearing on not too old
processors (SSE2 supported).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Jun 20 16:18:03 2007 +0100 (2007-06-20)
parents
children
line source
1 #include <xen/config.h>
2 #include <asm/page.h>
4 #ifdef __i386__
5 #define ptr_reg %edx
6 #else
7 #define ptr_reg %rdi
8 #endif
10 ENTRY(clear_page_sse2)
11 #ifdef __i386__
12 mov 4(%esp), ptr_reg
13 #endif
14 mov $PAGE_SIZE/16, %ecx
15 xor %eax,%eax
17 0: dec %ecx
18 movnti %eax, (ptr_reg)
19 movnti %eax, 4(ptr_reg)
20 movnti %eax, 8(ptr_reg)
21 movnti %eax, 12(ptr_reg)
22 lea 16(ptr_reg), ptr_reg
23 jnz 0b
25 sfence
26 ret