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

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

Issue 1689833004: [fusl] Update fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: remove stray space 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
« no previous file with comments | « fusl/BUILD.gn ('k') | fusl/arch/aarch64/bits/errno.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
4 int v; 4 int v;
5 __asm__ __volatile__ ("ldaxr %w0,%1" : "=r"(v) : "Q"(*p)); 5 __asm__ __volatile__ ("ldaxr %w0,%1" : "=r"(v) : "Q"(*p));
6 return v; 6 return v;
7 } 7 }
8 8
9 #define a_sc a_sc 9 #define a_sc a_sc
10 static inline int a_sc(volatile int *p, int v) 10 static inline int a_sc(volatile int *p, int v)
11 { 11 {
12 int r; 12 int r;
13 » __asm__ __volatile__ ("stlxr %w0,%w1,%2" : "=&r"(r) : "r"(v), "Q"(*p) : "memory"); 13 » __asm__ __volatile__ ("stlxr %w0,%w2,%1" : "=&r"(r), "=Q"(*p) : "r"(v) : "memory");
14 return !r; 14 return !r;
15 } 15 }
16 16
17 #define a_barrier a_barrier 17 #define a_barrier a_barrier
18 static inline void a_barrier() 18 static inline void a_barrier()
19 { 19 {
20 __asm__ __volatile__ ("dmb ish" : : : "memory"); 20 __asm__ __volatile__ ("dmb ish" : : : "memory");
21 } 21 }
22 22
23 #define a_cas a_cas 23 #define a_cas a_cas
(...skipping 13 matching lines...) Expand all
37 static inline void *a_ll_p(volatile void *p) 37 static inline void *a_ll_p(volatile void *p)
38 { 38 {
39 void *v; 39 void *v;
40 __asm__ __volatile__ ("ldaxr %0, %1" : "=r"(v) : "Q"(*(void *volatile *) p)); 40 __asm__ __volatile__ ("ldaxr %0, %1" : "=r"(v) : "Q"(*(void *volatile *) p));
41 return v; 41 return v;
42 } 42 }
43 43
44 static inline int a_sc_p(volatile int *p, void *v) 44 static inline int a_sc_p(volatile int *p, void *v)
45 { 45 {
46 int r; 46 int r;
47 » __asm__ __volatile__ ("stlxr %w0,%1,%2" : "=&r"(r) : "r"(v), "Q"(*(void *volatile *)p) : "memory"); 47 » __asm__ __volatile__ ("stlxr %w0,%2,%1" : "=&r"(r), "=Q"(*(void *volatil e *)p) : "r"(v) : "memory");
48 return !r; 48 return !r;
49 } 49 }
50 50
51 #define a_cas_p a_cas_p 51 #define a_cas_p a_cas_p
52 static inline void *a_cas_p(volatile void *p, void *t, void *s) 52 static inline void *a_cas_p(volatile void *p, void *t, void *s)
53 { 53 {
54 void *old; 54 void *old;
55 do { 55 do {
56 old = a_ll_p(p); 56 old = a_ll_p(p);
57 if (old != t) { 57 if (old != t) {
58 a_barrier(); 58 a_barrier();
59 break; 59 break;
60 } 60 }
61 } while (!a_sc_p(p, s)); 61 } while (!a_sc_p(p, s));
62 return old; 62 return old;
63 } 63 }
64 64
65 #define a_ctz_64 a_ctz_64 65 #define a_ctz_64 a_ctz_64
66 static inline int a_ctz_64(uint64_t x) 66 static inline int a_ctz_64(uint64_t x)
67 { 67 {
68 __asm__( 68 __asm__(
69 " rbit %0, %1\n" 69 " rbit %0, %1\n"
70 " clz %0, %0\n" 70 " clz %0, %0\n"
71 : "=r"(x) : "r"(x)); 71 : "=r"(x) : "r"(x));
72 return x; 72 return x;
73 } 73 }
OLDNEW
« no previous file with comments | « fusl/BUILD.gn ('k') | fusl/arch/aarch64/bits/errno.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698