diff options
author | Alexander van Heukelum <heukelum@fastmail.fm> | 2008-09-30 12:41:36 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-13 04:33:20 -0400 |
commit | e407d62088b7f61f38e1086062650c75a4f2757a (patch) | |
tree | b0b5b666361c305f93bdf0e439d69acf7ee2f0e0 /arch/x86/kernel/traps_64.c | |
parent | ae82157b3d8bb4902f76b56c7450a945288786ac (diff) |
x86, traps: introduce dotraplinkage
Mark the exception handlers with "dotraplinkage" to hide the
calling convention differences between i386 and x86_64.
Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/traps_64.c')
-rw-r--r-- | arch/x86/kernel/traps_64.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index b295ebf0cb3f..be73323ca952 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c | |||
@@ -125,7 +125,7 @@ kernel_trap: | |||
125 | } | 125 | } |
126 | 126 | ||
127 | #define DO_ERROR(trapnr, signr, str, name) \ | 127 | #define DO_ERROR(trapnr, signr, str, name) \ |
128 | asmlinkage void do_##name(struct pt_regs *regs, long error_code) \ | 128 | dotraplinkage void do_##name(struct pt_regs *regs, long error_code) \ |
129 | { \ | 129 | { \ |
130 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ | 130 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ |
131 | == NOTIFY_STOP) \ | 131 | == NOTIFY_STOP) \ |
@@ -135,7 +135,7 @@ asmlinkage void do_##name(struct pt_regs *regs, long error_code) \ | |||
135 | } | 135 | } |
136 | 136 | ||
137 | #define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \ | 137 | #define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \ |
138 | asmlinkage void do_##name(struct pt_regs *regs, long error_code) \ | 138 | dotraplinkage void do_##name(struct pt_regs *regs, long error_code) \ |
139 | { \ | 139 | { \ |
140 | siginfo_t info; \ | 140 | siginfo_t info; \ |
141 | info.si_signo = signr; \ | 141 | info.si_signo = signr; \ |
@@ -159,7 +159,7 @@ DO_ERROR(11, SIGBUS, "segment not present", segment_not_present) | |||
159 | DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) | 159 | DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) |
160 | 160 | ||
161 | /* Runs on IST stack */ | 161 | /* Runs on IST stack */ |
162 | asmlinkage void do_stack_segment(struct pt_regs *regs, long error_code) | 162 | dotraplinkage void do_stack_segment(struct pt_regs *regs, long error_code) |
163 | { | 163 | { |
164 | if (notify_die(DIE_TRAP, "stack segment", regs, error_code, | 164 | if (notify_die(DIE_TRAP, "stack segment", regs, error_code, |
165 | 12, SIGBUS) == NOTIFY_STOP) | 165 | 12, SIGBUS) == NOTIFY_STOP) |
@@ -169,7 +169,7 @@ asmlinkage void do_stack_segment(struct pt_regs *regs, long error_code) | |||
169 | preempt_conditional_cli(regs); | 169 | preempt_conditional_cli(regs); |
170 | } | 170 | } |
171 | 171 | ||
172 | asmlinkage void do_double_fault(struct pt_regs *regs, long error_code) | 172 | dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code) |
173 | { | 173 | { |
174 | static const char str[] = "double fault"; | 174 | static const char str[] = "double fault"; |
175 | struct task_struct *tsk = current; | 175 | struct task_struct *tsk = current; |
@@ -186,7 +186,7 @@ asmlinkage void do_double_fault(struct pt_regs *regs, long error_code) | |||
186 | die(str, regs, error_code); | 186 | die(str, regs, error_code); |
187 | } | 187 | } |
188 | 188 | ||
189 | asmlinkage void __kprobes | 189 | dotraplinkage void __kprobes |
190 | do_general_protection(struct pt_regs *regs, long error_code) | 190 | do_general_protection(struct pt_regs *regs, long error_code) |
191 | { | 191 | { |
192 | struct task_struct *tsk; | 192 | struct task_struct *tsk; |
@@ -317,7 +317,7 @@ asmlinkage notrace __kprobes void default_do_nmi(struct pt_regs *regs) | |||
317 | io_check_error(reason, regs); | 317 | io_check_error(reason, regs); |
318 | } | 318 | } |
319 | 319 | ||
320 | asmlinkage notrace __kprobes void | 320 | dotraplinkage notrace __kprobes void |
321 | do_nmi(struct pt_regs *regs, long error_code) | 321 | do_nmi(struct pt_regs *regs, long error_code) |
322 | { | 322 | { |
323 | nmi_enter(); | 323 | nmi_enter(); |
@@ -343,7 +343,7 @@ void restart_nmi(void) | |||
343 | } | 343 | } |
344 | 344 | ||
345 | /* runs on IST stack. */ | 345 | /* runs on IST stack. */ |
346 | asmlinkage void __kprobes do_int3(struct pt_regs *regs, long error_code) | 346 | dotraplinkage void __kprobes do_int3(struct pt_regs *regs, long error_code) |
347 | { | 347 | { |
348 | if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) | 348 | if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) |
349 | == NOTIFY_STOP) | 349 | == NOTIFY_STOP) |
@@ -376,8 +376,7 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs) | |||
376 | } | 376 | } |
377 | 377 | ||
378 | /* runs on IST stack. */ | 378 | /* runs on IST stack. */ |
379 | asmlinkage void __kprobes do_debug(struct pt_regs *regs, | 379 | dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) |
380 | unsigned long error_code) | ||
381 | { | 380 | { |
382 | struct task_struct *tsk = current; | 381 | struct task_struct *tsk = current; |
383 | unsigned long condition; | 382 | unsigned long condition; |
@@ -510,7 +509,7 @@ void math_error(void __user *ip) | |||
510 | force_sig_info(SIGFPE, &info, task); | 509 | force_sig_info(SIGFPE, &info, task); |
511 | } | 510 | } |
512 | 511 | ||
513 | asmlinkage void do_coprocessor_error(struct pt_regs *regs, long error_code) | 512 | dotraplinkage void do_coprocessor_error(struct pt_regs *regs, long error_code) |
514 | { | 513 | { |
515 | conditional_sti(regs); | 514 | conditional_sti(regs); |
516 | if (!user_mode(regs) && | 515 | if (!user_mode(regs) && |
@@ -572,7 +571,8 @@ static void simd_math_error(void __user *ip) | |||
572 | force_sig_info(SIGFPE, &info, task); | 571 | force_sig_info(SIGFPE, &info, task); |
573 | } | 572 | } |
574 | 573 | ||
575 | asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs, long error_code) | 574 | dotraplinkage void |
575 | do_simd_coprocessor_error(struct pt_regs *regs, long error_code) | ||
576 | { | 576 | { |
577 | conditional_sti(regs); | 577 | conditional_sti(regs); |
578 | if (!user_mode(regs) && | 578 | if (!user_mode(regs) && |
@@ -581,7 +581,8 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs, long error_code) | |||
581 | simd_math_error((void __user *)regs->ip); | 581 | simd_math_error((void __user *)regs->ip); |
582 | } | 582 | } |
583 | 583 | ||
584 | asmlinkage void do_spurious_interrupt_bug(struct pt_regs *regs, long error_code) | 584 | dotraplinkage void |
585 | do_spurious_interrupt_bug(struct pt_regs *regs, long error_code) | ||
585 | { | 586 | { |
586 | } | 587 | } |
587 | 588 | ||
@@ -633,6 +634,12 @@ asmlinkage void math_state_restore(void) | |||
633 | } | 634 | } |
634 | EXPORT_SYMBOL_GPL(math_state_restore); | 635 | EXPORT_SYMBOL_GPL(math_state_restore); |
635 | 636 | ||
637 | dotraplinkage void __kprobes | ||
638 | do_device_not_available(struct pt_regs *regs, long error) | ||
639 | { | ||
640 | math_state_restore(); | ||
641 | } | ||
642 | |||
636 | void __init trap_init(void) | 643 | void __init trap_init(void) |
637 | { | 644 | { |
638 | set_intr_gate(0, ÷_error); | 645 | set_intr_gate(0, ÷_error); |