History

sparc64: Fix constraints on swab helpers.

We are reading the memory location, so we have to have a memory constraint in there purely for the sake of showing the data flow to the compiler.

David S. Miller committed 12 years ago

Commit 5a2b59d1 parent 1a17fdc1 file · +6 −6Browse files

Unified · Split

arch/sparc/include/uapi/asm/swab.h+6−6
@@ -9,9 +9,9 @@ static inline __u16 __arch_swab16p(const __u16 *addr) · 8 unmodified lines
99 {
1010 __u16 ret;
1111
12− __asm__ __volatile__ ("lduha [%1] %2, %0"
12+ __asm__ __volatile__ ("lduha [%2] %3, %0"
1313 : "=r" (ret)
14− : "r" (addr), "i" (ASI_PL));
14+ : "m" (*addr), "r" (addr), "i" (ASI_PL));
1515 return ret;
1616 }
1717 #define __arch_swab16p __arch_swab16p
@@ -20,9 +20,9 @@ static inline __u32 __arch_swab32p(const __u32 *addr) · 2 unmodified lines
2020 {
2121 __u32 ret;
2222
23− __asm__ __volatile__ ("lduwa [%1] %2, %0"
23+ __asm__ __volatile__ ("lduwa [%2] %3, %0"
2424 : "=r" (ret)
25− : "r" (addr), "i" (ASI_PL));
25+ : "m" (*addr), "r" (addr), "i" (ASI_PL));
2626 return ret;
2727 }
2828 #define __arch_swab32p __arch_swab32p
@@ -31,9 +31,9 @@ static inline __u64 __arch_swab64p(const __u64 *addr) · 2 unmodified lines
3131 {
3232 __u64 ret;
3333
34− __asm__ __volatile__ ("ldxa [%1] %2, %0"
34+ __asm__ __volatile__ ("ldxa [%2] %3, %0"
3535 : "=r" (ret)
36− : "r" (addr), "i" (ASI_PL));
36+ : "m" (*addr), "r" (addr), "i" (ASI_PL));
3737 return ret;
3838 }
3939 #define __arch_swab64p __arch_swab64p