aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/traps_32.c
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@fastmail.fm>2008-09-30 12:41:36 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-13 04:33:20 -0400
commite407d62088b7f61f38e1086062650c75a4f2757a (patch)
treeb0b5b666361c305f93bdf0e439d69acf7ee2f0e0 /arch/x86/kernel/traps_32.c
parentae82157b3d8bb4902f76b56c7450a945288786ac (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_32.c')
-rw-r--r--arch/x86/kernel/traps_32.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index 0206c915748c..7eb1203c909d 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -190,7 +190,7 @@ vm86_trap:
190} 190}
191 191
192#define DO_ERROR(trapnr, signr, str, name) \ 192#define DO_ERROR(trapnr, signr, str, name) \
193void do_##name(struct pt_regs *regs, long error_code) \ 193dotraplinkage void do_##name(struct pt_regs *regs, long error_code) \
194{ \ 194{ \
195 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ 195 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
196 == NOTIFY_STOP) \ 196 == NOTIFY_STOP) \
@@ -200,7 +200,7 @@ void do_##name(struct pt_regs *regs, long error_code) \
200} 200}
201 201
202#define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \ 202#define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \
203void do_##name(struct pt_regs *regs, long error_code) \ 203dotraplinkage void do_##name(struct pt_regs *regs, long error_code) \
204{ \ 204{ \
205 siginfo_t info; \ 205 siginfo_t info; \
206 info.si_signo = signr; \ 206 info.si_signo = signr; \
@@ -224,7 +224,7 @@ DO_ERROR(11, SIGBUS, "segment not present", segment_not_present)
224DO_ERROR(12, SIGBUS, "stack segment", stack_segment) 224DO_ERROR(12, SIGBUS, "stack segment", stack_segment)
225DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) 225DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
226 226
227void __kprobes 227dotraplinkage void __kprobes
228do_general_protection(struct pt_regs *regs, long error_code) 228do_general_protection(struct pt_regs *regs, long error_code)
229{ 229{
230 struct task_struct *tsk; 230 struct task_struct *tsk;
@@ -428,7 +428,8 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
428 reassert_nmi(); 428 reassert_nmi();
429} 429}
430 430
431notrace __kprobes void do_nmi(struct pt_regs *regs, long error_code) 431dotraplinkage notrace __kprobes void
432do_nmi(struct pt_regs *regs, long error_code)
432{ 433{
433 int cpu; 434 int cpu;
434 435
@@ -456,7 +457,7 @@ void restart_nmi(void)
456 acpi_nmi_enable(); 457 acpi_nmi_enable();
457} 458}
458 459
459void __kprobes do_int3(struct pt_regs *regs, long error_code) 460dotraplinkage void __kprobes do_int3(struct pt_regs *regs, long error_code)
460{ 461{
461#ifdef CONFIG_KPROBES 462#ifdef CONFIG_KPROBES
462 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) 463 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP)
@@ -494,7 +495,7 @@ void __kprobes do_int3(struct pt_regs *regs, long error_code)
494 * find every occurrence of the TF bit that could be saved away even 495 * find every occurrence of the TF bit that could be saved away even
495 * by user code) 496 * by user code)
496 */ 497 */
497void __kprobes do_debug(struct pt_regs *regs, long error_code) 498dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
498{ 499{
499 struct task_struct *tsk = current; 500 struct task_struct *tsk = current;
500 unsigned int condition; 501 unsigned int condition;
@@ -627,7 +628,7 @@ void math_error(void __user *ip)
627 force_sig_info(SIGFPE, &info, task); 628 force_sig_info(SIGFPE, &info, task);
628} 629}
629 630
630void do_coprocessor_error(struct pt_regs *regs, long error_code) 631dotraplinkage void do_coprocessor_error(struct pt_regs *regs, long error_code)
631{ 632{
632 conditional_sti(regs); 633 conditional_sti(regs);
633 ignore_fpu_irq = 1; 634 ignore_fpu_irq = 1;
@@ -682,7 +683,8 @@ static void simd_math_error(void __user *ip)
682 force_sig_info(SIGFPE, &info, task); 683 force_sig_info(SIGFPE, &info, task);
683} 684}
684 685
685void do_simd_coprocessor_error(struct pt_regs *regs, long error_code) 686dotraplinkage void
687do_simd_coprocessor_error(struct pt_regs *regs, long error_code)
686{ 688{
687 conditional_sti(regs); 689 conditional_sti(regs);
688 690
@@ -706,7 +708,8 @@ void do_simd_coprocessor_error(struct pt_regs *regs, long error_code)
706 force_sig(SIGSEGV, current); 708 force_sig(SIGSEGV, current);
707} 709}
708 710
709void do_spurious_interrupt_bug(struct pt_regs *regs, long error_code) 711dotraplinkage void
712do_spurious_interrupt_bug(struct pt_regs *regs, long error_code)
710{ 713{
711 conditional_sti(regs); 714 conditional_sti(regs);
712#if 0 715#if 0
@@ -784,7 +787,8 @@ asmlinkage void math_emulate(long arg)
784 787
785#endif /* CONFIG_MATH_EMULATION */ 788#endif /* CONFIG_MATH_EMULATION */
786 789
787void __kprobes do_device_not_available(struct pt_regs *regs, long error) 790dotraplinkage void __kprobes
791do_device_not_available(struct pt_regs *regs, long error)
788{ 792{
789 if (read_cr0() & X86_CR0_EM) { 793 if (read_cr0() & X86_CR0_EM) {
790 conditional_sti(regs); 794 conditional_sti(regs);
@@ -796,14 +800,14 @@ void __kprobes do_device_not_available(struct pt_regs *regs, long error)
796} 800}
797 801
798#ifdef CONFIG_X86_MCE 802#ifdef CONFIG_X86_MCE
799void __kprobes do_machine_check(struct pt_regs *regs, long error) 803dotraplinkage void __kprobes do_machine_check(struct pt_regs *regs, long error)
800{ 804{
801 conditional_sti(regs); 805 conditional_sti(regs);
802 machine_check_vector(regs, error); 806 machine_check_vector(regs, error);
803} 807}
804#endif 808#endif
805 809
806void do_iret_error(struct pt_regs *regs, long error_code) 810dotraplinkage void do_iret_error(struct pt_regs *regs, long error_code)
807{ 811{
808 siginfo_t info; 812 siginfo_t info;
809 local_irq_enable(); 813 local_irq_enable();