SMP - We boot APs

- kernel detects CPUs by searching ACPI tables for local apic nodes

- each CPU has its own TSS that points to its own stack. All cpus boot
  on the same boot stack (in sequence) but switch to its private stack
  as soon as they can.

- final booting code in main() placed in bsp_finish_booting() which is
  executed only after the BSP switches to its final stack

- apic functions to send startup interrupts

- assembler functions to handle CPU features not needed for single cpu
  mode like memory barries, HT detection etc.

- new files kernel/smp.[ch], kernel/arch/i386/arch_smp.c and
  kernel/arch/i386/include/arch_smp.h

- 16-bit trampoline code for the APs. It is executed by each AP after
  receiving startup IPIs it brings up the CPUs to 32bit mode and let
  them spin in an infinite loop so they don't do any damage.

- implementation of kernel spinlock

- CONFIG_SMP and CONFIG_MAX_CPUS set by the build system
This commit is contained in:
Tomas Hruby
2010-09-15 14:09:52 +00:00
parent 13a0d5fa5e
commit 62c666566e
35 changed files with 1158 additions and 158 deletions

View File

@@ -12,9 +12,10 @@
* (non-zero) is set in monitor
*/
#define CONFIG_WATCHDOG
/* We only support 1 cpu now */
#ifndef CONFIG_MAX_CPUS
#define CONFIG_MAX_CPUS 1
#define cpuid 0
#endif
/* OXPCIe952 PCIe with 2 UARTs in-kernel support */
#define CONFIG_OXPCIE 0
@@ -56,6 +57,17 @@
#include "debug.h" /* debugging, MUST be last kernel header */
#include "cpulocals.h"
#ifndef CONFIG_SMP
/* We only support 1 cpu now */
#define CONFIG_MAX_CPUS 1
#define cpuid 0
#else
#include "smp.h"
#endif
#endif /* __ASSEMBLY__ */
#endif /* KERNEL_H */