Skip to content

Commit d8af4ce

Browse files
committed
x86/traps: Clean up error exception handler definitions
So I was reading the exception handler generation code and got a real headache looking at the unstructured mess that our DO_ERROR*() generation code is today. Make it more readable. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Link: http://lkml.kernel.org/n/tip-kuabysiykvUJpgus35lhnhvs@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 17b2112 commit d8af4ce

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

‎arch/x86/kernel/traps.c‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -211,21 +211,17 @@ dotraplinkage void do_##name(struct pt_regs *regs, long error_code) \
211211
exception_exit(prev_state); \
212212
}
213213

214-
DO_ERROR_INFO(X86_TRAP_DE, SIGFPE, "divide error", divide_error, FPE_INTDIV,
215-
regs->ip)
216-
DO_ERROR(X86_TRAP_OF, SIGSEGV, "overflow", overflow)
217-
DO_ERROR(X86_TRAP_BR, SIGSEGV, "bounds", bounds)
218-
DO_ERROR_INFO(X86_TRAP_UD, SIGILL, "invalid opcode", invalid_op, ILL_ILLOPN,
219-
regs->ip)
220-
DO_ERROR(X86_TRAP_OLD_MF, SIGFPE, "coprocessor segment overrun",
221-
coprocessor_segment_overrun)
222-
DO_ERROR(X86_TRAP_TS, SIGSEGV, "invalid TSS", invalid_TSS)
223-
DO_ERROR(X86_TRAP_NP, SIGBUS, "segment not present", segment_not_present)
214+
DO_ERROR_INFO(X86_TRAP_DE, SIGFPE, "divide error", divide_error, FPE_INTDIV, regs->ip )
215+
DO_ERROR (X86_TRAP_OF, SIGSEGV, "overflow", overflow )
216+
DO_ERROR (X86_TRAP_BR, SIGSEGV, "bounds", bounds )
217+
DO_ERROR_INFO(X86_TRAP_UD, SIGILL, "invalid opcode", invalid_op, ILL_ILLOPN, regs->ip )
218+
DO_ERROR (X86_TRAP_OLD_MF, SIGFPE, "coprocessor segment overrun", coprocessor_segment_overrun )
219+
DO_ERROR (X86_TRAP_TS, SIGSEGV, "invalid TSS", invalid_TSS )
220+
DO_ERROR (X86_TRAP_NP, SIGBUS, "segment not present", segment_not_present )
224221
#ifdef CONFIG_X86_32
225-
DO_ERROR(X86_TRAP_SS, SIGBUS, "stack segment", stack_segment)
222+
DO_ERROR (X86_TRAP_SS, SIGBUS, "stack segment", stack_segment )
226223
#endif
227-
DO_ERROR_INFO(X86_TRAP_AC, SIGBUS, "alignment check", alignment_check,
228-
BUS_ADRALN, 0)
224+
DO_ERROR_INFO(X86_TRAP_AC, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0 )
229225

230226
#ifdef CONFIG_X86_64
231227
/* Runs on IST stack */

0 commit comments

Comments
 (0)