diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-02 02:54:01 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-07-02 02:54:08 -0400 |
commit | 251e1e44b97852aa5e53e71c4b47e55b2dfd054e (patch) | |
tree | 78ee4f0e24151ab44f7d224c93a1e515ebd1697d /arch/x86 | |
parent | 76c06927f2a78143763dcff9b4c362d15eb29cc2 (diff) |
x86: Fix printk call in print_local_apic()
Instead of this:
[ 75.690022] <7>printing local APIC contents on CPU#0/0:
[ 75.704406] ... APIC ID: 00000000 (0)
[ 75.707905] ... APIC VERSION: 00060015
[ 75.722551] ... APIC TASKPRI: 00000000 (00)
[ 75.725473] ... APIC PROCPRI: 00000000
[ 75.728592] ... APIC LDR: 00000001
[ 75.742137] ... APIC SPIV: 000001ff
[ 75.744101] ... APIC ISR field:
[ 75.746648] 0123456789abcdef0123456789abcdef
[ 75.746649] <7>00000000000000000000000000000000
Improve the code to be saner and simpler and just print out
the bitfield in a single line using hexa values - not as a
(rather pointless) binary bitfield.
Partially reused Linus's initial fix for this.
Reported-and-Tested-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <4A4C43BC.90506@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 4d0216fcb36c..8fd1efb5a0bd 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -1716,25 +1716,19 @@ __apicdebuginit(void) print_IO_APIC(void) | |||
1716 | return; | 1716 | return; |
1717 | } | 1717 | } |
1718 | 1718 | ||
1719 | __apicdebuginit(void) print_APIC_bitfield(int base) | 1719 | __apicdebuginit(void) print_APIC_field(int base) |
1720 | { | 1720 | { |
1721 | unsigned int v; | 1721 | int i; |
1722 | int i, j; | ||
1723 | 1722 | ||
1724 | if (apic_verbosity == APIC_QUIET) | 1723 | if (apic_verbosity == APIC_QUIET) |
1725 | return; | 1724 | return; |
1726 | 1725 | ||
1727 | printk(KERN_DEBUG "0123456789abcdef0123456789abcdef\n" KERN_DEBUG); | 1726 | printk(KERN_DEBUG); |
1728 | for (i = 0; i < 8; i++) { | 1727 | |
1729 | v = apic_read(base + i*0x10); | 1728 | for (i = 0; i < 8; i++) |
1730 | for (j = 0; j < 32; j++) { | 1729 | printk(KERN_CONT "%08x", apic_read(base + i*0x10)); |
1731 | if (v & (1<<j)) | 1730 | |
1732 | printk("1"); | 1731 | printk(KERN_CONT "\n"); |
1733 | else | ||
1734 | printk("0"); | ||
1735 | } | ||
1736 | printk("\n"); | ||
1737 | } | ||
1738 | } | 1732 | } |
1739 | 1733 | ||
1740 | __apicdebuginit(void) print_local_APIC(void *dummy) | 1734 | __apicdebuginit(void) print_local_APIC(void *dummy) |
@@ -1745,7 +1739,8 @@ __apicdebuginit(void) print_local_APIC(void *dummy) | |||
1745 | if (apic_verbosity == APIC_QUIET) | 1739 | if (apic_verbosity == APIC_QUIET) |
1746 | return; | 1740 | return; |
1747 | 1741 | ||
1748 | printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", | 1742 | printk(KERN_DEBUG "\n"); |
1743 | printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", | ||
1749 | smp_processor_id(), hard_smp_processor_id()); | 1744 | smp_processor_id(), hard_smp_processor_id()); |
1750 | v = apic_read(APIC_ID); | 1745 | v = apic_read(APIC_ID); |
1751 | printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id()); | 1746 | printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id()); |
@@ -1786,11 +1781,11 @@ __apicdebuginit(void) print_local_APIC(void *dummy) | |||
1786 | printk(KERN_DEBUG "... APIC SPIV: %08x\n", v); | 1781 | printk(KERN_DEBUG "... APIC SPIV: %08x\n", v); |
1787 | 1782 | ||
1788 | printk(KERN_DEBUG "... APIC ISR field:\n"); | 1783 | printk(KERN_DEBUG "... APIC ISR field:\n"); |
1789 | print_APIC_bitfield(APIC_ISR); | 1784 | print_APIC_field(APIC_ISR); |
1790 | printk(KERN_DEBUG "... APIC TMR field:\n"); | 1785 | printk(KERN_DEBUG "... APIC TMR field:\n"); |
1791 | print_APIC_bitfield(APIC_TMR); | 1786 | print_APIC_field(APIC_TMR); |
1792 | printk(KERN_DEBUG "... APIC IRR field:\n"); | 1787 | printk(KERN_DEBUG "... APIC IRR field:\n"); |
1793 | print_APIC_bitfield(APIC_IRR); | 1788 | print_APIC_field(APIC_IRR); |
1794 | 1789 | ||
1795 | if (APIC_INTEGRATED(ver)) { /* !82489DX */ | 1790 | if (APIC_INTEGRATED(ver)) { /* !82489DX */ |
1796 | if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ | 1791 | if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ |