diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2005-06-25 09:27:27 -0400 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2005-06-25 09:27:27 -0400 |
commit | 38b22b6e9f46ab8f73ef5734f0e0a000766a9258 (patch) | |
tree | 2ccc41ef55918d3af43e444bde7648562a031559 /arch/i386/kernel/cpu | |
parent | 3357d4c75f1fb67e7304998c4ad4e9a9fed66fa4 (diff) | |
parent | b3e112bcc19abd8e9657dca34a87316786e096f3 (diff) |
Automerge with /usr/src/ntfs-2.6.git.
Diffstat (limited to 'arch/i386/kernel/cpu')
-rw-r--r-- | arch/i386/kernel/cpu/common.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/mtrr/main.c | 23 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/proc.c | 2 |
3 files changed, 17 insertions, 10 deletions
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c index d199e525680a..b9954248d0aa 100644 --- a/arch/i386/kernel/cpu/common.c +++ b/arch/i386/kernel/cpu/common.c | |||
@@ -635,7 +635,7 @@ void __init cpu_init (void) | |||
635 | 635 | ||
636 | /* Clear all 6 debug registers: */ | 636 | /* Clear all 6 debug registers: */ |
637 | 637 | ||
638 | #define CD(register) __asm__("movl %0,%%db" #register ::"r"(0) ); | 638 | #define CD(register) set_debugreg(0, register) |
639 | 639 | ||
640 | CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7); | 640 | CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7); |
641 | 641 | ||
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c index e1c2042b9b7e..d66b09e0c820 100644 --- a/arch/i386/kernel/cpu/mtrr/main.c +++ b/arch/i386/kernel/cpu/mtrr/main.c | |||
@@ -375,6 +375,19 @@ int mtrr_add_page(unsigned long base, unsigned long size, | |||
375 | return error; | 375 | return error; |
376 | } | 376 | } |
377 | 377 | ||
378 | static int mtrr_check(unsigned long base, unsigned long size) | ||
379 | { | ||
380 | if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) { | ||
381 | printk(KERN_WARNING | ||
382 | "mtrr: size and base must be multiples of 4 kiB\n"); | ||
383 | printk(KERN_DEBUG | ||
384 | "mtrr: size: 0x%lx base: 0x%lx\n", size, base); | ||
385 | dump_stack(); | ||
386 | return -1; | ||
387 | } | ||
388 | return 0; | ||
389 | } | ||
390 | |||
378 | /** | 391 | /** |
379 | * mtrr_add - Add a memory type region | 392 | * mtrr_add - Add a memory type region |
380 | * @base: Physical base address of region | 393 | * @base: Physical base address of region |
@@ -415,11 +428,8 @@ int | |||
415 | mtrr_add(unsigned long base, unsigned long size, unsigned int type, | 428 | mtrr_add(unsigned long base, unsigned long size, unsigned int type, |
416 | char increment) | 429 | char increment) |
417 | { | 430 | { |
418 | if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) { | 431 | if (mtrr_check(base, size)) |
419 | printk(KERN_WARNING "mtrr: size and base must be multiples of 4 kiB\n"); | ||
420 | printk(KERN_DEBUG "mtrr: size: 0x%lx base: 0x%lx\n", size, base); | ||
421 | return -EINVAL; | 432 | return -EINVAL; |
422 | } | ||
423 | return mtrr_add_page(base >> PAGE_SHIFT, size >> PAGE_SHIFT, type, | 433 | return mtrr_add_page(base >> PAGE_SHIFT, size >> PAGE_SHIFT, type, |
424 | increment); | 434 | increment); |
425 | } | 435 | } |
@@ -511,11 +521,8 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size) | |||
511 | int | 521 | int |
512 | mtrr_del(int reg, unsigned long base, unsigned long size) | 522 | mtrr_del(int reg, unsigned long base, unsigned long size) |
513 | { | 523 | { |
514 | if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) { | 524 | if (mtrr_check(base, size)) |
515 | printk(KERN_INFO "mtrr: size and base must be multiples of 4 kiB\n"); | ||
516 | printk(KERN_DEBUG "mtrr: size: 0x%lx base: 0x%lx\n", size, base); | ||
517 | return -EINVAL; | 525 | return -EINVAL; |
518 | } | ||
519 | return mtrr_del_page(reg, base >> PAGE_SHIFT, size >> PAGE_SHIFT); | 526 | return mtrr_del_page(reg, base >> PAGE_SHIFT, size >> PAGE_SHIFT); |
520 | } | 527 | } |
521 | 528 | ||
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c index 7323c19f354e..8bd77d948a84 100644 --- a/arch/i386/kernel/cpu/proc.c +++ b/arch/i386/kernel/cpu/proc.c | |||
@@ -86,7 +86,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
86 | seq_printf(m, "stepping\t: unknown\n"); | 86 | seq_printf(m, "stepping\t: unknown\n"); |
87 | 87 | ||
88 | if ( cpu_has(c, X86_FEATURE_TSC) ) { | 88 | if ( cpu_has(c, X86_FEATURE_TSC) ) { |
89 | seq_printf(m, "cpu MHz\t\t: %lu.%03lu\n", | 89 | seq_printf(m, "cpu MHz\t\t: %u.%03u\n", |
90 | cpu_khz / 1000, (cpu_khz % 1000)); | 90 | cpu_khz / 1000, (cpu_khz % 1000)); |
91 | } | 91 | } |
92 | 92 | ||