x86/extable: Rework the exception table mechanics
[linux-2.6-microblaze.git] / arch / x86 / include / asm / asm.h
index 719955e..6aadb9a 100644 (file)
 
 #ifdef __KERNEL__
 
+# include <asm/extable_fixup_types.h>
+
 /* Exception table entry */
 #ifdef __ASSEMBLY__
-# define _ASM_EXTABLE_HANDLE(from, to, handler)                        \
+
+# define _ASM_EXTABLE_TYPE(from, to, type)                     \
        .pushsection "__ex_table","a" ;                         \
        .balign 4 ;                                             \
        .long (from) - . ;                                      \
        .long (to) - . ;                                        \
-       .long (handler) - . ;                                   \
+       .long type ;                                            \
        .popsection
 
 # ifdef CONFIG_KPROBES
 # endif
 
 #else /* ! __ASSEMBLY__ */
-# define _EXPAND_EXTABLE_HANDLE(x) #x
-# define _ASM_EXTABLE_HANDLE(from, to, handler)                        \
+
+# define _ASM_EXTABLE_TYPE(from, to, type)                     \
        " .pushsection \"__ex_table\",\"a\"\n"                  \
        " .balign 4\n"                                          \
        " .long (" #from ") - .\n"                              \
        " .long (" #to ") - .\n"                                \
-       " .long (" _EXPAND_EXTABLE_HANDLE(handler) ") - .\n"    \
+       " .long " __stringify(type) " \n"                       \
        " .popsection\n"
 
 /* For C file, we already have NOKPROBE_SYMBOL macro */
@@ -165,17 +168,16 @@ register unsigned long current_stack_pointer asm(_ASM_SP);
 #endif /* __ASSEMBLY__ */
 
 #define _ASM_EXTABLE(from, to)                                 \
-       _ASM_EXTABLE_HANDLE(from, to, ex_handler_default)
+       _ASM_EXTABLE_TYPE(from, to, EX_TYPE_DEFAULT)
 
 #define _ASM_EXTABLE_UA(from, to)                              \
-       _ASM_EXTABLE_HANDLE(from, to, ex_handler_uaccess)
+       _ASM_EXTABLE_TYPE(from, to, EX_TYPE_UACCESS)
 
 #define _ASM_EXTABLE_CPY(from, to)                             \
-       _ASM_EXTABLE_HANDLE(from, to, ex_handler_copy)
+       _ASM_EXTABLE_TYPE(from, to, EX_TYPE_COPY)
 
 #define _ASM_EXTABLE_FAULT(from, to)                           \
-       _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault)
+       _ASM_EXTABLE_TYPE(from, to, EX_TYPE_FAULT)
 
 #endif /* __KERNEL__ */
-
 #endif /* _ASM_X86_ASM_H */