smpboot_32.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * x86 SMP booting functions
  3. *
  4. * (c) 1995 Alan Cox, Building #3 <alan@redhat.com>
  5. * (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com>
  6. *
  7. * Much of the core SMP work is based on previous work by Thomas Radke, to
  8. * whom a great many thanks are extended.
  9. *
  10. * Thanks to Intel for making available several different Pentium,
  11. * Pentium Pro and Pentium-II/Xeon MP machines.
  12. * Original development of Linux SMP code supported by Caldera.
  13. *
  14. * This code is released under the GNU General Public License version 2 or
  15. * later.
  16. *
  17. * Fixes
  18. * Felix Koop : NR_CPUS used properly
  19. * Jose Renau : Handle single CPU case.
  20. * Alan Cox : By repeated request 8) - Total BogoMIPS report.
  21. * Greg Wright : Fix for kernel stacks panic.
  22. * Erich Boleyn : MP v1.4 and additional changes.
  23. * Matthias Sattler : Changes for 2.1 kernel map.
  24. * Michel Lespinasse : Changes for 2.1 kernel map.
  25. * Michael Chastain : Change trampoline.S to gnu as.
  26. * Alan Cox : Dumb bug: 'B' step PPro's are fine
  27. * Ingo Molnar : Added APIC timers, based on code
  28. * from Jose Renau
  29. * Ingo Molnar : various cleanups and rewrites
  30. * Tigran Aivazian : fixed "0.00 in /proc/uptime on SMP" bug.
  31. * Maciej W. Rozycki : Bits for genuine 82489DX APICs
  32. * Martin J. Bligh : Added support for multi-quad systems
  33. * Dave Jones : Report invalid combinations of Athlon CPUs.
  34. * Rusty Russell : Hacked into shape for new "hotplug" boot process. */
  35. #include <linux/module.h>
  36. #include <linux/init.h>
  37. #include <linux/kernel.h>
  38. #include <linux/mm.h>
  39. #include <linux/sched.h>
  40. #include <linux/kernel_stat.h>
  41. #include <linux/bootmem.h>
  42. #include <linux/notifier.h>
  43. #include <linux/cpu.h>
  44. #include <linux/percpu.h>
  45. #include <linux/nmi.h>
  46. #include <linux/delay.h>
  47. #include <linux/mc146818rtc.h>
  48. #include <asm/tlbflush.h>
  49. #include <asm/desc.h>
  50. #include <asm/arch_hooks.h>
  51. #include <asm/nmi.h>
  52. #include <mach_apic.h>
  53. #include <mach_wakecpu.h>
  54. #include <smpboot_hooks.h>
  55. #include <asm/vmi.h>
  56. #include <asm/mtrr.h>
  57. /* which logical CPU number maps to which CPU (physical APIC ID) */
  58. u16 x86_cpu_to_apicid_init[NR_CPUS] __initdata =
  59. { [0 ... NR_CPUS-1] = BAD_APICID };
  60. void *x86_cpu_to_apicid_early_ptr;
  61. DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID;
  62. EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid);
  63. u16 x86_bios_cpu_apicid_init[NR_CPUS] __initdata
  64. = { [0 ... NR_CPUS-1] = BAD_APICID };
  65. void *x86_bios_cpu_apicid_early_ptr;
  66. DEFINE_PER_CPU(u16, x86_bios_cpu_apicid) = BAD_APICID;
  67. EXPORT_PER_CPU_SYMBOL(x86_bios_cpu_apicid);
  68. u8 apicid_2_node[MAX_APICID];
  69. extern void unmap_cpu_to_logical_apicid(int cpu);
  70. #ifdef CONFIG_HOTPLUG_CPU
  71. void cpu_exit_clear(void)
  72. {
  73. int cpu = raw_smp_processor_id();
  74. idle_task_exit();
  75. cpu_uninit();
  76. irq_ctx_exit(cpu);
  77. cpu_clear(cpu, cpu_callout_map);
  78. cpu_clear(cpu, cpu_callin_map);
  79. unmap_cpu_to_logical_apicid(cpu);
  80. }
  81. #endif
  82. /* Where the IO area was mapped on multiquad, always 0 otherwise */
  83. void *xquad_portio;
  84. #ifdef CONFIG_X86_NUMAQ
  85. EXPORT_SYMBOL(xquad_portio);
  86. #endif