1
2
3
4
5
6
7
8
9
10
11
12
13 #include <asm/asmmacro.h>
14 #include <asm/page.h>
15 #include <asm/export.h>
16
17 #ifdef CONFIG_ITANIUM
18 # define L3_LINE_SIZE 64
19 # define PREFETCH_LINES 9
20 #else
21 # define L3_LINE_SIZE 128
22 # define PREFETCH_LINES 12
23 #endif
24
25 #define saved_lc r2
26 #define dst_fetch r3
27 #define dst1 r8
28 #define dst2 r9
29 #define dst3 r10
30 #define dst4 r11
31
32 #define dst_last r31
33
34 GLOBAL_ENTRY(clear_page)
35 .prologue
36 .regstk 1,0,0,0
37 mov r16 = PAGE_SIZE/L3_LINE_SIZE-1
38 .save ar.lc, saved_lc
39 mov saved_lc = ar.lc
40
41 .body
42 mov ar.lc = (PREFETCH_LINES - 1)
43 mov dst_fetch = in0
44 adds dst1 = 16, in0
45 adds dst2 = 32, in0
46 ;;
47 .fetch: stf.spill.nta [dst_fetch] = f0, L3_LINE_SIZE
48 adds dst3 = 48, in0
49 br.cloop.sptk.few .fetch
50 ;;
51 addl dst_last = (PAGE_SIZE - PREFETCH_LINES*L3_LINE_SIZE), dst_fetch
52 mov ar.lc = r16
53 adds dst4 = 64, in0
54 ;;
55 #ifdef CONFIG_ITANIUM
56
57 1: stf.spill.nta [dst1] = f0, 64
58 stf.spill.nta [dst2] = f0, 64
59 cmp.lt p8,p0=dst_fetch, dst_last
60 ;;
61 #else
62
63 1: stf.spill.nta [dst1] = f0, 64
64 stf.spill.nta [dst2] = f0, 64
65 stf.spill.nta [dst3] = f0, 64
66 stf.spill.nta [dst4] = f0, 128
67 cmp.lt p8,p0=dst_fetch, dst_last
68 ;;
69 stf.spill.nta [dst1] = f0, 64
70 stf.spill.nta [dst2] = f0, 64
71 #endif
72 stf.spill.nta [dst3] = f0, 64
73 (p8) stf.spill.nta [dst_fetch] = f0, L3_LINE_SIZE
74 br.cloop.sptk.few 1b
75 ;;
76 mov ar.lc = saved_lc
77 br.ret.sptk.many rp
78 END(clear_page)
79 EXPORT_SYMBOL(clear_page)