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)
67 ENDPROC(atomic64_xchg_cx8)
69 .macro addsub_return func ins insc
70 ENTRY(atomic64_\func\()_return_cx8)
100 ENDPROC(atomic64_\func\()_return_cx8)
103 addsub_return add add adc
104 addsub_return sub sub sbb
106 .macro incdec_return func ins insc
107 ENTRY(atomic64_\func\()_return_cx8)
127 ENDPROC(atomic64_\func\()_return_cx8)
130 incdec_return inc add adc
131 incdec_return dec sub sbb
133 ENTRY(atomic64_dec_if_positive_cx8)
154 ENDPROC(atomic64_dec_if_positive_cx8)
156 ENTRY(atomic64_add_unless_cx8)
160 /* these just push these two parameters on the stack */
184 CFI_ADJUST_CFA_OFFSET -8
194 ENDPROC(atomic64_add_unless_cx8)
196 ENTRY(atomic64_inc_not_zero_cx8)
222 ENDPROC(atomic64_inc_not_zero_cx8)