aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/mpparse_32.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <astarikovskiy@suse.de>2008-04-04 15:42:09 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:35 -0400
commit888032cd23f0244fdefdcbe265952e7831a9cacc (patch)
treed50051196a3ee0eaa6ddf7e1e7665bd5b088d384 /arch/x86/kernel/mpparse_32.c
parent4ef81297f72655c4f4c1ae9c371453f9ca796aad (diff)
x86: add early flags to mpparse_32.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/mpparse_32.c')
-rw-r--r--arch/x86/kernel/mpparse_32.c57
1 files changed, 47 insertions, 10 deletions
diff --git a/arch/x86/kernel/mpparse_32.c b/arch/x86/kernel/mpparse_32.c
index f1c896ab8275..6c9c29621900 100644
--- a/arch/x86/kernel/mpparse_32.c
+++ b/arch/x86/kernel/mpparse_32.c
@@ -329,7 +329,7 @@ static inline void mps_oem_check(struct mp_config_table *mpc, char *oem,
329 * Read/parse the MPC 329 * Read/parse the MPC
330 */ 330 */
331 331
332static int __init smp_read_mpc(struct mp_config_table *mpc) 332static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
333{ 333{
334 char str[16]; 334 char str[16];
335 char oem[10]; 335 char oem[10];
@@ -373,6 +373,9 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
373 if (!acpi_lapic) 373 if (!acpi_lapic)
374 mp_lapic_addr = mpc->mpc_lapic; 374 mp_lapic_addr = mpc->mpc_lapic;
375 375
376 if (early)
377 return 1;
378
376 /* 379 /*
377 * Now process the configuration blocks. 380 * Now process the configuration blocks.
378 */ 381 */
@@ -622,10 +625,13 @@ static struct intel_mp_floating *mpf_found;
622/* 625/*
623 * Scan the memory blocks for an SMP configuration block. 626 * Scan the memory blocks for an SMP configuration block.
624 */ 627 */
625void __init get_smp_config(void) 628static void __init __get_smp_config(unsigned early)
626{ 629{
627 struct intel_mp_floating *mpf = mpf_found; 630 struct intel_mp_floating *mpf = mpf_found;
628 631
632 if (acpi_lapic && early)
633 return;
634
629 /* 635 /*
630 * ACPI supports both logical (e.g. Hyper-Threading) and physical 636 * ACPI supports both logical (e.g. Hyper-Threading) and physical
631 * processors, where MPS only supports physical. 637 * processors, where MPS only supports physical.
@@ -652,6 +658,13 @@ void __init get_smp_config(void)
652 * Now see if we need to read further. 658 * Now see if we need to read further.
653 */ 659 */
654 if (mpf->mpf_feature1 != 0) { 660 if (mpf->mpf_feature1 != 0) {
661 if (early) {
662 /*
663 * local APIC has default address
664 */
665 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
666 return;
667 }
655 668
656 printk(KERN_INFO "Default MP configuration #%d\n", 669 printk(KERN_INFO "Default MP configuration #%d\n",
657 mpf->mpf_feature1); 670 mpf->mpf_feature1);
@@ -663,7 +676,7 @@ void __init get_smp_config(void)
663 * Read the physical hardware table. Anything here will 676 * Read the physical hardware table. Anything here will
664 * override the defaults. 677 * override the defaults.
665 */ 678 */
666 if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr))) { 679 if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr), early)) {
667 smp_found_config = 0; 680 smp_found_config = 0;
668 printk(KERN_ERR 681 printk(KERN_ERR
669 "BIOS bug, MP table errors detected!...\n"); 682 "BIOS bug, MP table errors detected!...\n");
@@ -672,6 +685,8 @@ void __init get_smp_config(void)
672 return; 685 return;
673 } 686 }
674 687
688 if (early)
689 return;
675#ifdef CONFIG_X86_IO_APIC 690#ifdef CONFIG_X86_IO_APIC
676 /* 691 /*
677 * If there are no explicit MP IRQ entries, then we are 692 * If there are no explicit MP IRQ entries, then we are
@@ -695,13 +710,25 @@ void __init get_smp_config(void)
695 } else 710 } else
696 BUG(); 711 BUG();
697 712
698 printk(KERN_INFO "Processors: %d\n", num_processors); 713 if (!early)
714 printk(KERN_INFO "Processors: %d\n", num_processors);
699 /* 715 /*
700 * Only use the first configuration found. 716 * Only use the first configuration found.
701 */ 717 */
702} 718}
703 719
704static int __init smp_scan_config(unsigned long base, unsigned long length) 720void __init early_get_smp_config(void)
721{
722 __get_smp_config(1);
723}
724
725void __init get_smp_config(void)
726{
727 __get_smp_config(0);
728}
729
730static int __init smp_scan_config(unsigned long base, unsigned long length,
731 unsigned reserve)
705{ 732{
706 unsigned long *bp = phys_to_virt(base); 733 unsigned long *bp = phys_to_virt(base);
707 struct intel_mp_floating *mpf; 734 struct intel_mp_floating *mpf;
@@ -750,7 +777,7 @@ static int __init smp_scan_config(unsigned long base, unsigned long length)
750 return 0; 777 return 0;
751} 778}
752 779
753void __init find_smp_config(void) 780static void __init __find_smp_config(unsigned reserve)
754{ 781{
755 unsigned int address; 782 unsigned int address;
756 783
@@ -762,9 +789,9 @@ void __init find_smp_config(void)
762 * 2) Scan the top 1K of base RAM 789 * 2) Scan the top 1K of base RAM
763 * 3) Scan the 64K of bios 790 * 3) Scan the 64K of bios
764 */ 791 */
765 if (smp_scan_config(0x0, 0x400) || 792 if (smp_scan_config(0x0, 0x400, reserve) ||
766 smp_scan_config(639 * 0x400, 0x400) || 793 smp_scan_config(639 * 0x400, 0x400, reserve) ||
767 smp_scan_config(0xF0000, 0x10000)) 794 smp_scan_config(0xF0000, 0x10000, reserve))
768 return; 795 return;
769 /* 796 /*
770 * If it is an SMP machine we should know now, unless the 797 * If it is an SMP machine we should know now, unless the
@@ -785,7 +812,17 @@ void __init find_smp_config(void)
785 812
786 address = get_bios_ebda(); 813 address = get_bios_ebda();
787 if (address) 814 if (address)
788 smp_scan_config(address, 0x400); 815 smp_scan_config(address, 0x400, reserve);
816}
817
818void __init early_find_smp_config(void)
819{
820 __find_smp_config(0);
821}
822
823void __init find_smp_config(void)
824{
825 __find_smp_config(1);
789} 826}
790 827
791/* -------------------------------------------------------------------------- 828/* --------------------------------------------------------------------------