[miniPATCH] about cr4 : SysRq Show Reg

Masahiro Adegawa (adegawa@zerosoft.co.jp)
Thu, 15 Jul 1999 19:09:18 +0900


Hi,

we get cr4 when `SysRq: Show Regs'.
But I do not know the best effective judging conditions of CR4.

--- linux-2.2.10/arch/i386/kernel/process.c.original Sat May 1 00:13:37 1999
+++ linux-2.2.10/arch/i386/kernel/process.c Thu Jul 15 14:46:31 1999
@@ -394,7 +394,7 @@

void show_regs(struct pt_regs * regs)
{
- long cr0 = 0L, cr2 = 0L, cr3 = 0L;
+ long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;

printk("\n");
printk("EIP: %04x:[<%08lx>]",0xffff & regs->xcs,regs->eip);
@@ -410,7 +410,13 @@
__asm__("movl %%cr0, %0": "=r" (cr0));
__asm__("movl %%cr2, %0": "=r" (cr2));
__asm__("movl %%cr3, %0": "=r" (cr3));
- printk("CR0: %08lx CR2: %08lx CR3: %08lx\n", cr0, cr2, cr3);
+ if (boot_cpu_data.x86_capability & X86_FEATURE_PSE) {
+ __asm__("movl %%cr4, %0": "=r" (cr4));
+ printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", cr0, cr2, cr3, cr4);
+ }
+ else {
+ printk("CR0: %08lx CR2: %08lx CR3: %08lx\n", cr0, cr2, cr3);
+ }
}

/*

--
- Masahiro

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/