Changeset View
Changeset View
Standalone View
Standalone View
head/sys/amd64/amd64/mp_machdep.c
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
#include <sys/sched.h> | #include <sys/sched.h> | ||||
#include <sys/smp.h> | #include <sys/smp.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_param.h> | #include <vm/vm_param.h> | ||||
#include <vm/pmap.h> | #include <vm/pmap.h> | ||||
#include <vm/vm_kern.h> | #include <vm/vm_kern.h> | ||||
#include <vm/vm_map.h> | |||||
#include <vm/vm_extern.h> | #include <vm/vm_extern.h> | ||||
#include <x86/apicreg.h> | #include <x86/apicreg.h> | ||||
#include <machine/clock.h> | #include <machine/clock.h> | ||||
#include <machine/cputypes.h> | #include <machine/cputypes.h> | ||||
#include <machine/cpufunc.h> | #include <machine/cpufunc.h> | ||||
#include <x86/mca.h> | #include <x86/mca.h> | ||||
#include <machine/md_var.h> | #include <machine/md_var.h> | ||||
▲ Show 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | init_secondary(void) | ||||
pc->pc_pti_rsp0 = (((vm_offset_t)&pc->pc_pti_stack + | pc->pc_pti_rsp0 = (((vm_offset_t)&pc->pc_pti_stack + | ||||
PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful); | PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful); | ||||
pc->pc_tss = (struct system_segment_descriptor *)&gdt[NGDT * cpu + | pc->pc_tss = (struct system_segment_descriptor *)&gdt[NGDT * cpu + | ||||
GPROC0_SEL]; | GPROC0_SEL]; | ||||
pc->pc_fs32p = &gdt[NGDT * cpu + GUFS32_SEL]; | pc->pc_fs32p = &gdt[NGDT * cpu + GUFS32_SEL]; | ||||
pc->pc_gs32p = &gdt[NGDT * cpu + GUGS32_SEL]; | pc->pc_gs32p = &gdt[NGDT * cpu + GUGS32_SEL]; | ||||
pc->pc_ldt = (struct system_segment_descriptor *)&gdt[NGDT * cpu + | pc->pc_ldt = (struct system_segment_descriptor *)&gdt[NGDT * cpu + | ||||
GUSERLDT_SEL]; | GUSERLDT_SEL]; | ||||
pc->pc_curpmap = kernel_pmap; | |||||
pc->pc_pcid_gen = 1; | pc->pc_pcid_gen = 1; | ||||
pc->pc_pcid_next = PMAP_PCID_KERN + 1; | pc->pc_pcid_next = PMAP_PCID_KERN + 1; | ||||
common_tss[cpu].tss_rsp0 = 0; | common_tss[cpu].tss_rsp0 = 0; | ||||
/* Save the per-cpu pointer for use by the NMI handler. */ | /* Save the per-cpu pointer for use by the NMI handler. */ | ||||
np = ((struct nmi_pcpu *) &nmi_stack[PAGE_SIZE]) - 1; | np = ((struct nmi_pcpu *) &nmi_stack[PAGE_SIZE]) - 1; | ||||
np->np_pcpu = (register_t) pc; | np->np_pcpu = (register_t) pc; | ||||
Show All 28 Lines | init_secondary(void) | ||||
/* signal our startup to the BSP. */ | /* signal our startup to the BSP. */ | ||||
mp_naps++; | mp_naps++; | ||||
/* Spin until the BSP releases the AP's. */ | /* Spin until the BSP releases the AP's. */ | ||||
while (atomic_load_acq_int(&aps_ready) == 0) | while (atomic_load_acq_int(&aps_ready) == 0) | ||||
ia32_pause(); | ia32_pause(); | ||||
pmap_activate_boot(vmspace_pmap(proc0.p_vmspace)); | |||||
init_secondary_tail(); | init_secondary_tail(); | ||||
} | } | ||||
/******************************************************************* | /******************************************************************* | ||||
* local functions and data | * local functions and data | ||||
*/ | */ | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 327 Lines • Show Last 20 Lines |