Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: fusl/arch/mips/atomic_arch.h

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #define a_ll a_ll 1 #define a_ll a_ll
2 static inline int a_ll(volatile int *p) 2 static inline int a_ll(volatile int* p) {
3 { 3 int v;
4 » int v; 4 __asm__ __volatile__(
5 » __asm__ __volatile__ ( 5 ".set push ; .set mips2\n\t"
6 » » ".set push ; .set mips2\n\t" 6 "ll %0, %1"
7 » » "ll %0, %1" 7 "\n\t.set pop"
8 » » "\n\t.set pop" 8 : "=r"(v)
9 » » : "=r"(v) : "m"(*p)); 9 : "m"(*p));
10 » return v; 10 return v;
11 } 11 }
12 12
13 #define a_sc a_sc 13 #define a_sc a_sc
14 static inline int a_sc(volatile int *p, int v) 14 static inline int a_sc(volatile int* p, int v) {
15 { 15 int r;
16 » int r; 16 __asm__ __volatile__(
17 » __asm__ __volatile__ ( 17 ".set push ; .set mips2\n\t"
18 » » ".set push ; .set mips2\n\t" 18 "sc %0, %1"
19 » » "sc %0, %1" 19 "\n\t.set pop"
20 » » "\n\t.set pop" 20 : "=r"(r), "=m"(*p)
21 » » : "=r"(r), "=m"(*p) : "0"(v) : "memory"); 21 : "0"(v)
22 » return r; 22 : "memory");
23 return r;
23 } 24 }
24 25
25 #define a_barrier a_barrier 26 #define a_barrier a_barrier
26 static inline void a_barrier() 27 static inline void a_barrier() {
27 { 28 /* mips2 sync, but using too many directives causes
28 » /* mips2 sync, but using too many directives causes 29 * gcc not to inline it, so encode with .long instead. */
29 » * gcc not to inline it, so encode with .long instead. */ 30 __asm__ __volatile__(".long 0xf" : : : "memory");
30 » __asm__ __volatile__ (".long 0xf" : : : "memory");
31 #if 0 31 #if 0
32 __asm__ __volatile__ ( 32 __asm__ __volatile__ (
33 ".set push ; .set mips2 ; sync ; .set pop" 33 ".set push ; .set mips2 ; sync ; .set pop"
34 : : : "memory"); 34 : : : "memory");
35 #endif 35 #endif
36 } 36 }
37 37
38 #define a_pre_llsc a_barrier 38 #define a_pre_llsc a_barrier
39 #define a_post_llsc a_barrier 39 #define a_post_llsc a_barrier
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698