smpcommon.c 585 B

12345678910111213141516171819202122232425
  1. /*
  2. * SMP stuff which is common to all sub-architectures.
  3. */
  4. #include <linux/module.h>
  5. #include <asm/smp.h>
  6. #include <asm/sections.h>
  7. #ifdef CONFIG_X86_32
  8. /*
  9. * Initialize the CPU's GDT. This is either the boot CPU doing itself
  10. * (still using the master per-cpu area), or a CPU doing it for a
  11. * secondary which will soon come up.
  12. */
  13. __cpuinit void init_gdt(int cpu)
  14. {
  15. struct desc_struct gdt;
  16. pack_descriptor(&gdt, __per_cpu_offset[cpu], 0xFFFFF,
  17. 0x2 | DESCTYPE_S, 0x8);
  18. gdt.s = 1;
  19. write_gdt_entry(get_cpu_gdt_table(cpu),
  20. GDT_ENTRY_PERCPU, &gdt, DESCTYPE_S);
  21. }
  22. #endif