1 /* bzero.S: Simple prefetching memset, bzero, and clear_user
4 * Copyright (C) 2005 David S. Miller <davem@davemloft.net>
10 .type __memset, #function
11 __memset: /* %o0=buf, %o1=pat, %o2=len */
14 .type memset, #function
15 memset: /* %o0=buf, %o1=pat, %o2=len */
27 .type __bzero, #function
28 __bzero: /* %o0=buf, %o1=len */
31 brz,pn %o1, __bzero_done
33 bl,pn %icc, __bzero_tiny
34 prefetch [%o0 + 0x000], #n_writes
37 1: stb %o2, [%o0 + 0x00]
42 2: andcc %o0, 0x7, %g0
52 prefetch [%o0 + 0x040], #n_writes
53 prefetch [%o0 + 0x080], #n_writes
54 prefetch [%o0 + 0x0c0], #n_writes
55 prefetch [%o0 + 0x100], #n_writes
56 prefetch [%o0 + 0x140], #n_writes
57 4: prefetch [%o0 + 0x180], #n_writes
71 5: stx %o2, [%o0 + 0x00]
75 6: brz,pt %o1, __bzero_done
78 1: stb %o2, [%o0 + 0x00]
85 .size __bzero, .-__bzero
86 .size __memset, .-__memset
87 .size memset, .-memset
91 .section __ex_table,"a";\
93 .word 98b, __retl_o1; \
98 .type __clear_user, #function
99 __clear_user: /* %o0=buf, %o1=len */
100 brz,pn %o1, __clear_user_done
102 bl,pn %icc, __clear_user_tiny
103 EX_ST(prefetcha [%o0 + 0x00] %asi, #n_writes)
106 1: EX_ST(stba %g0, [%o0 + 0x00] %asi)
111 2: andcc %o0, 0x7, %g0
113 EX_ST(stwa %g0, [%o0 + 0x00] %asi)
116 3: and %o1, 0x38, %g1
121 EX_ST(prefetcha [%o0 + 0x040] %asi, #n_writes)
122 EX_ST(prefetcha [%o0 + 0x080] %asi, #n_writes)
123 EX_ST(prefetcha [%o0 + 0x0c0] %asi, #n_writes)
124 EX_ST(prefetcha [%o0 + 0x100] %asi, #n_writes)
125 EX_ST(prefetcha [%o0 + 0x140] %asi, #n_writes)
126 4: EX_ST(prefetcha [%o0 + 0x180] %asi, #n_writes)
127 EX_ST(stxa %g0, [%o0 + 0x00] %asi)
128 EX_ST(stxa %g0, [%o0 + 0x08] %asi)
129 EX_ST(stxa %g0, [%o0 + 0x10] %asi)
130 EX_ST(stxa %g0, [%o0 + 0x18] %asi)
131 EX_ST(stxa %g0, [%o0 + 0x20] %asi)
132 EX_ST(stxa %g0, [%o0 + 0x28] %asi)
133 EX_ST(stxa %g0, [%o0 + 0x30] %asi)
134 EX_ST(stxa %g0, [%o0 + 0x38] %asi)
140 5: EX_ST(stxa %g0, [%o0 + 0x00] %asi)
144 6: brz,pt %o1, __clear_user_done
147 1: EX_ST(stba %g0, [%o0 + 0x00] %asi)
154 .size __clear_user, .-__clear_user