aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/fault_64.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-01-30 07:30:56 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:30:56 -0500
commit65ea5b0349903585bfed9720fa06f5edb4f1cd25 (patch)
tree6c252228c34416b7e2077f23475de34500c2ab8a /arch/x86/mm/fault_64.c
parent53756d3722172815f52272b28c6d5d5e9639adde (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/mm/fault_64.c')
-rw-r--r--arch/x86/mm/fault_64.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/x86/mm/fault_64.c b/arch/x86/mm/fault_64.c
index 0e26230669ca..88a7abda29ce 100644
--- a/arch/x86/mm/fault_64.c
+++ b/arch/x86/mm/fault_64.c
@@ -198,7 +198,7 @@ KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n";
198static int is_errata93(struct pt_regs *regs, unsigned long address) 198static int is_errata93(struct pt_regs *regs, unsigned long address)
199{ 199{
200 static int warned; 200 static int warned;
201 if (address != regs->rip) 201 if (address != regs->ip)
202 return 0; 202 return 0;
203 if ((address >> 32) != 0) 203 if ((address >> 32) != 0)
204 return 0; 204 return 0;
@@ -209,7 +209,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
209 printk(errata93_warning); 209 printk(errata93_warning);
210 warned = 1; 210 warned = 1;
211 } 211 }
212 regs->rip = address; 212 regs->ip = address;
213 return 1; 213 return 1;
214 } 214 }
215 return 0; 215 return 0;
@@ -355,7 +355,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
355 if (notify_page_fault(regs)) 355 if (notify_page_fault(regs))
356 return; 356 return;
357 357
358 if (likely(regs->eflags & X86_EFLAGS_IF)) 358 if (likely(regs->flags & X86_EFLAGS_IF))
359 local_irq_enable(); 359 local_irq_enable();
360 360
361 if (unlikely(error_code & PF_RSVD)) 361 if (unlikely(error_code & PF_RSVD))
@@ -393,7 +393,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
393 */ 393 */
394 if (!down_read_trylock(&mm->mmap_sem)) { 394 if (!down_read_trylock(&mm->mmap_sem)) {
395 if ((error_code & PF_USER) == 0 && 395 if ((error_code & PF_USER) == 0 &&
396 !search_exception_tables(regs->rip)) 396 !search_exception_tables(regs->ip))
397 goto bad_area_nosemaphore; 397 goto bad_area_nosemaphore;
398 down_read(&mm->mmap_sem); 398 down_read(&mm->mmap_sem);
399 } 399 }
@@ -409,7 +409,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
409 /* Allow userspace just enough access below the stack pointer 409 /* Allow userspace just enough access below the stack pointer
410 * to let the 'enter' instruction work. 410 * to let the 'enter' instruction work.
411 */ 411 */
412 if (address + 65536 + 32 * sizeof(unsigned long) < regs->rsp) 412 if (address + 65536 + 32 * sizeof(unsigned long) < regs->sp)
413 goto bad_area; 413 goto bad_area;
414 } 414 }
415 if (expand_stack(vma, address)) 415 if (expand_stack(vma, address))
@@ -488,10 +488,10 @@ bad_area_nosemaphore:
488 if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) && 488 if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
489 printk_ratelimit()) { 489 printk_ratelimit()) {
490 printk( 490 printk(
491 "%s%s[%d]: segfault at %lx rip %lx rsp %lx error %lx\n", 491 "%s%s[%d]: segfault at %lx ip %lx sp %lx error %lx\n",
492 tsk->pid > 1 ? KERN_INFO : KERN_EMERG, 492 tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
493 tsk->comm, tsk->pid, address, regs->rip, 493 tsk->comm, tsk->pid, address, regs->ip,
494 regs->rsp, error_code); 494 regs->sp, error_code);
495 } 495 }
496 496
497 tsk->thread.cr2 = address; 497 tsk->thread.cr2 = address;
@@ -509,9 +509,9 @@ bad_area_nosemaphore:
509no_context: 509no_context:
510 510
511 /* Are we prepared to handle this kernel fault? */ 511 /* Are we prepared to handle this kernel fault? */
512 fixup = search_exception_tables(regs->rip); 512 fixup = search_exception_tables(regs->ip);
513 if (fixup) { 513 if (fixup) {
514 regs->rip = fixup->fixup; 514 regs->ip = fixup->fixup;
515 return; 515 return;
516 } 516 }
517 517
@@ -537,7 +537,7 @@ no_context:
537 else 537 else
538 printk(KERN_ALERT "Unable to handle kernel paging request"); 538 printk(KERN_ALERT "Unable to handle kernel paging request");
539 printk(" at %016lx RIP: \n" KERN_ALERT,address); 539 printk(" at %016lx RIP: \n" KERN_ALERT,address);
540 printk_address(regs->rip); 540 printk_address(regs->ip);
541 dump_pagetable(address); 541 dump_pagetable(address);
542 tsk->thread.cr2 = address; 542 tsk->thread.cr2 = address;
543 tsk->thread.trap_no = 14; 543 tsk->thread.trap_no = 14;