~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sparc/lib/bzero.S

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/sparc/lib/bzero.S (Version linux-6.11-rc3) and /arch/sparc/lib/bzero.S (Version linux-4.12.14)


  1 /* SPDX-License-Identifier: GPL-2.0 */         << 
  2 /* bzero.S: Simple prefetching memset, bzero,       1 /* bzero.S: Simple prefetching memset, bzero, and clear_user
  3  *          implementations.                        2  *          implementations.
  4  *                                                  3  *
  5  * Copyright (C) 2005 David S. Miller <davem@da      4  * Copyright (C) 2005 David S. Miller <davem@davemloft.net>
  6  */                                                 5  */
  7                                                     6 
  8 #include <linux/export.h>                      << 
  9 #include <linux/linkage.h>                          7 #include <linux/linkage.h>
                                                   >>   8 #include <asm/export.h>
 10                                                     9 
 11         .text                                      10         .text
 12                                                    11 
 13 ENTRY(memset) /* %o0=buf, %o1=pat, %o2=len */      12 ENTRY(memset) /* %o0=buf, %o1=pat, %o2=len */
 14         and             %o1, 0xff, %o3             13         and             %o1, 0xff, %o3
 15         mov             %o2, %o1                   14         mov             %o2, %o1
 16         sllx            %o3, 8, %g1                15         sllx            %o3, 8, %g1
 17         or              %g1, %o3, %o2              16         or              %g1, %o3, %o2
 18         sllx            %o2, 16, %g1               17         sllx            %o2, 16, %g1
 19         or              %g1, %o2, %o2              18         or              %g1, %o2, %o2
 20         sllx            %o2, 32, %g1               19         sllx            %o2, 32, %g1
 21         ba,pt           %xcc, 1f                   20         ba,pt           %xcc, 1f
 22          or             %g1, %o2, %o2              21          or             %g1, %o2, %o2
 23                                                    22 
 24 ENTRY(__bzero) /* %o0=buf, %o1=len */              23 ENTRY(__bzero) /* %o0=buf, %o1=len */
 25         clr             %o2                        24         clr             %o2
 26 1:      mov             %o0, %o3                   25 1:      mov             %o0, %o3
 27         brz,pn          %o1, __bzero_done          26         brz,pn          %o1, __bzero_done
 28          cmp            %o1, 16                    27          cmp            %o1, 16
 29         bl,pn           %icc, __bzero_tiny         28         bl,pn           %icc, __bzero_tiny
 30          prefetch       [%o0 + 0x000], #n_writ     29          prefetch       [%o0 + 0x000], #n_writes
 31         andcc           %o0, 0x3, %g0              30         andcc           %o0, 0x3, %g0
 32         be,pt           %icc, 2f                   31         be,pt           %icc, 2f
 33 1:       stb            %o2, [%o0 + 0x00]          32 1:       stb            %o2, [%o0 + 0x00]
 34         add             %o0, 1, %o0                33         add             %o0, 1, %o0
 35         andcc           %o0, 0x3, %g0              34         andcc           %o0, 0x3, %g0
 36         bne,pn          %icc, 1b                   35         bne,pn          %icc, 1b
 37          sub            %o1, 1, %o1                36          sub            %o1, 1, %o1
 38 2:      andcc           %o0, 0x7, %g0              37 2:      andcc           %o0, 0x7, %g0
 39         be,pt           %icc, 3f                   38         be,pt           %icc, 3f
 40          stw            %o2, [%o0 + 0x00]          39          stw            %o2, [%o0 + 0x00]
 41         sub             %o1, 4, %o1                40         sub             %o1, 4, %o1
 42         add             %o0, 4, %o0                41         add             %o0, 4, %o0
 43 3:      and             %o1, 0x38, %g1             42 3:      and             %o1, 0x38, %g1
 44         cmp             %o1, 0x40                  43         cmp             %o1, 0x40
 45         andn            %o1, 0x3f, %o4             44         andn            %o1, 0x3f, %o4
 46         bl,pn           %icc, 5f                   45         bl,pn           %icc, 5f
 47          and            %o1, 0x7, %o1              46          and            %o1, 0x7, %o1
 48         prefetch        [%o0 + 0x040], #n_writ     47         prefetch        [%o0 + 0x040], #n_writes
 49         prefetch        [%o0 + 0x080], #n_writ     48         prefetch        [%o0 + 0x080], #n_writes
 50         prefetch        [%o0 + 0x0c0], #n_writ     49         prefetch        [%o0 + 0x0c0], #n_writes
 51         prefetch        [%o0 + 0x100], #n_writ     50         prefetch        [%o0 + 0x100], #n_writes
 52         prefetch        [%o0 + 0x140], #n_writ     51         prefetch        [%o0 + 0x140], #n_writes
 53 4:      prefetch        [%o0 + 0x180], #n_writ     52 4:      prefetch        [%o0 + 0x180], #n_writes
 54         stx             %o2, [%o0 + 0x00]          53         stx             %o2, [%o0 + 0x00]
 55         stx             %o2, [%o0 + 0x08]          54         stx             %o2, [%o0 + 0x08]
 56         stx             %o2, [%o0 + 0x10]          55         stx             %o2, [%o0 + 0x10]
 57         stx             %o2, [%o0 + 0x18]          56         stx             %o2, [%o0 + 0x18]
 58         stx             %o2, [%o0 + 0x20]          57         stx             %o2, [%o0 + 0x20]
 59         stx             %o2, [%o0 + 0x28]          58         stx             %o2, [%o0 + 0x28]
 60         stx             %o2, [%o0 + 0x30]          59         stx             %o2, [%o0 + 0x30]
 61         stx             %o2, [%o0 + 0x38]          60         stx             %o2, [%o0 + 0x38]
 62         subcc           %o4, 0x40, %o4             61         subcc           %o4, 0x40, %o4
 63         bne,pt          %icc, 4b                   62         bne,pt          %icc, 4b
 64          add            %o0, 0x40, %o0             63          add            %o0, 0x40, %o0
 65         brz,pn          %g1, 6f                    64         brz,pn          %g1, 6f
 66          nop                                       65          nop
 67 5:      stx             %o2, [%o0 + 0x00]          66 5:      stx             %o2, [%o0 + 0x00]
 68         subcc           %g1, 8, %g1                67         subcc           %g1, 8, %g1
 69         bne,pt          %icc, 5b                   68         bne,pt          %icc, 5b
 70          add            %o0, 0x8, %o0              69          add            %o0, 0x8, %o0
 71 6:      brz,pt          %o1, __bzero_done          70 6:      brz,pt          %o1, __bzero_done
 72          nop                                       71          nop
 73 __bzero_tiny:                                      72 __bzero_tiny:
 74 1:      stb             %o2, [%o0 + 0x00]          73 1:      stb             %o2, [%o0 + 0x00]
 75         subcc           %o1, 1, %o1                74         subcc           %o1, 1, %o1
 76         bne,pt          %icc, 1b                   75         bne,pt          %icc, 1b
 77          add            %o0, 1, %o0                76          add            %o0, 1, %o0
 78 __bzero_done:                                      77 __bzero_done:
 79         retl                                       78         retl
 80          mov            %o3, %o0                   79          mov            %o3, %o0
 81 ENDPROC(__bzero)                                   80 ENDPROC(__bzero)
 82 ENDPROC(memset)                                    81 ENDPROC(memset)
 83 EXPORT_SYMBOL(__bzero)                             82 EXPORT_SYMBOL(__bzero)
 84 EXPORT_SYMBOL(memset)                              83 EXPORT_SYMBOL(memset)
 85                                                    84 
 86 #define EX_ST(x,y)              \                  85 #define EX_ST(x,y)              \
 87 98:     x,y;                    \                  86 98:     x,y;                    \
 88         .section __ex_table,"a";\                  87         .section __ex_table,"a";\
 89         .align 4;               \                  88         .align 4;               \
 90         .word 98b, __retl_o1;   \                  89         .word 98b, __retl_o1;   \
 91         .text;                  \                  90         .text;                  \
 92         .align 4;                                  91         .align 4;
 93                                                    92 
 94 ENTRY(__clear_user) /* %o0=buf, %o1=len */         93 ENTRY(__clear_user) /* %o0=buf, %o1=len */
 95         brz,pn          %o1, __clear_user_done     94         brz,pn          %o1, __clear_user_done
 96          cmp            %o1, 16                    95          cmp            %o1, 16
 97         bl,pn           %icc, __clear_user_tin     96         bl,pn           %icc, __clear_user_tiny
 98          EX_ST(prefetcha [%o0 + 0x00] %asi, #n     97          EX_ST(prefetcha [%o0 + 0x00] %asi, #n_writes)
 99         andcc           %o0, 0x3, %g0              98         andcc           %o0, 0x3, %g0
100         be,pt           %icc, 2f                   99         be,pt           %icc, 2f
101 1:       EX_ST(stba     %g0, [%o0 + 0x00] %asi    100 1:       EX_ST(stba     %g0, [%o0 + 0x00] %asi)
102         add             %o0, 1, %o0               101         add             %o0, 1, %o0
103         andcc           %o0, 0x3, %g0             102         andcc           %o0, 0x3, %g0
104         bne,pn          %icc, 1b                  103         bne,pn          %icc, 1b
105          sub            %o1, 1, %o1               104          sub            %o1, 1, %o1
106 2:      andcc           %o0, 0x7, %g0             105 2:      andcc           %o0, 0x7, %g0
107         be,pt           %icc, 3f                  106         be,pt           %icc, 3f
108          EX_ST(stwa     %g0, [%o0 + 0x00] %asi    107          EX_ST(stwa     %g0, [%o0 + 0x00] %asi)
109         sub             %o1, 4, %o1               108         sub             %o1, 4, %o1
110         add             %o0, 4, %o0               109         add             %o0, 4, %o0
111 3:      and             %o1, 0x38, %g1            110 3:      and             %o1, 0x38, %g1
112         cmp             %o1, 0x40                 111         cmp             %o1, 0x40
113         andn            %o1, 0x3f, %o4            112         andn            %o1, 0x3f, %o4
114         bl,pn           %icc, 5f                  113         bl,pn           %icc, 5f
115          and            %o1, 0x7, %o1             114          and            %o1, 0x7, %o1
116         EX_ST(prefetcha [%o0 + 0x040] %asi, #n    115         EX_ST(prefetcha [%o0 + 0x040] %asi, #n_writes)
117         EX_ST(prefetcha [%o0 + 0x080] %asi, #n    116         EX_ST(prefetcha [%o0 + 0x080] %asi, #n_writes)
118         EX_ST(prefetcha [%o0 + 0x0c0] %asi, #n    117         EX_ST(prefetcha [%o0 + 0x0c0] %asi, #n_writes)
119         EX_ST(prefetcha [%o0 + 0x100] %asi, #n    118         EX_ST(prefetcha [%o0 + 0x100] %asi, #n_writes)
120         EX_ST(prefetcha [%o0 + 0x140] %asi, #n    119         EX_ST(prefetcha [%o0 + 0x140] %asi, #n_writes)
121 4:      EX_ST(prefetcha [%o0 + 0x180] %asi, #n    120 4:      EX_ST(prefetcha [%o0 + 0x180] %asi, #n_writes)
122         EX_ST(stxa      %g0, [%o0 + 0x00] %asi    121         EX_ST(stxa      %g0, [%o0 + 0x00] %asi)
123         EX_ST(stxa      %g0, [%o0 + 0x08] %asi    122         EX_ST(stxa      %g0, [%o0 + 0x08] %asi)
124         EX_ST(stxa      %g0, [%o0 + 0x10] %asi    123         EX_ST(stxa      %g0, [%o0 + 0x10] %asi)
125         EX_ST(stxa      %g0, [%o0 + 0x18] %asi    124         EX_ST(stxa      %g0, [%o0 + 0x18] %asi)
126         EX_ST(stxa      %g0, [%o0 + 0x20] %asi    125         EX_ST(stxa      %g0, [%o0 + 0x20] %asi)
127         EX_ST(stxa      %g0, [%o0 + 0x28] %asi    126         EX_ST(stxa      %g0, [%o0 + 0x28] %asi)
128         EX_ST(stxa      %g0, [%o0 + 0x30] %asi    127         EX_ST(stxa      %g0, [%o0 + 0x30] %asi)
129         EX_ST(stxa      %g0, [%o0 + 0x38] %asi    128         EX_ST(stxa      %g0, [%o0 + 0x38] %asi)
130         subcc           %o4, 0x40, %o4            129         subcc           %o4, 0x40, %o4
131         bne,pt          %icc, 4b                  130         bne,pt          %icc, 4b
132          add            %o0, 0x40, %o0            131          add            %o0, 0x40, %o0
133         brz,pn          %g1, 6f                   132         brz,pn          %g1, 6f
134          nop                                      133          nop
135 5:      EX_ST(stxa      %g0, [%o0 + 0x00] %asi    134 5:      EX_ST(stxa      %g0, [%o0 + 0x00] %asi)
136         subcc           %g1, 8, %g1               135         subcc           %g1, 8, %g1
137         bne,pt          %icc, 5b                  136         bne,pt          %icc, 5b
138          add            %o0, 0x8, %o0             137          add            %o0, 0x8, %o0
139 6:      brz,pt          %o1, __clear_user_done    138 6:      brz,pt          %o1, __clear_user_done
140          nop                                      139          nop
141 __clear_user_tiny:                                140 __clear_user_tiny:
142 1:      EX_ST(stba      %g0, [%o0 + 0x00] %asi    141 1:      EX_ST(stba      %g0, [%o0 + 0x00] %asi)
143         subcc           %o1, 1, %o1               142         subcc           %o1, 1, %o1
144         bne,pt          %icc, 1b                  143         bne,pt          %icc, 1b
145          add            %o0, 1, %o0               144          add            %o0, 1, %o0
146 __clear_user_done:                                145 __clear_user_done:
147         retl                                      146         retl
148          clr            %o0                       147          clr            %o0
149 ENDPROC(__clear_user)                             148 ENDPROC(__clear_user)
150 EXPORT_SYMBOL(__clear_user)                       149 EXPORT_SYMBOL(__clear_user)
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php