parisc: Use PRIV_USER and PRIV_KERNEL in get_user() and put_user()
Helge Deller
maintainerPATCH 1/1 parisc: Use PRIV_USER and PRIV_KERNEL in get_user() and put_user()
Instead of hardcoding the space registers as strings, use the PRIV_USER and PRIV_KERNEL constants to form the space register in the access functions.
Signed-off-by Helge Deller <[email protected]>
--- arch/parisc/include/asm/uaccess.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
arch/parisc/include/asm/uaccess.h +14 -14
@@ -79,18 +79,18 @@ struct exception_table_entry {#define __get_user (val, ptr) \ ({ \ - __get_user_internal("%%sr3,", val, ptr); \ + __get_user_internal(PRIV_USER, val, ptr); \ })#define __get_user_asm (sr, val, ldx, ptr) \ { \ register long __gu_val; \ \ - __asm__("1: " ldx " 0(" sr "%2),%0\n" \ + __asm__("1: " ldx " 0(%%sr%2,%3),%0\n" \ "9:\n" \ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \ : "=r"(__gu_val), "+r"(__gu_err) \ - : "r"(ptr)); \ + : "i"(sr), "r"(ptr)); \ \ (val) = (__force __typeof__(*(ptr))) __gu_val; \ }
@@ -100,7 +100,7 @@ struct exception_table_entry { { \type __z; \long __err; \ - __err =__get_user_internal ("%%sr0," , __z, (type *)(src)); \ + __err =__get_user_internal (PRIV_KERNEL , __z, (type *)(src)); \if (unlikely (__err)) \ goto err_label; \else \
@@ -118,13 +118,13 @@ struct exception_table_entry { } __gu_tmp; \ \ __asm__(" copy %%r0,%R0\n" \ -"1: ldw 0(" sr"%2),%0\n" \ -"2: ldw 4(" sr"%2),%R0\n" \ +"1: ldw 0(%%sr%2,%3),%0\n" \ +"2: ldw 4(%%sr%2,%3),%R0\n" \"9:\n" \ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \ASM_EXCEPTIONTABLE_ENTRY_EFAULT (2b ,9b ) \ : "=&r"(__gu_tmp.l), "+r"(__gu_err) \ -: " r"(ptr)); \ +: " i"(sr), " r"(ptr)); \ \ (val) = __gu_tmp.t; \ }
@@ -151,14 +151,14 @@ struct exception_table_entry { ({ \ __typeof__(&*(ptr)) __ptr = ptr; \ __typeof__(*(__ptr)) __x = (__typeof__(*(__ptr)))(x); \ -__put_user_internal ("%%sr3," , __x, __ptr); \ +__put_user_internal (PRIV_USER , __x, __ptr); \ })#define __put_kernel_nofault (dst, src, type, err_label) \ { \ type __z = *(type *)(src); \ long __err; \ - __err = __put_user_internal("%%sr0,", __z, (type *)(dst)); \ + __err = __put_user_internal(PRIV_KERNEL, __z, (type *)(dst)); \ if (unlikely(__err)) \ goto err_label; \ }
@@ -178,24 +178,24 @@ struct exception_table_entry {#define __put_user_asm (sr, stx, x, ptr) \ __asm__ __volatile__ ( \ - "1: " stx " %2,0(" sr "%1)\n" \ + "1: " stx " %1,0(%%sr%2,%3)\n" \ "9:\n" \ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \ : "+r"(__pu_err) \ - : "r"(ptr), "r"(x)) + : "r"(x), "i"(sr), "r"(ptr))#if !defined(CONFIG_64BIT )#define __put_user_asm64 (sr, __val, ptr) do { \ __asm__ __volatile__ ( \ - "1: stw %2,0(" sr "%1)\n" \ - "2: stw %R2,4(" sr "%1)\n" \ + "1: stw %1,0(%%sr%2,%3)\n" \ + "2: stw %R1,4(%%sr%2,%3)\n" \ "9:\n" \ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b) \ : "+r"(__pu_err) \ - : "r"(ptr), "r"(__val)); \ + : "r"(__val), "i"(sr), "r"(ptr)); \ } while (0)#endif /* !defined(CONFIG_64BIT) */
--
2.34.1