hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/arch/x86/lib/atomic64_cx8_32.S
....@@ -1,16 +1,12 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * atomic64_t for 586+
34 *
45 * Copyright © 2010 Luca Barbieri
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
106 */
117
128 #include <linux/linkage.h>
13
-#include <asm/alternative-asm.h>
9
+#include <asm/alternative.h>
1410
1511 .macro read64 reg
1612 movl %ebx, %eax
....@@ -20,32 +16,32 @@
2016 cmpxchg8b (\reg)
2117 .endm
2218
23
-ENTRY(atomic64_read_cx8)
19
+SYM_FUNC_START(atomic64_read_cx8)
2420 read64 %ecx
25
- ret
26
-ENDPROC(atomic64_read_cx8)
21
+ RET
22
+SYM_FUNC_END(atomic64_read_cx8)
2723
28
-ENTRY(atomic64_set_cx8)
24
+SYM_FUNC_START(atomic64_set_cx8)
2925 1:
3026 /* we don't need LOCK_PREFIX since aligned 64-bit writes
3127 * are atomic on 586 and newer */
3228 cmpxchg8b (%esi)
3329 jne 1b
3430
35
- ret
36
-ENDPROC(atomic64_set_cx8)
31
+ RET
32
+SYM_FUNC_END(atomic64_set_cx8)
3733
38
-ENTRY(atomic64_xchg_cx8)
34
+SYM_FUNC_START(atomic64_xchg_cx8)
3935 1:
4036 LOCK_PREFIX
4137 cmpxchg8b (%esi)
4238 jne 1b
4339
44
- ret
45
-ENDPROC(atomic64_xchg_cx8)
40
+ RET
41
+SYM_FUNC_END(atomic64_xchg_cx8)
4642
4743 .macro addsub_return func ins insc
48
-ENTRY(atomic64_\func\()_return_cx8)
44
+SYM_FUNC_START(atomic64_\func\()_return_cx8)
4945 pushl %ebp
5046 pushl %ebx
5147 pushl %esi
....@@ -72,15 +68,15 @@
7268 popl %esi
7369 popl %ebx
7470 popl %ebp
75
- ret
76
-ENDPROC(atomic64_\func\()_return_cx8)
71
+ RET
72
+SYM_FUNC_END(atomic64_\func\()_return_cx8)
7773 .endm
7874
7975 addsub_return add add adc
8076 addsub_return sub sub sbb
8177
8278 .macro incdec_return func ins insc
83
-ENTRY(atomic64_\func\()_return_cx8)
79
+SYM_FUNC_START(atomic64_\func\()_return_cx8)
8480 pushl %ebx
8581
8682 read64 %esi
....@@ -97,14 +93,14 @@
9793 movl %ebx, %eax
9894 movl %ecx, %edx
9995 popl %ebx
100
- ret
101
-ENDPROC(atomic64_\func\()_return_cx8)
96
+ RET
97
+SYM_FUNC_END(atomic64_\func\()_return_cx8)
10298 .endm
10399
104100 incdec_return inc add adc
105101 incdec_return dec sub sbb
106102
107
-ENTRY(atomic64_dec_if_positive_cx8)
103
+SYM_FUNC_START(atomic64_dec_if_positive_cx8)
108104 pushl %ebx
109105
110106 read64 %esi
....@@ -122,10 +118,10 @@
122118 movl %ebx, %eax
123119 movl %ecx, %edx
124120 popl %ebx
125
- ret
126
-ENDPROC(atomic64_dec_if_positive_cx8)
121
+ RET
122
+SYM_FUNC_END(atomic64_dec_if_positive_cx8)
127123
128
-ENTRY(atomic64_add_unless_cx8)
124
+SYM_FUNC_START(atomic64_add_unless_cx8)
129125 pushl %ebp
130126 pushl %ebx
131127 /* these just push these two parameters on the stack */
....@@ -153,15 +149,15 @@
153149 addl $8, %esp
154150 popl %ebx
155151 popl %ebp
156
- ret
152
+ RET
157153 4:
158154 cmpl %edx, 4(%esp)
159155 jne 2b
160156 xorl %eax, %eax
161157 jmp 3b
162
-ENDPROC(atomic64_add_unless_cx8)
158
+SYM_FUNC_END(atomic64_add_unless_cx8)
163159
164
-ENTRY(atomic64_inc_not_zero_cx8)
160
+SYM_FUNC_START(atomic64_inc_not_zero_cx8)
165161 pushl %ebx
166162
167163 read64 %esi
....@@ -180,5 +176,5 @@
180176 movl $1, %eax
181177 3:
182178 popl %ebx
183
- ret
184
-ENDPROC(atomic64_inc_not_zero_cx8)
179
+ RET
180
+SYM_FUNC_END(atomic64_inc_not_zero_cx8)