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>
18 /* we need LOCK_PREFIX since otherwise cmpxchg8b always does the write */
23 ENTRY(atomic64_read_cx8)
26 ENDPROC(atomic64_read_cx8)
28 ENTRY(atomic64_set_cx8)
30 /* we don't need LOCK_PREFIX since aligned 64-bit writes
31 * are atomic on 586 and newer */
36 ENDPROC(atomic64_set_cx8)
38 ENTRY(atomic64_xchg_cx8)
45 ENDPROC(atomic64_xchg_cx8)
47 .macro addsub_return func ins insc
48 ENTRY(atomic64_\func\()_return_cx8)
76 ENDPROC(atomic64_\func\()_return_cx8)
79 addsub_return add add adc
80 addsub_return sub sub sbb
82 .macro incdec_return func ins insc
83 ENTRY(atomic64_\func\()_return_cx8)
101 ENDPROC(atomic64_\func\()_return_cx8)
104 incdec_return inc add adc
105 incdec_return dec sub sbb
107 ENTRY(atomic64_dec_if_positive_cx8)
126 ENDPROC(atomic64_dec_if_positive_cx8)
128 ENTRY(atomic64_add_unless_cx8)
131 /* these just push these two parameters on the stack */
162 ENDPROC(atomic64_add_unless_cx8)
164 ENTRY(atomic64_inc_not_zero_cx8)
184 ENDPROC(atomic64_inc_not_zero_cx8)