diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-01-30 07:30:56 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:56 -0500 |
commit | 65ea5b0349903585bfed9720fa06f5edb4f1cd25 (patch) | |
tree | 6c252228c34416b7e2077f23475de34500c2ab8a /arch/x86/kernel/ptrace_32.c | |
parent | 53756d3722172815f52272b28c6d5d5e9639adde (diff) |
x86: rename the struct pt_regs members for 32/64-bit consistency
We have a lot of code which differs only by the naming of specific
members of structures that contain registers. In order to enable
additional unifications, this patch drops the e- or r- size prefix
from the register names in struct pt_regs, and drops the x- prefixes
for segment registers on the 32-bit side.
This patch also performs the equivalent renames in some additional
places that might be candidates for unification in the future.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/ptrace_32.c')
-rw-r--r-- | arch/x86/kernel/ptrace_32.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/x86/kernel/ptrace_32.c b/arch/x86/kernel/ptrace_32.c index 512f8412b799..f81e2f1827d4 100644 --- a/arch/x86/kernel/ptrace_32.c +++ b/arch/x86/kernel/ptrace_32.c | |||
@@ -39,10 +39,10 @@ | |||
39 | 39 | ||
40 | static long *pt_regs_access(struct pt_regs *regs, unsigned long regno) | 40 | static long *pt_regs_access(struct pt_regs *regs, unsigned long regno) |
41 | { | 41 | { |
42 | BUILD_BUG_ON(offsetof(struct pt_regs, ebx) != 0); | 42 | BUILD_BUG_ON(offsetof(struct pt_regs, bx) != 0); |
43 | if (regno > FS) | 43 | if (regno > FS) |
44 | --regno; | 44 | --regno; |
45 | return ®s->ebx + regno; | 45 | return ®s->bx + regno; |
46 | } | 46 | } |
47 | 47 | ||
48 | static int putreg(struct task_struct *child, | 48 | static int putreg(struct task_struct *child, |
@@ -80,7 +80,7 @@ static int putreg(struct task_struct *child, | |||
80 | clear_tsk_thread_flag(child, TIF_FORCED_TF); | 80 | clear_tsk_thread_flag(child, TIF_FORCED_TF); |
81 | else if (test_tsk_thread_flag(child, TIF_FORCED_TF)) | 81 | else if (test_tsk_thread_flag(child, TIF_FORCED_TF)) |
82 | value |= X86_EFLAGS_TF; | 82 | value |= X86_EFLAGS_TF; |
83 | value |= regs->eflags & ~FLAG_MASK; | 83 | value |= regs->flags & ~FLAG_MASK; |
84 | break; | 84 | break; |
85 | } | 85 | } |
86 | *pt_regs_access(regs, regno) = value; | 86 | *pt_regs_access(regs, regno) = value; |
@@ -98,7 +98,7 @@ static unsigned long getreg(struct task_struct *child, unsigned long regno) | |||
98 | /* | 98 | /* |
99 | * If the debugger set TF, hide it from the readout. | 99 | * If the debugger set TF, hide it from the readout. |
100 | */ | 100 | */ |
101 | retval = regs->eflags; | 101 | retval = regs->flags; |
102 | if (test_tsk_thread_flag(child, TIF_FORCED_TF)) | 102 | if (test_tsk_thread_flag(child, TIF_FORCED_TF)) |
103 | retval &= ~X86_EFLAGS_TF; | 103 | retval &= ~X86_EFLAGS_TF; |
104 | break; | 104 | break; |
@@ -369,8 +369,8 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code) | |||
369 | info.si_signo = SIGTRAP; | 369 | info.si_signo = SIGTRAP; |
370 | info.si_code = TRAP_BRKPT; | 370 | info.si_code = TRAP_BRKPT; |
371 | 371 | ||
372 | /* User-mode eip? */ | 372 | /* User-mode ip? */ |
373 | info.si_addr = user_mode_vm(regs) ? (void __user *) regs->eip : NULL; | 373 | info.si_addr = user_mode_vm(regs) ? (void __user *) regs->ip : NULL; |
374 | 374 | ||
375 | /* Send us the fake SIGTRAP */ | 375 | /* Send us the fake SIGTRAP */ |
376 | force_sig_info(SIGTRAP, &info, tsk); | 376 | force_sig_info(SIGTRAP, &info, tsk); |
@@ -392,12 +392,12 @@ int do_syscall_trace(struct pt_regs *regs, int entryexit) | |||
392 | 392 | ||
393 | /* do the secure computing check first */ | 393 | /* do the secure computing check first */ |
394 | if (!entryexit) | 394 | if (!entryexit) |
395 | secure_computing(regs->orig_eax); | 395 | secure_computing(regs->orig_ax); |
396 | 396 | ||
397 | if (unlikely(current->audit_context)) { | 397 | if (unlikely(current->audit_context)) { |
398 | if (entryexit) | 398 | if (entryexit) |
399 | audit_syscall_exit(AUDITSC_RESULT(regs->eax), | 399 | audit_syscall_exit(AUDITSC_RESULT(regs->ax), |
400 | regs->eax); | 400 | regs->ax); |
401 | /* Debug traps, when using PTRACE_SINGLESTEP, must be sent only | 401 | /* Debug traps, when using PTRACE_SINGLESTEP, must be sent only |
402 | * on the syscall exit path. Normally, when TIF_SYSCALL_AUDIT is | 402 | * on the syscall exit path. Normally, when TIF_SYSCALL_AUDIT is |
403 | * not used, entry.S will call us only on syscall exit, not | 403 | * not used, entry.S will call us only on syscall exit, not |
@@ -445,13 +445,13 @@ int do_syscall_trace(struct pt_regs *regs, int entryexit) | |||
445 | ret = is_sysemu; | 445 | ret = is_sysemu; |
446 | out: | 446 | out: |
447 | if (unlikely(current->audit_context) && !entryexit) | 447 | if (unlikely(current->audit_context) && !entryexit) |
448 | audit_syscall_entry(AUDIT_ARCH_I386, regs->orig_eax, | 448 | audit_syscall_entry(AUDIT_ARCH_I386, regs->orig_ax, |
449 | regs->ebx, regs->ecx, regs->edx, regs->esi); | 449 | regs->bx, regs->cx, regs->dx, regs->si); |
450 | if (ret == 0) | 450 | if (ret == 0) |
451 | return 0; | 451 | return 0; |
452 | 452 | ||
453 | regs->orig_eax = -1; /* force skip of syscall restarting */ | 453 | regs->orig_ax = -1; /* force skip of syscall restarting */ |
454 | if (unlikely(current->audit_context)) | 454 | if (unlikely(current->audit_context)) |
455 | audit_syscall_exit(AUDITSC_RESULT(regs->eax), regs->eax); | 455 | audit_syscall_exit(AUDITSC_RESULT(regs->ax), regs->ax); |
456 | return 1; | 456 | return 1; |
457 | } | 457 | } |