4 * Copyright © 2010 Luca Barbieri
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.
12 #include <linux/linkage.h>
13 #include <asm/alternative-asm.h>
14 #include <asm/dwarf2.h>
19 /* we need LOCK_PREFIX since otherwise cmpxchg8b always does the write */
24 ENTRY(atomic64_read_cx8)
30 ENDPROC(atomic64_read_cx8)
32 ENTRY(atomic64_set_cx8)
36 /* we don't need LOCK_PREFIX since aligned 64-bit writes
37 * are atomic on 586 and newer */
43 ENDPROC(atomic64_set_cx8)
45 ENTRY(atomic64_xchg_cx8)
55 ENDPROC(atomic64_xchg_cx8)
57 .macro addsub_return func ins insc
58 ENTRY(atomic64_\func\()_return_cx8)
88 ENDPROC(atomic64_\func\()_return_cx8)
91 addsub_return add add adc
92 addsub_return sub sub sbb
94 .macro incdec_return func ins insc
95 ENTRY(atomic64_\func\()_return_cx8)
115 ENDPROC(atomic64_\func\()_return_cx8)
118 incdec_return inc add adc
119 incdec_return dec sub sbb
121 ENTRY(atomic64_dec_if_positive_cx8)
142 ENDPROC(atomic64_dec_if_positive_cx8)
144 ENTRY(atomic64_add_unless_cx8)
148 /* these just push these two parameters on the stack */
171 CFI_ADJUST_CFA_OFFSET -8
181 ENDPROC(atomic64_add_unless_cx8)
183 ENTRY(atomic64_inc_not_zero_cx8)
205 ENDPROC(atomic64_inc_not_zero_cx8)