Initial Linux ZFS GIT Repo
[zfs.git] / zfs / lib / libsolcompat / i386 / atomic.S
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25
26         .ident  "%Z%%M% %I%     %E% SMI"
27
28         .file   "%M%"
29
30 #define _ASM
31 #include <sys/asm_linkage.h>
32
33 #if defined(_KERNEL)
34         /*
35          * Legacy kernel interfaces; they will go away (eventually).
36          */
37         ANSI_PRAGMA_WEAK2(cas8,atomic_cas_8,function)
38         ANSI_PRAGMA_WEAK2(cas32,atomic_cas_32,function)
39         ANSI_PRAGMA_WEAK2(cas64,atomic_cas_64,function)
40         ANSI_PRAGMA_WEAK2(caslong,atomic_cas_ulong,function)
41         ANSI_PRAGMA_WEAK2(casptr,atomic_cas_ptr,function)
42         ANSI_PRAGMA_WEAK2(atomic_and_long,atomic_and_ulong,function)
43         ANSI_PRAGMA_WEAK2(atomic_or_long,atomic_or_ulong,function)
44 #else
45         /*
46          * Include the definitions for the libc weak aliases.
47          */
48 #include "../atomic_asm_weak.h"
49 #endif
50
51         ENTRY(atomic_inc_8)
52         ALTENTRY(atomic_inc_uchar)
53         movl    4(%esp), %eax
54         lock
55         incb    (%eax)
56         ret
57         SET_SIZE(atomic_inc_uchar)
58         SET_SIZE(atomic_inc_8)
59
60         ENTRY(atomic_inc_16)
61         ALTENTRY(atomic_inc_ushort)
62         movl    4(%esp), %eax
63         lock
64         incw    (%eax)
65         ret
66         SET_SIZE(atomic_inc_ushort)
67         SET_SIZE(atomic_inc_16)
68
69         ENTRY(atomic_inc_32)
70         ALTENTRY(atomic_inc_uint)
71         ALTENTRY(atomic_inc_ulong)
72         movl    4(%esp), %eax
73         lock
74         incl    (%eax)
75         ret
76         SET_SIZE(atomic_inc_ulong)
77         SET_SIZE(atomic_inc_uint)
78         SET_SIZE(atomic_inc_32)
79
80         ENTRY(atomic_inc_8_nv)
81         ALTENTRY(atomic_inc_uchar_nv)
82         movl    4(%esp), %edx
83         movb    (%edx), %al
84 1:
85         leal    1(%eax), %ecx
86         lock
87         cmpxchgb %cl, (%edx)
88         jne     1b
89         movzbl  %cl, %eax
90         ret
91         SET_SIZE(atomic_inc_uchar_nv)
92         SET_SIZE(atomic_inc_8_nv)
93
94         ENTRY(atomic_inc_16_nv)
95         ALTENTRY(atomic_inc_ushort_nv)
96         movl    4(%esp), %edx
97         movw    (%edx), %ax
98 1:
99         leal    1(%eax), %ecx
100         lock
101         cmpxchgw %cx, (%edx)
102         jne     1b
103         movzwl  %cx, %eax
104         ret
105         SET_SIZE(atomic_inc_ushort_nv)
106         SET_SIZE(atomic_inc_16_nv)
107
108         ENTRY(atomic_inc_32_nv)
109         ALTENTRY(atomic_inc_uint_nv)
110         ALTENTRY(atomic_inc_ulong_nv)
111         movl    4(%esp), %edx
112         movl    (%edx), %eax
113 1:
114         leal    1(%eax), %ecx
115         lock
116         cmpxchgl %ecx, (%edx)
117         jne     1b
118         movl    %ecx, %eax
119         ret
120         SET_SIZE(atomic_inc_ulong_nv)
121         SET_SIZE(atomic_inc_uint_nv)
122         SET_SIZE(atomic_inc_32_nv)
123
124         /*
125          * NOTE: If atomic_inc_64 and atomic_inc_64_nv are ever
126          * separated, you need to also edit the libc i386 platform
127          * specific mapfile and remove the NODYNSORT attribute
128          * from atomic_inc_64_nv.
129          */
130         ENTRY(atomic_inc_64)
131         ALTENTRY(atomic_inc_64_nv)
132         pushl   %edi
133         pushl   %ebx
134         movl    12(%esp), %edi
135         movl    (%edi), %eax
136         movl    4(%edi), %edx
137 1:
138         xorl    %ebx, %ebx
139         xorl    %ecx, %ecx
140         incl    %ebx
141         addl    %eax, %ebx
142         adcl    %edx, %ecx
143         lock
144         cmpxchg8b (%edi)
145         jne     1b
146         movl    %ebx, %eax
147         movl    %ecx, %edx
148         popl    %ebx
149         popl    %edi
150         ret
151         SET_SIZE(atomic_inc_64_nv)
152         SET_SIZE(atomic_inc_64)
153
154         ENTRY(atomic_dec_8)
155         ALTENTRY(atomic_dec_uchar)
156         movl    4(%esp), %eax
157         lock
158         decb    (%eax)
159         ret
160         SET_SIZE(atomic_dec_uchar)
161         SET_SIZE(atomic_dec_8)
162
163         ENTRY(atomic_dec_16)
164         ALTENTRY(atomic_dec_ushort)
165         movl    4(%esp), %eax
166         lock
167         decw    (%eax)
168         ret
169         SET_SIZE(atomic_dec_ushort)
170         SET_SIZE(atomic_dec_16)
171
172         ENTRY(atomic_dec_32)
173         ALTENTRY(atomic_dec_uint)
174         ALTENTRY(atomic_dec_ulong)
175         movl    4(%esp), %eax
176         lock
177         decl    (%eax)
178         ret
179         SET_SIZE(atomic_dec_ulong)
180         SET_SIZE(atomic_dec_uint)
181         SET_SIZE(atomic_dec_32)
182
183         ENTRY(atomic_dec_8_nv)
184         ALTENTRY(atomic_dec_uchar_nv)
185         movl    4(%esp), %edx
186         movb    (%edx), %al
187 1:
188         leal    -1(%eax), %ecx
189         lock
190         cmpxchgb %cl, (%edx)
191         jne     1b
192         movzbl  %cl, %eax
193         ret
194         SET_SIZE(atomic_dec_uchar_nv)
195         SET_SIZE(atomic_dec_8_nv)
196
197         ENTRY(atomic_dec_16_nv)
198         ALTENTRY(atomic_dec_ushort_nv)
199         movl    4(%esp), %edx
200         movw    (%edx), %ax
201 1:
202         leal    -1(%eax), %ecx
203         lock
204         cmpxchgw %cx, (%edx)
205         jne     1b
206         movzwl  %cx, %eax
207         ret
208         SET_SIZE(atomic_dec_ushort_nv)
209         SET_SIZE(atomic_dec_16_nv)
210
211         ENTRY(atomic_dec_32_nv)
212         ALTENTRY(atomic_dec_uint_nv)
213         ALTENTRY(atomic_dec_ulong_nv)
214         movl    4(%esp), %edx
215         movl    (%edx), %eax
216 1:
217         leal    -1(%eax), %ecx
218         lock
219         cmpxchgl %ecx, (%edx)
220         jne     1b
221         movl    %ecx, %eax
222         ret
223         SET_SIZE(atomic_dec_ulong_nv)
224         SET_SIZE(atomic_dec_uint_nv)
225         SET_SIZE(atomic_dec_32_nv)
226
227         /*
228          * NOTE: If atomic_dec_64 and atomic_dec_64_nv are ever
229          * separated, it is important to edit the libc i386 platform
230          * specific mapfile and remove the NODYNSORT attribute
231          * from atomic_dec_64_nv.
232          */
233         ENTRY(atomic_dec_64)
234         ALTENTRY(atomic_dec_64_nv)
235         pushl   %edi
236         pushl   %ebx
237         movl    12(%esp), %edi
238         movl    (%edi), %eax
239         movl    4(%edi), %edx
240 1:
241         xorl    %ebx, %ebx
242         xorl    %ecx, %ecx
243         not     %ecx
244         not     %ebx
245         addl    %eax, %ebx
246         adcl    %edx, %ecx
247         lock
248         cmpxchg8b (%edi)
249         jne     1b
250         movl    %ebx, %eax
251         movl    %ecx, %edx
252         popl    %ebx
253         popl    %edi
254         ret
255         SET_SIZE(atomic_dec_64_nv)
256         SET_SIZE(atomic_dec_64)
257
258         ENTRY(atomic_add_8)
259         ALTENTRY(atomic_add_char)
260         movl    4(%esp), %eax
261         movl    8(%esp), %ecx
262         lock
263         addb    %cl, (%eax)
264         ret
265         SET_SIZE(atomic_add_char)
266         SET_SIZE(atomic_add_8)
267
268         ENTRY(atomic_add_16)
269         ALTENTRY(atomic_add_short)
270         movl    4(%esp), %eax
271         movl    8(%esp), %ecx
272         lock
273         addw    %cx, (%eax)
274         ret
275         SET_SIZE(atomic_add_short)
276         SET_SIZE(atomic_add_16)
277
278         ENTRY(atomic_add_32)
279         ALTENTRY(atomic_add_int)
280         ALTENTRY(atomic_add_ptr)
281         ALTENTRY(atomic_add_long)
282         movl    4(%esp), %eax
283         movl    8(%esp), %ecx
284         lock
285         addl    %ecx, (%eax)
286         ret
287         SET_SIZE(atomic_add_long)
288         SET_SIZE(atomic_add_ptr)
289         SET_SIZE(atomic_add_int)
290         SET_SIZE(atomic_add_32)
291
292         ENTRY(atomic_or_8)
293         ALTENTRY(atomic_or_uchar)
294         movl    4(%esp), %eax
295         movb    8(%esp), %cl
296         lock
297         orb     %cl, (%eax)
298         ret
299         SET_SIZE(atomic_or_uchar)
300         SET_SIZE(atomic_or_8)
301
302         ENTRY(atomic_or_16)
303         ALTENTRY(atomic_or_ushort)
304         movl    4(%esp), %eax
305         movw    8(%esp), %cx
306         lock
307         orw     %cx, (%eax)
308         ret
309         SET_SIZE(atomic_or_ushort)
310         SET_SIZE(atomic_or_16)
311
312         ENTRY(atomic_or_32)
313         ALTENTRY(atomic_or_uint)
314         ALTENTRY(atomic_or_ulong)
315         movl    4(%esp), %eax
316         movl    8(%esp), %ecx
317         lock
318         orl     %ecx, (%eax)
319         ret
320         SET_SIZE(atomic_or_ulong)
321         SET_SIZE(atomic_or_uint)
322         SET_SIZE(atomic_or_32)
323
324         ENTRY(atomic_and_8)
325         ALTENTRY(atomic_and_uchar)
326         movl    4(%esp), %eax
327         movb    8(%esp), %cl
328         lock
329         andb    %cl, (%eax)
330         ret
331         SET_SIZE(atomic_and_uchar)
332         SET_SIZE(atomic_and_8)
333
334         ENTRY(atomic_and_16)
335         ALTENTRY(atomic_and_ushort)
336         movl    4(%esp), %eax
337         movw    8(%esp), %cx
338         lock
339         andw    %cx, (%eax)
340         ret
341         SET_SIZE(atomic_and_ushort)
342         SET_SIZE(atomic_and_16)
343
344         ENTRY(atomic_and_32)
345         ALTENTRY(atomic_and_uint)
346         ALTENTRY(atomic_and_ulong)
347         movl    4(%esp), %eax
348         movl    8(%esp), %ecx
349         lock
350         andl    %ecx, (%eax)
351         ret
352         SET_SIZE(atomic_and_ulong)
353         SET_SIZE(atomic_and_uint)
354         SET_SIZE(atomic_and_32)
355
356         ENTRY(atomic_add_8_nv)
357         ALTENTRY(atomic_add_char_nv)
358         movl    4(%esp), %edx
359         movb    (%edx), %al
360 1:
361         movl    8(%esp), %ecx
362         addb    %al, %cl
363         lock
364         cmpxchgb %cl, (%edx)
365         jne     1b
366         movzbl  %cl, %eax
367         ret
368         SET_SIZE(atomic_add_char_nv)
369         SET_SIZE(atomic_add_8_nv)
370
371         ENTRY(atomic_add_16_nv)
372         ALTENTRY(atomic_add_short_nv)
373         movl    4(%esp), %edx
374         movw    (%edx), %ax
375 1:
376         movl    8(%esp), %ecx
377         addw    %ax, %cx
378         lock
379         cmpxchgw %cx, (%edx)
380         jne     1b
381         movzwl  %cx, %eax
382         ret
383         SET_SIZE(atomic_add_short_nv)
384         SET_SIZE(atomic_add_16_nv)
385
386         ENTRY(atomic_add_32_nv)
387         ALTENTRY(atomic_add_int_nv)
388         ALTENTRY(atomic_add_ptr_nv)
389         ALTENTRY(atomic_add_long_nv)
390         movl    4(%esp), %edx
391         movl    (%edx), %eax
392 1:
393         movl    8(%esp), %ecx
394         addl    %eax, %ecx
395         lock
396         cmpxchgl %ecx, (%edx)
397         jne     1b
398         movl    %ecx, %eax
399         ret
400         SET_SIZE(atomic_add_long_nv)
401         SET_SIZE(atomic_add_ptr_nv)
402         SET_SIZE(atomic_add_int_nv)
403         SET_SIZE(atomic_add_32_nv)
404
405         /*
406          * NOTE: If atomic_add_64 and atomic_add_64_nv are ever
407          * separated, it is important to edit the libc i386 platform
408          * specific mapfile and remove the NODYNSORT attribute
409          * from atomic_add_64_nv.
410          */
411         ENTRY(atomic_add_64)
412         ALTENTRY(atomic_add_64_nv)
413         pushl   %edi
414         pushl   %ebx
415         movl    12(%esp), %edi
416         movl    (%edi), %eax
417         movl    4(%edi), %edx
418 1:
419         movl    16(%esp), %ebx
420         movl    20(%esp), %ecx
421         addl    %eax, %ebx
422         adcl    %edx, %ecx
423         lock
424         cmpxchg8b (%edi)
425         jne     1b
426         movl    %ebx, %eax
427         movl    %ecx, %edx
428         popl    %ebx
429         popl    %edi
430         ret
431         SET_SIZE(atomic_add_64_nv)
432         SET_SIZE(atomic_add_64)
433
434         ENTRY(atomic_or_8_nv)
435         ALTENTRY(atomic_or_uchar_nv)
436         movl    4(%esp), %edx
437         movb    (%edx), %al
438 1:
439         movl    8(%esp), %ecx
440         orb     %al, %cl
441         lock
442         cmpxchgb %cl, (%edx)
443         jne     1b
444         movzbl  %cl, %eax
445         ret
446         SET_SIZE(atomic_or_uchar_nv)
447         SET_SIZE(atomic_or_8_nv)
448
449         ENTRY(atomic_or_16_nv)
450         ALTENTRY(atomic_or_ushort_nv)
451         movl    4(%esp), %edx
452         movw    (%edx), %ax
453 1:
454         movl    8(%esp), %ecx
455         orw     %ax, %cx
456         lock
457         cmpxchgw %cx, (%edx)
458         jne     1b
459         movzwl  %cx, %eax
460         ret
461         SET_SIZE(atomic_or_ushort_nv)
462         SET_SIZE(atomic_or_16_nv)
463
464         ENTRY(atomic_or_32_nv)
465         ALTENTRY(atomic_or_uint_nv)
466         ALTENTRY(atomic_or_ulong_nv)
467         movl    4(%esp), %edx
468         movl    (%edx), %eax
469 1:
470         movl    8(%esp), %ecx
471         orl     %eax, %ecx
472         lock
473         cmpxchgl %ecx, (%edx)
474         jne     1b
475         movl    %ecx, %eax
476         ret
477         SET_SIZE(atomic_or_ulong_nv)
478         SET_SIZE(atomic_or_uint_nv)
479         SET_SIZE(atomic_or_32_nv)
480
481         /*
482          * NOTE: If atomic_or_64 and atomic_or_64_nv are ever
483          * separated, it is important to edit the libc i386 platform
484          * specific mapfile and remove the NODYNSORT attribute
485          * from atomic_or_64_nv.
486          */
487         ENTRY(atomic_or_64)
488         ALTENTRY(atomic_or_64_nv)
489         pushl   %edi
490         pushl   %ebx
491         movl    12(%esp), %edi
492         movl    (%edi), %eax
493         movl    4(%edi), %edx
494 1:
495         movl    16(%esp), %ebx
496         movl    20(%esp), %ecx
497         orl     %eax, %ebx
498         orl     %edx, %ecx
499         lock
500         cmpxchg8b (%edi)
501         jne     1b
502         movl    %ebx, %eax
503         movl    %ecx, %edx
504         popl    %ebx
505         popl    %edi
506         ret
507         SET_SIZE(atomic_or_64_nv)
508         SET_SIZE(atomic_or_64)
509
510         ENTRY(atomic_and_8_nv)
511         ALTENTRY(atomic_and_uchar_nv)
512         movl    4(%esp), %edx
513         movb    (%edx), %al
514 1:
515         movl    8(%esp), %ecx
516         andb    %al, %cl
517         lock
518         cmpxchgb %cl, (%edx)
519         jne     1b
520         movzbl  %cl, %eax
521         ret
522         SET_SIZE(atomic_and_uchar_nv)
523         SET_SIZE(atomic_and_8_nv)
524
525         ENTRY(atomic_and_16_nv)
526         ALTENTRY(atomic_and_ushort_nv)
527         movl    4(%esp), %edx
528         movw    (%edx), %ax
529 1:
530         movl    8(%esp), %ecx
531         andw    %ax, %cx
532         lock
533         cmpxchgw %cx, (%edx)
534         jne     1b
535         movzwl  %cx, %eax
536         ret
537         SET_SIZE(atomic_and_ushort_nv)
538         SET_SIZE(atomic_and_16_nv)
539
540         ENTRY(atomic_and_32_nv)
541         ALTENTRY(atomic_and_uint_nv)
542         ALTENTRY(atomic_and_ulong_nv)
543         movl    4(%esp), %edx
544         movl    (%edx), %eax
545 1:
546         movl    8(%esp), %ecx
547         andl    %eax, %ecx
548         lock
549         cmpxchgl %ecx, (%edx)
550         jne     1b
551         movl    %ecx, %eax
552         ret
553         SET_SIZE(atomic_and_ulong_nv)
554         SET_SIZE(atomic_and_uint_nv)
555         SET_SIZE(atomic_and_32_nv)
556
557         /*
558          * NOTE: If atomic_and_64 and atomic_and_64_nv are ever
559          * separated, it is important to edit the libc i386 platform
560          * specific mapfile and remove the NODYNSORT attribute
561          * from atomic_and_64_nv.
562          */
563         ENTRY(atomic_and_64)
564         ALTENTRY(atomic_and_64_nv)
565         pushl   %edi
566         pushl   %ebx
567         movl    12(%esp), %edi
568         movl    (%edi), %eax
569         movl    4(%edi), %edx
570 1:
571         movl    16(%esp), %ebx
572         movl    20(%esp), %ecx
573         andl    %eax, %ebx
574         andl    %edx, %ecx
575         lock
576         cmpxchg8b (%edi)
577         jne     1b
578         movl    %ebx, %eax
579         movl    %ecx, %edx
580         popl    %ebx
581         popl    %edi
582         ret
583         SET_SIZE(atomic_and_64_nv)
584         SET_SIZE(atomic_and_64)
585
586         ENTRY(atomic_cas_8)
587         ALTENTRY(atomic_cas_uchar)
588         movl    4(%esp), %edx
589         movzbl  8(%esp), %eax
590         movb    12(%esp), %cl
591         lock
592         cmpxchgb %cl, (%edx)
593         ret
594         SET_SIZE(atomic_cas_uchar)
595         SET_SIZE(atomic_cas_8)
596
597         ENTRY(atomic_cas_16)
598         ALTENTRY(atomic_cas_ushort)
599         movl    4(%esp), %edx
600         movzwl  8(%esp), %eax
601         movw    12(%esp), %cx
602         lock
603         cmpxchgw %cx, (%edx)
604         ret
605         SET_SIZE(atomic_cas_ushort)
606         SET_SIZE(atomic_cas_16)
607
608         ENTRY(atomic_cas_32)
609         ALTENTRY(atomic_cas_uint)
610         ALTENTRY(atomic_cas_ulong)
611         ALTENTRY(atomic_cas_ptr)
612         movl    4(%esp), %edx
613         movl    8(%esp), %eax
614         movl    12(%esp), %ecx
615         lock
616         cmpxchgl %ecx, (%edx)
617         ret
618         SET_SIZE(atomic_cas_ptr)
619         SET_SIZE(atomic_cas_ulong)
620         SET_SIZE(atomic_cas_uint)
621         SET_SIZE(atomic_cas_32)
622
623         ENTRY(atomic_cas_64)
624         pushl   %ebx
625         pushl   %esi
626         movl    12(%esp), %esi
627         movl    16(%esp), %eax
628         movl    20(%esp), %edx
629         movl    24(%esp), %ebx
630         movl    28(%esp), %ecx
631         lock
632         cmpxchg8b (%esi)
633         popl    %esi
634         popl    %ebx
635         ret
636         SET_SIZE(atomic_cas_64)
637
638         ENTRY(atomic_swap_8)
639         ALTENTRY(atomic_swap_uchar)
640         movl    4(%esp), %edx
641         movzbl  8(%esp), %eax
642         lock
643         xchgb   %al, (%edx)
644         ret
645         SET_SIZE(atomic_swap_uchar)
646         SET_SIZE(atomic_swap_8)
647
648         ENTRY(atomic_swap_16)
649         ALTENTRY(atomic_swap_ushort)
650         movl    4(%esp), %edx
651         movzwl  8(%esp), %eax
652         lock
653         xchgw   %ax, (%edx)
654         ret
655         SET_SIZE(atomic_swap_ushort)
656         SET_SIZE(atomic_swap_16)
657
658         ENTRY(atomic_swap_32)
659         ALTENTRY(atomic_swap_uint)
660         ALTENTRY(atomic_swap_ptr)
661         ALTENTRY(atomic_swap_ulong)
662         movl    4(%esp), %edx
663         movl    8(%esp), %eax
664         lock
665         xchgl   %eax, (%edx)
666         ret
667         SET_SIZE(atomic_swap_ulong)
668         SET_SIZE(atomic_swap_ptr)
669         SET_SIZE(atomic_swap_uint)
670         SET_SIZE(atomic_swap_32)
671
672         ENTRY(atomic_swap_64)
673         pushl   %esi
674         pushl   %ebx
675         movl    12(%esp), %esi
676         movl    16(%esp), %ebx
677         movl    20(%esp), %ecx
678         movl    (%esi), %eax
679         movl    4(%esi), %edx
680 1:
681         lock
682         cmpxchg8b (%esi)
683         jne     1b
684         popl    %ebx
685         popl    %esi
686         ret
687         SET_SIZE(atomic_swap_64)
688
689         ENTRY(atomic_set_long_excl)
690         movl    4(%esp), %edx
691         movl    8(%esp), %ecx
692         xorl    %eax, %eax
693         lock
694         btsl    %ecx, (%edx)
695         jnc     1f
696         decl    %eax
697 1:
698         ret
699         SET_SIZE(atomic_set_long_excl)
700
701         ENTRY(atomic_clear_long_excl)
702         movl    4(%esp), %edx
703         movl    8(%esp), %ecx
704         xorl    %eax, %eax
705         lock
706         btrl    %ecx, (%edx)
707         jc      1f
708         decl    %eax
709 1:
710         ret
711         SET_SIZE(atomic_clear_long_excl)
712
713 #if !defined(_KERNEL)
714
715         /*
716          * NOTE: membar_enter, membar_exit, membar_producer, and 
717          * membar_consumer are all identical routines. We define them
718          * separately, instead of using ALTENTRY definitions to alias them
719          * together, so that DTrace and debuggers will see a unique address
720          * for them, allowing more accurate tracing.
721         */
722
723
724         ENTRY(membar_enter)
725         lock
726         xorl    $0, (%esp)
727         ret
728         SET_SIZE(membar_enter)
729
730         ENTRY(membar_exit)
731         lock
732         xorl    $0, (%esp)
733         ret
734         SET_SIZE(membar_exit)
735
736         ENTRY(membar_producer)
737         lock
738         xorl    $0, (%esp)
739         ret
740         SET_SIZE(membar_producer)
741
742         ENTRY(membar_consumer)
743         lock
744         xorl    $0, (%esp)
745         ret
746         SET_SIZE(membar_consumer)
747
748 #endif  /* !_KERNEL */
749
750 #ifdef __ELF__
751 .section .note.GNU-stack,"",%progbits
752 #endif