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_ADJUST_CFA_OFFSET 4
19 CFI_REL_OFFSET \reg, 0
24 CFI_ADJUST_CFA_OFFSET -4
31 /* we need LOCK_PREFIX since otherwise cmpxchg8b always does the write */
36 ENTRY(atomic64_read_cx8)
42 ENDPROC(atomic64_read_cx8)
44 ENTRY(atomic64_set_cx8)
48 /* we don't need LOCK_PREFIX since aligned 64-bit writes
49 * are atomic on 586 and newer */
55 ENDPROC(atomic64_set_cx8)
57 ENTRY(atomic64_xchg_cx8)
69 ENDPROC(atomic64_xchg_cx8)
71 .macro addsub_return func ins insc
72 ENTRY(atomic64_\func\()_return_cx8)
102 ENDPROC(atomic64_\func\()_return_cx8)
105 addsub_return add add adc
106 addsub_return sub sub sbb
108 .macro incdec_return func ins insc
109 ENTRY(atomic64_\func\()_return_cx8)
129 ENDPROC(atomic64_\func\()_return_cx8)
132 incdec_return inc add adc
133 incdec_return dec sub sbb
135 ENTRY(atomic64_dec_if_positive_cx8)
156 ENDPROC(atomic64_dec_if_positive_cx8)
158 ENTRY(atomic64_add_unless_cx8)
162 /* these just push these two parameters on the stack */
186 CFI_ADJUST_CFA_OFFSET -8
196 ENDPROC(atomic64_add_unless_cx8)
198 ENTRY(atomic64_inc_not_zero_cx8)
224 ENDPROC(atomic64_inc_not_zero_cx8)