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>
18 CFI_REL_OFFSET \reg, 0
29 /* we need LOCK_PREFIX since otherwise cmpxchg8b always does the write */
34 ENTRY(atomic64_read_cx8)
40 ENDPROC(atomic64_read_cx8)
42 ENTRY(atomic64_set_cx8)
46 /* we don't need LOCK_PREFIX since aligned 64-bit writes
47 * are atomic on 586 and newer */
53 ENDPROC(atomic64_set_cx8)
55 ENTRY(atomic64_xchg_cx8)
65 ENDPROC(atomic64_xchg_cx8)
67 .macro addsub_return func ins insc
68 ENTRY(atomic64_\func\()_return_cx8)
98 ENDPROC(atomic64_\func\()_return_cx8)
101 addsub_return add add adc
102 addsub_return sub sub sbb
104 .macro incdec_return func ins insc
105 ENTRY(atomic64_\func\()_return_cx8)
125 ENDPROC(atomic64_\func\()_return_cx8)
128 incdec_return inc add adc
129 incdec_return dec sub sbb
131 ENTRY(atomic64_dec_if_positive_cx8)
152 ENDPROC(atomic64_dec_if_positive_cx8)
154 ENTRY(atomic64_add_unless_cx8)
158 /* these just push these two parameters on the stack */
181 CFI_ADJUST_CFA_OFFSET -8
191 ENDPROC(atomic64_add_unless_cx8)
193 ENTRY(atomic64_inc_not_zero_cx8)
215 ENDPROC(atomic64_inc_not_zero_cx8)