Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16369
b: refs/heads/master
c: ff6e8c0
h: refs/heads/master
i:
  16367: 2d5e057
v: v3
  • Loading branch information
Zachary Amsden authored and Linus Torvalds committed Jan 6, 2006
1 parent 2352e72 commit 71f6ba4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb05c3249a8e8a675e79d221f4a0874dc10ec903
refs/heads/master: ff6e8c0d5e47f0ceeebde86ec2f5919dbd5beb67
4 changes: 1 addition & 3 deletions trunk/arch/i386/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,7 @@ void show_regs(struct pt_regs * regs)
cr0 = read_cr0();
cr2 = read_cr2();
cr3 = read_cr3();
if (current_cpu_data.x86 > 4) {
cr4 = read_cr4();
}
cr4 = read_cr4_safe();
printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", cr0, cr2, cr3, cr4);
show_trace(NULL, &regs->esp);
}
Expand Down
13 changes: 13 additions & 0 deletions trunk/include/asm-i386/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,19 @@ static inline unsigned long _get_base(char * addr)
:"=r" (__dummy)); \
__dummy; \
})

#define read_cr4_safe() ({ \
unsigned int __dummy; \
/* This could fault if %cr4 does not exist */ \
__asm__("1: movl %%cr4, %0 \n" \
"2: \n" \
".section __ex_table,\"a\" \n" \
".long 1b,2b \n" \
".previous \n" \
: "=r" (__dummy): "0" (0)); \
__dummy; \
})

#define write_cr4(x) \
__asm__ __volatile__("movl %0,%%cr4": :"r" (x));
#define stts() write_cr0(8 | read_cr0())
Expand Down

0 comments on commit 71f6ba4

Please sign in to comment.