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

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

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/sparc/lib/bitops.S (Version linux-6.12-rc7) and /arch/sparc/lib/bitops.S (Version linux-4.13.16)


  1 /* SPDX-License-Identifier: GPL-2.0 */         << 
  2 /* bitops.S: Sparc64 atomic bit operations.         1 /* bitops.S: Sparc64 atomic bit operations.
  3  *                                                  2  *
  4  * Copyright (C) 2000, 2007 David S. Miller (d      3  * Copyright (C) 2000, 2007 David S. Miller (davem@davemloft.net)
  5  */                                                 4  */
  6                                                     5 
  7 #include <linux/export.h>                      << 
  8 #include <linux/linkage.h>                          6 #include <linux/linkage.h>
  9 #include <asm/asi.h>                                7 #include <asm/asi.h>
 10 #include <asm/backoff.h>                            8 #include <asm/backoff.h>
                                                   >>   9 #include <asm/export.h>
 11                                                    10 
 12         .text                                      11         .text
 13                                                    12 
 14 ENTRY(test_and_set_bit) /* %o0=nr, %o1=addr */     13 ENTRY(test_and_set_bit) /* %o0=nr, %o1=addr */
 15         BACKOFF_SETUP(%o3)                         14         BACKOFF_SETUP(%o3)
 16         srlx    %o0, 6, %g1                        15         srlx    %o0, 6, %g1
 17         mov     1, %o2                             16         mov     1, %o2
 18         sllx    %g1, 3, %g3                        17         sllx    %g1, 3, %g3
 19         and     %o0, 63, %g2                       18         and     %o0, 63, %g2
 20         sllx    %o2, %g2, %o2                      19         sllx    %o2, %g2, %o2
 21         add     %o1, %g3, %o1                      20         add     %o1, %g3, %o1
 22 1:      ldx     [%o1], %g7                         21 1:      ldx     [%o1], %g7
 23         or      %g7, %o2, %g1                      22         or      %g7, %o2, %g1
 24         casx    [%o1], %g7, %g1                    23         casx    [%o1], %g7, %g1
 25         cmp     %g7, %g1                           24         cmp     %g7, %g1
 26         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)        25         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)
 27          and    %g7, %o2, %g2                      26          and    %g7, %o2, %g2
 28         clr     %o0                                27         clr     %o0
 29         movrne  %g2, 1, %o0                        28         movrne  %g2, 1, %o0
 30         retl                                       29         retl
 31          nop                                       30          nop
 32 2:      BACKOFF_SPIN(%o3, %o4, 1b)                 31 2:      BACKOFF_SPIN(%o3, %o4, 1b)
 33 ENDPROC(test_and_set_bit)                          32 ENDPROC(test_and_set_bit)
 34 EXPORT_SYMBOL(test_and_set_bit)                    33 EXPORT_SYMBOL(test_and_set_bit)
 35                                                    34 
 36 ENTRY(test_and_clear_bit) /* %o0=nr, %o1=addr      35 ENTRY(test_and_clear_bit) /* %o0=nr, %o1=addr */
 37         BACKOFF_SETUP(%o3)                         36         BACKOFF_SETUP(%o3)
 38         srlx    %o0, 6, %g1                        37         srlx    %o0, 6, %g1
 39         mov     1, %o2                             38         mov     1, %o2
 40         sllx    %g1, 3, %g3                        39         sllx    %g1, 3, %g3
 41         and     %o0, 63, %g2                       40         and     %o0, 63, %g2
 42         sllx    %o2, %g2, %o2                      41         sllx    %o2, %g2, %o2
 43         add     %o1, %g3, %o1                      42         add     %o1, %g3, %o1
 44 1:      ldx     [%o1], %g7                         43 1:      ldx     [%o1], %g7
 45         andn    %g7, %o2, %g1                      44         andn    %g7, %o2, %g1
 46         casx    [%o1], %g7, %g1                    45         casx    [%o1], %g7, %g1
 47         cmp     %g7, %g1                           46         cmp     %g7, %g1
 48         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)        47         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)
 49          and    %g7, %o2, %g2                      48          and    %g7, %o2, %g2
 50         clr     %o0                                49         clr     %o0
 51         movrne  %g2, 1, %o0                        50         movrne  %g2, 1, %o0
 52         retl                                       51         retl
 53          nop                                       52          nop
 54 2:      BACKOFF_SPIN(%o3, %o4, 1b)                 53 2:      BACKOFF_SPIN(%o3, %o4, 1b)
 55 ENDPROC(test_and_clear_bit)                        54 ENDPROC(test_and_clear_bit)
 56 EXPORT_SYMBOL(test_and_clear_bit)                  55 EXPORT_SYMBOL(test_and_clear_bit)
 57                                                    56 
 58 ENTRY(test_and_change_bit) /* %o0=nr, %o1=addr     57 ENTRY(test_and_change_bit) /* %o0=nr, %o1=addr */
 59         BACKOFF_SETUP(%o3)                         58         BACKOFF_SETUP(%o3)
 60         srlx    %o0, 6, %g1                        59         srlx    %o0, 6, %g1
 61         mov     1, %o2                             60         mov     1, %o2
 62         sllx    %g1, 3, %g3                        61         sllx    %g1, 3, %g3
 63         and     %o0, 63, %g2                       62         and     %o0, 63, %g2
 64         sllx    %o2, %g2, %o2                      63         sllx    %o2, %g2, %o2
 65         add     %o1, %g3, %o1                      64         add     %o1, %g3, %o1
 66 1:      ldx     [%o1], %g7                         65 1:      ldx     [%o1], %g7
 67         xor     %g7, %o2, %g1                      66         xor     %g7, %o2, %g1
 68         casx    [%o1], %g7, %g1                    67         casx    [%o1], %g7, %g1
 69         cmp     %g7, %g1                           68         cmp     %g7, %g1
 70         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)        69         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)
 71          and    %g7, %o2, %g2                      70          and    %g7, %o2, %g2
 72         clr     %o0                                71         clr     %o0
 73         movrne  %g2, 1, %o0                        72         movrne  %g2, 1, %o0
 74         retl                                       73         retl
 75          nop                                       74          nop
 76 2:      BACKOFF_SPIN(%o3, %o4, 1b)                 75 2:      BACKOFF_SPIN(%o3, %o4, 1b)
 77 ENDPROC(test_and_change_bit)                       76 ENDPROC(test_and_change_bit)
 78 EXPORT_SYMBOL(test_and_change_bit)                 77 EXPORT_SYMBOL(test_and_change_bit)
 79                                                    78 
 80 ENTRY(set_bit) /* %o0=nr, %o1=addr */              79 ENTRY(set_bit) /* %o0=nr, %o1=addr */
 81         BACKOFF_SETUP(%o3)                         80         BACKOFF_SETUP(%o3)
 82         srlx    %o0, 6, %g1                        81         srlx    %o0, 6, %g1
 83         mov     1, %o2                             82         mov     1, %o2
 84         sllx    %g1, 3, %g3                        83         sllx    %g1, 3, %g3
 85         and     %o0, 63, %g2                       84         and     %o0, 63, %g2
 86         sllx    %o2, %g2, %o2                      85         sllx    %o2, %g2, %o2
 87         add     %o1, %g3, %o1                      86         add     %o1, %g3, %o1
 88 1:      ldx     [%o1], %g7                         87 1:      ldx     [%o1], %g7
 89         or      %g7, %o2, %g1                      88         or      %g7, %o2, %g1
 90         casx    [%o1], %g7, %g1                    89         casx    [%o1], %g7, %g1
 91         cmp     %g7, %g1                           90         cmp     %g7, %g1
 92         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)        91         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)
 93          nop                                       92          nop
 94         retl                                       93         retl
 95          nop                                       94          nop
 96 2:      BACKOFF_SPIN(%o3, %o4, 1b)                 95 2:      BACKOFF_SPIN(%o3, %o4, 1b)
 97 ENDPROC(set_bit)                                   96 ENDPROC(set_bit)
 98 EXPORT_SYMBOL(set_bit)                             97 EXPORT_SYMBOL(set_bit)
 99                                                    98 
