]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/x86/lib/clear_page_64.S
UBUNTU: [Config] CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m
[mirror_ubuntu-artful-kernel.git] / arch / x86 / lib / clear_page_64.S
CommitLineData
8d379dad 1#include <linux/linkage.h>
cd4d09ec 2#include <asm/cpufeatures.h>
e365c9df 3#include <asm/alternative-asm.h>
784d5699 4#include <asm/export.h>
8d379dad 5
1da177e4 6/*
6620ef28
BP
7 * Most CPUs support enhanced REP MOVSB/STOSB instructions. It is
8 * recommended to use this when possible and we do use them by default.
9 * If enhanced REP MOVSB/STOSB is not available, try to use fast string.
10 * Otherwise, use original.
11 */
12
13/*
14 * Zero a page.
15 * %rdi - page
16 */
f25d3847 17ENTRY(clear_page_rep)
8d379dad
JB
18 movl $4096/8,%ecx
19 xorl %eax,%eax
20 rep stosq
21 ret
f25d3847
BP
22ENDPROC(clear_page_rep)
23EXPORT_SYMBOL_GPL(clear_page_rep)
8d379dad 24
6620ef28 25ENTRY(clear_page_orig)
7bcd3f34
AK
26 xorl %eax,%eax
27 movl $4096/64,%ecx
28 .p2align 4
29.Lloop:
30 decl %ecx
31#define PUT(x) movq %rax,x*8(%rdi)
32 movq %rax,(%rdi)
33 PUT(1)
34 PUT(2)
35 PUT(3)
36 PUT(4)
37 PUT(5)
38 PUT(6)
39 PUT(7)
40 leaq 64(%rdi),%rdi
41 jnz .Lloop
42 nop
43 ret
6620ef28 44ENDPROC(clear_page_orig)
f25d3847 45EXPORT_SYMBOL_GPL(clear_page_orig)
7bcd3f34 46
f25d3847 47ENTRY(clear_page_erms)
6620ef28
BP
48 movl $4096,%ecx
49 xorl %eax,%eax
50 rep stosb
51 ret
f25d3847
BP
52ENDPROC(clear_page_erms)
53EXPORT_SYMBOL_GPL(clear_page_erms)