diff options
author | Srikar Dronamraju <srikar@linux.vnet.ibm.com> | 2012-03-12 05:25:55 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-03-13 01:24:09 -0400 |
commit | 51e7dc7011c99e1e5294658c7b551b92ca069985 (patch) | |
tree | cef8f1aa1f9ef67e5e00e2a5346d5754791a81ac /arch/x86/kernel | |
parent | e898c6706869fdcbd68b1e7fb0ac7461d98710fe (diff) |
x86: Rename trap_no to trap_nr in thread_struct
There are precedences of trap number being referred to as
trap_nr. However thread struct refers trap number as trap_no.
Change it to trap_nr.
Also use enum instead of left-over literals for trap values.
This is pure cleanup, no functional change intended.
Suggested-by: Ingo Molnar <mingo@eltu.hu>
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com>
Cc: Linux-mm <linux-mm@kvack.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120312092555.5379.942.sendpatchset@srdronam.in.ibm.com
[ Fixed the math-emu build ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/dumpstack.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/ptrace.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/signal.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/traps.c | 16 | ||||
-rw-r--r-- | arch/x86/kernel/vm86_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/vsyscall_64.c | 2 |
6 files changed, 14 insertions, 13 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 4025fe4f928..28f98706b08 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -265,7 +265,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err) | |||
265 | #endif | 265 | #endif |
266 | printk("\n"); | 266 | printk("\n"); |
267 | if (notify_die(DIE_OOPS, str, regs, err, | 267 | if (notify_die(DIE_OOPS, str, regs, err, |
268 | current->thread.trap_no, SIGSEGV) == NOTIFY_STOP) | 268 | current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP) |
269 | return 1; | 269 | return 1; |
270 | 270 | ||
271 | show_registers(regs); | 271 | show_registers(regs); |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 93e7877a19c..6fb330adc7c 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/prctl.h> | 33 | #include <asm/prctl.h> |
34 | #include <asm/proto.h> | 34 | #include <asm/proto.h> |
35 | #include <asm/hw_breakpoint.h> | 35 | #include <asm/hw_breakpoint.h> |
36 | #include <asm/traps.h> | ||
36 | 37 | ||
37 | #include "tls.h" | 38 | #include "tls.h" |
38 | 39 | ||
@@ -1425,7 +1426,7 @@ static void fill_sigtrap_info(struct task_struct *tsk, | |||
1425 | int error_code, int si_code, | 1426 | int error_code, int si_code, |
1426 | struct siginfo *info) | 1427 | struct siginfo *info) |
1427 | { | 1428 | { |
1428 | tsk->thread.trap_no = 1; | 1429 | tsk->thread.trap_nr = X86_TRAP_DB; |
1429 | tsk->thread.error_code = error_code; | 1430 | tsk->thread.error_code = error_code; |
1430 | 1431 | ||
1431 | memset(info, 0, sizeof(*info)); | 1432 | memset(info, 0, sizeof(*info)); |
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index c3846b6fb72..9c73acc1c86 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -150,7 +150,7 @@ int setup_sigcontext(struct sigcontext __user *sc, void __user *fpstate, | |||
150 | put_user_ex(regs->r15, &sc->r15); | 150 | put_user_ex(regs->r15, &sc->r15); |
151 | #endif /* CONFIG_X86_64 */ | 151 | #endif /* CONFIG_X86_64 */ |
152 | 152 | ||
153 | put_user_ex(current->thread.trap_no, &sc->trapno); | 153 | put_user_ex(current->thread.trap_nr, &sc->trapno); |
154 | put_user_ex(current->thread.error_code, &sc->err); | 154 | put_user_ex(current->thread.error_code, &sc->err); |
155 | put_user_ex(regs->ip, &sc->ip); | 155 | put_user_ex(regs->ip, &sc->ip); |
156 | #ifdef CONFIG_X86_32 | 156 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 037fc2bc531..c6d17ad59b8 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -132,7 +132,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs, | |||
132 | trap_signal: | 132 | trap_signal: |
133 | #endif | 133 | #endif |
134 | /* | 134 | /* |
135 | * We want error_code and trap_no set for userspace faults and | 135 | * We want error_code and trap_nr set for userspace faults and |
136 | * kernelspace faults which result in die(), but not | 136 | * kernelspace faults which result in die(), but not |
137 | * kernelspace faults which are fixed up. die() gives the | 137 | * kernelspace faults which are fixed up. die() gives the |
138 | * process no chance to handle the signal and notice the | 138 | * process no chance to handle the signal and notice the |
@@ -141,7 +141,7 @@ trap_signal: | |||
141 | * delivered, faults. See also do_general_protection below. | 141 | * delivered, faults. See also do_general_protection below. |
142 | */ | 142 | */ |
143 | tsk->thread.error_code = error_code; | 143 | tsk->thread.error_code = error_code; |
144 | tsk->thread.trap_no = trapnr; | 144 | tsk->thread.trap_nr = trapnr; |
145 | 145 | ||
146 | #ifdef CONFIG_X86_64 | 146 | #ifdef CONFIG_X86_64 |
147 | if (show_unhandled_signals && unhandled_signal(tsk, signr) && | 147 | if (show_unhandled_signals && unhandled_signal(tsk, signr) && |
@@ -164,7 +164,7 @@ trap_signal: | |||
164 | kernel_trap: | 164 | kernel_trap: |
165 | if (!fixup_exception(regs)) { | 165 | if (!fixup_exception(regs)) { |
166 | tsk->thread.error_code = error_code; | 166 | tsk->thread.error_code = error_code; |
167 | tsk->thread.trap_no = trapnr; | 167 | tsk->thread.trap_nr = trapnr; |
168 | die(str, regs, error_code); | 168 | die(str, regs, error_code); |
169 | } | 169 | } |
170 | return; | 170 | return; |
@@ -240,7 +240,7 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code) | |||
240 | notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV); | 240 | notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV); |
241 | 241 | ||
242 | tsk->thread.error_code = error_code; | 242 | tsk->thread.error_code = error_code; |
243 | tsk->thread.trap_no = X86_TRAP_DF; | 243 | tsk->thread.trap_nr = X86_TRAP_DF; |
244 | 244 | ||
245 | /* | 245 | /* |
246 | * This is always a kernel trap and never fixable (and thus must | 246 | * This is always a kernel trap and never fixable (and thus must |
@@ -268,7 +268,7 @@ do_general_protection(struct pt_regs *regs, long error_code) | |||
268 | goto gp_in_kernel; | 268 | goto gp_in_kernel; |
269 | 269 | ||
270 | tsk->thread.error_code = error_code; | 270 | tsk->thread.error_code = error_code; |
271 | tsk->thread.trap_no = X86_TRAP_GP; | 271 | tsk->thread.trap_nr = X86_TRAP_GP; |
272 | 272 | ||
273 | if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) && | 273 | if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) && |
274 | printk_ratelimit()) { | 274 | printk_ratelimit()) { |
@@ -295,7 +295,7 @@ gp_in_kernel: | |||
295 | return; | 295 | return; |
296 | 296 | ||
297 | tsk->thread.error_code = error_code; | 297 | tsk->thread.error_code = error_code; |
298 | tsk->thread.trap_no = X86_TRAP_GP; | 298 | tsk->thread.trap_nr = X86_TRAP_GP; |
299 | if (notify_die(DIE_GPF, "general protection fault", regs, error_code, | 299 | if (notify_die(DIE_GPF, "general protection fault", regs, error_code, |
300 | X86_TRAP_GP, SIGSEGV) == NOTIFY_STOP) | 300 | X86_TRAP_GP, SIGSEGV) == NOTIFY_STOP) |
301 | return; | 301 | return; |
@@ -475,7 +475,7 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr) | |||
475 | { | 475 | { |
476 | if (!fixup_exception(regs)) { | 476 | if (!fixup_exception(regs)) { |
477 | task->thread.error_code = error_code; | 477 | task->thread.error_code = error_code; |
478 | task->thread.trap_no = trapnr; | 478 | task->thread.trap_nr = trapnr; |
479 | die(str, regs, error_code); | 479 | die(str, regs, error_code); |
480 | } | 480 | } |
481 | return; | 481 | return; |
@@ -485,7 +485,7 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr) | |||
485 | * Save the info for the exception handler and clear the error. | 485 | * Save the info for the exception handler and clear the error. |
486 | */ | 486 | */ |
487 | save_init_fpu(task); | 487 | save_init_fpu(task); |
488 | task->thread.trap_no = trapnr; | 488 | task->thread.trap_nr = trapnr; |
489 | task->thread.error_code = error_code; | 489 | task->thread.error_code = error_code; |
490 | info.si_signo = SIGFPE; | 490 | info.si_signo = SIGFPE; |
491 | info.si_errno = 0; | 491 | info.si_errno = 0; |
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c index b466cab5ba1..a1315ab2d6b 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c | |||
@@ -567,7 +567,7 @@ int handle_vm86_trap(struct kernel_vm86_regs *regs, long error_code, int trapno) | |||
567 | } | 567 | } |
568 | if (trapno != 1) | 568 | if (trapno != 1) |
569 | return 1; /* we let this handle by the calling routine */ | 569 | return 1; /* we let this handle by the calling routine */ |
570 | current->thread.trap_no = trapno; | 570 | current->thread.trap_nr = trapno; |
571 | current->thread.error_code = error_code; | 571 | current->thread.error_code = error_code; |
572 | force_sig(SIGTRAP, current); | 572 | force_sig(SIGTRAP, current); |
573 | return 0; | 573 | return 0; |
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c index b07ba939356..327509b95e0 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c | |||
@@ -153,7 +153,7 @@ static bool write_ok_or_segv(unsigned long ptr, size_t size) | |||
153 | 153 | ||
154 | thread->error_code = 6; /* user fault, no page, write */ | 154 | thread->error_code = 6; /* user fault, no page, write */ |
155 | thread->cr2 = ptr; | 155 | thread->cr2 = ptr; |
156 | thread->trap_no = 14; | 156 | thread->trap_nr = X86_TRAP_PF; |
157 | 157 | ||
158 | memset(&info, 0, sizeof(info)); | 158 | memset(&info, 0, sizeof(info)); |
159 | info.si_signo = SIGSEGV; | 159 | info.si_signo = SIGSEGV; |