~ubuntu-branches/ubuntu/vivid/musl/vivid

« back to all changes in this revision

Viewing changes to arch/microblaze/atomic.h

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2014-05-26 22:45:52 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20140526224552-qrtsct934q29xo0x
Tags: 1.1.4-1
* Import upstream version 1.1.4. (Closes: #754758)
* Fixes possible stack-based buffer overflow CVE-2014-3484 (Closes: #750815) 
* Includes fix for build regression on armhf and armel

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
        return a_ctz_l(y);
23
23
}
24
24
 
25
 
static inline int a_cas_1(volatile int *p, int t, int s)
26
 
{
27
 
        register int tmp;
28
 
        do {
29
 
                __asm__ __volatile__ ("lwx %0, %1, r0"
30
 
                        : "=r"(tmp) : "r"(p) : "memory");
31
 
                if (tmp != t) return tmp;
32
 
                __asm__ __volatile__ ("swx %2, %1, r0 ; addic %0, r0, 0"
33
 
                        : "=r"(tmp) : "r"(p), "r"(s) : "cc", "memory");
34
 
        } while (tmp);
35
 
        return t;
36
 
}
37
 
 
38
25
static inline int a_cas(volatile int *p, int t, int s)
39
26
{
40
27
        register int old, tmp;
58
45
        return (void *)a_cas(p, (int)t, (int)s);
59
46
}
60
47
 
61
 
static inline long a_cas_l(volatile void *p, long t, long s)
62
 
{
63
 
        return a_cas(p, t, s);
64
 
}
65
 
 
66
48
static inline int a_swap(volatile int *x, int v)
67
49
{
68
50
        register int old, tmp;
108
90
 
109
91
static inline void a_store(volatile int *p, int x)
110
92
{
111
 
        *p=x;
 
93
        __asm__ __volatile__ (
 
94
                "swi %1, %0"
 
95
                : "=m"(*p) : "r"(x) : "memory" );
112
96
}
113
97
 
114
98
static inline void a_spin()