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
95 .section __ex_table,"a";\
102 .type __clear_user, #function
103 __clear_user: /* %o0=buf, %o1=len */
104 brz,pn %o1, __clear_user_done
106 bl,pn %icc, __clear_user_tiny
107 EX_ST(prefetcha [%o0 + 0x00] %asi, #n_writes)
110 1: EX_ST(stba %g0, [%o0 + 0x00] %asi)
115 2: andcc %o0, 0x7, %g0
117 EX_ST(stwa %g0, [%o0 + 0x00] %asi)
120 3: and %o1, 0x38, %g1
125 EX_ST(prefetcha [%o0 + 0x040] %asi, #n_writes)
126 EX_ST(prefetcha [%o0 + 0x080] %asi, #n_writes)
127 EX_ST(prefetcha [%o0 + 0x0c0] %asi, #n_writes)
128 EX_ST(prefetcha [%o0 + 0x100] %asi, #n_writes)
129 EX_ST(prefetcha [%o0 + 0x140] %asi, #n_writes)
130 4: EX_ST(prefetcha [%o0 + 0x180] %asi, #n_writes)
131 EX_ST(stxa %g0, [%o0 + 0x00] %asi)
132 EX_ST(stxa %g0, [%o0 + 0x08] %asi)
133 EX_ST(stxa %g0, [%o0 + 0x10] %asi)
134 EX_ST(stxa %g0, [%o0 + 0x18] %asi)
135 EX_ST(stxa %g0, [%o0 + 0x20] %asi)
136 EX_ST(stxa %g0, [%o0 + 0x28] %asi)
137 EX_ST(stxa %g0, [%o0 + 0x30] %asi)
138 EX_ST(stxa %g0, [%o0 + 0x38] %asi)
144 5: EX_ST(stxa %g0, [%o0 + 0x00] %asi)
148 6: brz,pt %o1, __clear_user_done
151 1: EX_ST(stba %g0, [%o0 + 0x00] %asi)
158 .size __clear_user, .-__clear_user