aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-04-20 19:57:35 -0400
committerH. Peter Anvin <hpa@zytor.com>2012-04-20 19:57:35 -0400
commit535c0c34698061544f81a51c65fc51f4eeeebff6 (patch)
tree76f4ad3784af2be36407f5da28b8d1adb77b105a
parenta3e859fed1244b72253718e076a724ffe13a9584 (diff)
x86, extable: Add _ASM_EXTABLE_EX() macro
Add _ASM_EXTABLE_EX() to generate the special extable entries that are associated with uaccess_err. This allows us to change the protocol associated with these special entries. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: David Daney <david.daney@cavium.com> Link: http://lkml.kernel.org/r/CA%2B55aFyijf43qSu3N9nWHEBwaGbb7T2Oq9A=9EyR=Jtyqfq_cQ@mail.gmail.com
-rw-r--r--arch/x86/include/asm/asm.h28
-rw-r--r--arch/x86/include/asm/uaccess.h8
2 files changed, 24 insertions, 12 deletions
diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
index 53dce41f2517..0f15e8a4f565 100644
--- a/arch/x86/include/asm/asm.h
+++ b/arch/x86/include/asm/asm.h
@@ -40,16 +40,28 @@
40 40
41/* Exception table entry */ 41/* Exception table entry */
42#ifdef __ASSEMBLY__ 42#ifdef __ASSEMBLY__
43# define _ASM_EXTABLE(from,to) \ 43# define _ASM_EXTABLE(from,to) \
44 .pushsection "__ex_table","a" ; \ 44 .pushsection "__ex_table","a" ; \
45 _ASM_ALIGN ; \ 45 _ASM_ALIGN ; \
46 _ASM_PTR from , to ; \ 46 _ASM_PTR from , to ; \
47 .popsection
48
49# define _ASM_EXTABLE_EX(from,to) \
50 .pushsection "__ex_table","a" ; \
51 _ASM_ALIGN ; \
52 _ASM_PTR from , (to) - (from) ; \
47 .popsection 53 .popsection
48#else 54#else
49# define _ASM_EXTABLE(from,to) \ 55# define _ASM_EXTABLE(from,to) \
50 " .pushsection \"__ex_table\",\"a\"\n" \ 56 " .pushsection \"__ex_table\",\"a\"\n" \
51 _ASM_ALIGN "\n" \ 57 _ASM_ALIGN "\n" \
52 _ASM_PTR #from "," #to "\n" \ 58 _ASM_PTR #from "," #to "\n" \
59 " .popsection\n"
60
61# define _ASM_EXTABLE_EX(from,to) \
62 " .pushsection \"__ex_table\",\"a\"\n" \
63 _ASM_ALIGN "\n" \
64 _ASM_PTR #from ",(" #to ")-(" #from ")\n" \
53 " .popsection\n" 65 " .popsection\n"
54#endif 66#endif
55 67
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index e0544597cfe7..4ee59dd66f5d 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -202,8 +202,8 @@ extern int __get_user_bad(void);
202 asm volatile("1: movl %%eax,0(%1)\n" \ 202 asm volatile("1: movl %%eax,0(%1)\n" \
203 "2: movl %%edx,4(%1)\n" \ 203 "2: movl %%edx,4(%1)\n" \
204 "3:\n" \ 204 "3:\n" \
205 _ASM_EXTABLE(1b, 2b - 1b) \ 205 _ASM_EXTABLE_EX(1b, 2b) \
206 _ASM_EXTABLE(2b, 3b - 2b) \ 206 _ASM_EXTABLE_EX(2b, 3b) \
207 : : "A" (x), "r" (addr)) 207 : : "A" (x), "r" (addr))
208 208
209#define __put_user_x8(x, ptr, __ret_pu) \ 209#define __put_user_x8(x, ptr, __ret_pu) \
@@ -408,7 +408,7 @@ do { \
408#define __get_user_asm_ex(x, addr, itype, rtype, ltype) \ 408#define __get_user_asm_ex(x, addr, itype, rtype, ltype) \
409 asm volatile("1: mov"itype" %1,%"rtype"0\n" \ 409 asm volatile("1: mov"itype" %1,%"rtype"0\n" \
410 "2:\n" \ 410 "2:\n" \
411 _ASM_EXTABLE(1b, 2b - 1b) \ 411 _ASM_EXTABLE_EX(1b, 2b) \
412 : ltype(x) : "m" (__m(addr))) 412 : ltype(x) : "m" (__m(addr)))
413 413
414#define __put_user_nocheck(x, ptr, size) \ 414#define __put_user_nocheck(x, ptr, size) \
@@ -450,7 +450,7 @@ struct __large_struct { unsigned long buf[100]; };
450#define __put_user_asm_ex(x, addr, itype, rtype, ltype) \ 450#define __put_user_asm_ex(x, addr, itype, rtype, ltype) \
451 asm volatile("1: mov"itype" %"rtype"0,%1\n" \ 451 asm volatile("1: mov"itype" %"rtype"0,%1\n" \
452 "2:\n" \ 452 "2:\n" \
453 _ASM_EXTABLE(1b, 2b - 1b) \ 453 _ASM_EXTABLE_EX(1b, 2b) \
454 : : ltype(x), "m" (__m(addr))) 454 : : ltype(x), "m" (__m(addr)))
455 455
456/* 456/*