100 ENTRY(clear_bit) /* %o0=nr, %o1=addr */            99 ENTRY(clear_bit) /* %o0=nr, %o1=addr */
101         BACKOFF_SETUP(%o3)                        100         BACKOFF_SETUP(%o3)
102         srlx    %o0, 6, %g1                       101         srlx    %o0, 6, %g1
103         mov     1, %o2                            102         mov     1, %o2
104         sllx    %g1, 3, %g3                       103         sllx    %g1, 3, %g3
105         and     %o0, 63, %g2                      104         and     %o0, 63, %g2
106         sllx    %o2, %g2, %o2                     105         sllx    %o2, %g2, %o2
107         add     %o1, %g3, %o1                     106         add     %o1, %g3, %o1
108 1:      ldx     [%o1], %g7                        107 1:      ldx     [%o1], %g7
109         andn    %g7, %o2, %g1                     108         andn    %g7, %o2, %g1
110         casx    [%o1], %g7, %g1                   109         casx    [%o1], %g7, %g1
111         cmp     %g7, %g1                          110         cmp     %g7, %g1
112         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)       111         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)
113          nop                                      112          nop
114         retl                                      113         retl
115          nop                                      114          nop
116 2:      BACKOFF_SPIN(%o3, %o4, 1b)                115 2:      BACKOFF_SPIN(%o3, %o4, 1b)
117 ENDPROC(clear_bit)                                116 ENDPROC(clear_bit)
118 EXPORT_SYMBOL(clear_bit)                          117 EXPORT_SYMBOL(clear_bit)
119                                                   118 
120 ENTRY(change_bit) /* %o0=nr, %o1=addr */          119 ENTRY(change_bit) /* %o0=nr, %o1=addr */
121         BACKOFF_SETUP(%o3)                        120         BACKOFF_SETUP(%o3)
122         srlx    %o0, 6, %g1                       121         srlx    %o0, 6, %g1
123         mov     1, %o2                            122         mov     1, %o2
124         sllx    %g1, 3, %g3                       123         sllx    %g1, 3, %g3
125         and     %o0, 63, %g2                      124         and     %o0, 63, %g2
126         sllx    %o2, %g2, %o2                     125         sllx    %o2, %g2, %o2
127         add     %o1, %g3, %o1                     126         add     %o1, %g3, %o1
128 1:      ldx     [%o1], %g7                        127 1:      ldx     [%o1], %g7
129         xor     %g7, %o2, %g1                     128         xor     %g7, %o2, %g1
130         casx    [%o1], %g7, %g1                   129         casx    [%o1], %g7, %g1
131         cmp     %g7, %g1                          130         cmp     %g7, %g1
132         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)       131         bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)
133          nop                                      132          nop
134         retl                                      133         retl
135          nop                                      134          nop
136 2:      BACKOFF_SPIN(%o3, %o4, 1b)                135 2:      BACKOFF_SPIN(%o3, %o4, 1b)
137 ENDPROC(change_bit)                               136 ENDPROC(change_bit)
138 EXPORT_SYMBOL(change_bit)                         137 EXPORT_SYMBOL(change_bit)
                                                      

~ [ 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