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/process_64.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/process_64.c')
-rw-r--r-- | arch/x86/kernel/process_64.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index ae5eca17aa3c..efbb1a2eab97 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -257,13 +257,13 @@ void cpu_idle(void) | |||
257 | * New with Core Duo processors, MWAIT can take some hints based on CPU | 257 | * New with Core Duo processors, MWAIT can take some hints based on CPU |
258 | * capability. | 258 | * capability. |
259 | */ | 259 | */ |
260 | void mwait_idle_with_hints(unsigned long eax, unsigned long ecx) | 260 | void mwait_idle_with_hints(unsigned long ax, unsigned long cx) |
261 | { | 261 | { |
262 | if (!need_resched()) { | 262 | if (!need_resched()) { |
263 | __monitor((void *)¤t_thread_info()->flags, 0, 0); | 263 | __monitor((void *)¤t_thread_info()->flags, 0, 0); |
264 | smp_mb(); | 264 | smp_mb(); |
265 | if (!need_resched()) | 265 | if (!need_resched()) |
266 | __mwait(eax, ecx); | 266 | __mwait(ax, cx); |
267 | } | 267 | } |
268 | } | 268 | } |
269 | 269 | ||
@@ -330,16 +330,16 @@ void __show_regs(struct pt_regs * regs) | |||
330 | init_utsname()->release, | 330 | init_utsname()->release, |
331 | (int)strcspn(init_utsname()->version, " "), | 331 | (int)strcspn(init_utsname()->version, " "), |
332 | init_utsname()->version); | 332 | init_utsname()->version); |
333 | printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip); | 333 | printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip); |
334 | printk_address(regs->rip); | 334 | printk_address(regs->ip); |
335 | printk("RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->rsp, | 335 | printk("RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->sp, |
336 | regs->eflags); | 336 | regs->flags); |
337 | printk("RAX: %016lx RBX: %016lx RCX: %016lx\n", | 337 | printk("RAX: %016lx RBX: %016lx RCX: %016lx\n", |
338 | regs->rax, regs->rbx, regs->rcx); | 338 | regs->ax, regs->bx, regs->cx); |
339 | printk("RDX: %016lx RSI: %016lx RDI: %016lx\n", | 339 | printk("RDX: %016lx RSI: %016lx RDI: %016lx\n", |
340 | regs->rdx, regs->rsi, regs->rdi); | 340 | regs->dx, regs->si, regs->di); |
341 | printk("RBP: %016lx R08: %016lx R09: %016lx\n", | 341 | printk("RBP: %016lx R08: %016lx R09: %016lx\n", |
342 | regs->rbp, regs->r8, regs->r9); | 342 | regs->bp, regs->r8, regs->r9); |
343 | printk("R10: %016lx R11: %016lx R12: %016lx\n", | 343 | printk("R10: %016lx R11: %016lx R12: %016lx\n", |
344 | regs->r10, regs->r11, regs->r12); | 344 | regs->r10, regs->r11, regs->r12); |
345 | printk("R13: %016lx R14: %016lx R15: %016lx\n", | 345 | printk("R13: %016lx R14: %016lx R15: %016lx\n", |
@@ -476,7 +476,7 @@ void prepare_to_copy(struct task_struct *tsk) | |||
476 | unlazy_fpu(tsk); | 476 | unlazy_fpu(tsk); |
477 | } | 477 | } |
478 | 478 | ||
479 | int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp, | 479 | int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, |
480 | unsigned long unused, | 480 | unsigned long unused, |
481 | struct task_struct * p, struct pt_regs * regs) | 481 | struct task_struct * p, struct pt_regs * regs) |
482 | { | 482 | { |
@@ -488,10 +488,10 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp, | |||
488 | (THREAD_SIZE + task_stack_page(p))) - 1; | 488 | (THREAD_SIZE + task_stack_page(p))) - 1; |
489 | *childregs = *regs; | 489 | *childregs = *regs; |
490 | 490 | ||
491 | childregs->rax = 0; | 491 | childregs->ax = 0; |
492 | childregs->rsp = rsp; | 492 | childregs->sp = sp; |
493 | if (rsp == ~0UL) | 493 | if (sp == ~0UL) |
494 | childregs->rsp = (unsigned long)childregs; | 494 | childregs->sp = (unsigned long)childregs; |
495 | 495 | ||
496 | p->thread.rsp = (unsigned long) childregs; | 496 | p->thread.rsp = (unsigned long) childregs; |
497 | p->thread.rsp0 = (unsigned long) (childregs+1); | 497 | p->thread.rsp0 = (unsigned long) (childregs+1); |
@@ -525,7 +525,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp, | |||
525 | #ifdef CONFIG_IA32_EMULATION | 525 | #ifdef CONFIG_IA32_EMULATION |
526 | if (test_thread_flag(TIF_IA32)) | 526 | if (test_thread_flag(TIF_IA32)) |
527 | err = do_set_thread_area(p, -1, | 527 | err = do_set_thread_area(p, -1, |
528 | (struct user_desc __user *)childregs->rsi, 0); | 528 | (struct user_desc __user *)childregs->si, 0); |
529 | else | 529 | else |
530 | #endif | 530 | #endif |
531 | err = do_arch_prctl(p, ARCH_SET_FS, childregs->r8); | 531 | err = do_arch_prctl(p, ARCH_SET_FS, childregs->r8); |
@@ -732,7 +732,7 @@ void set_personality_64bit(void) | |||
732 | 732 | ||
733 | asmlinkage long sys_fork(struct pt_regs *regs) | 733 | asmlinkage long sys_fork(struct pt_regs *regs) |
734 | { | 734 | { |
735 | return do_fork(SIGCHLD, regs->rsp, regs, 0, NULL, NULL); | 735 | return do_fork(SIGCHLD, regs->sp, regs, 0, NULL, NULL); |
736 | } | 736 | } |
737 | 737 | ||
738 | asmlinkage long | 738 | asmlinkage long |
@@ -740,7 +740,7 @@ sys_clone(unsigned long clone_flags, unsigned long newsp, | |||
740 | void __user *parent_tid, void __user *child_tid, struct pt_regs *regs) | 740 | void __user *parent_tid, void __user *child_tid, struct pt_regs *regs) |
741 | { | 741 | { |
742 | if (!newsp) | 742 | if (!newsp) |
743 | newsp = regs->rsp; | 743 | newsp = regs->sp; |
744 | return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid); | 744 | return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid); |
745 | } | 745 | } |
746 | 746 | ||
@@ -756,14 +756,14 @@ sys_clone(unsigned long clone_flags, unsigned long newsp, | |||
756 | */ | 756 | */ |
757 | asmlinkage long sys_vfork(struct pt_regs *regs) | 757 | asmlinkage long sys_vfork(struct pt_regs *regs) |
758 | { | 758 | { |
759 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->rsp, regs, 0, | 759 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->sp, regs, 0, |
760 | NULL, NULL); | 760 | NULL, NULL); |
761 | } | 761 | } |
762 | 762 | ||
763 | unsigned long get_wchan(struct task_struct *p) | 763 | unsigned long get_wchan(struct task_struct *p) |
764 | { | 764 | { |
765 | unsigned long stack; | 765 | unsigned long stack; |
766 | u64 fp,rip; | 766 | u64 fp,ip; |
767 | int count = 0; | 767 | int count = 0; |
768 | 768 | ||
769 | if (!p || p == current || p->state==TASK_RUNNING) | 769 | if (!p || p == current || p->state==TASK_RUNNING) |
@@ -776,9 +776,9 @@ unsigned long get_wchan(struct task_struct *p) | |||
776 | if (fp < (unsigned long)stack || | 776 | if (fp < (unsigned long)stack || |
777 | fp > (unsigned long)stack+THREAD_SIZE) | 777 | fp > (unsigned long)stack+THREAD_SIZE) |
778 | return 0; | 778 | return 0; |
779 | rip = *(u64 *)(fp+8); | 779 | ip = *(u64 *)(fp+8); |
780 | if (!in_sched_functions(rip)) | 780 | if (!in_sched_functions(ip)) |
781 | return rip; | 781 | return ip; |
782 | fp = *(u64 *)fp; | 782 | fp = *(u64 *)fp; |
783 | } while (count++ < 16); | 783 | } while (count++ < 16); |
784 | return 0; | 784 | return 0; |