Changeset View
Changeset View
Standalone View
Standalone View
head/sys/amd64/amd64/machdep.c
Show First 20 Lines • Show All 1,789 Lines • ▼ Show 20 Lines | if (use_xsave) { | ||||
xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + | xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + | ||||
1); | 1); | ||||
xhdr->xstate_bv = xsave_mask; | xhdr->xstate_bv = xsave_mask; | ||||
} | } | ||||
/* make an initial tss so cpu can get interrupt stack on syscall! */ | /* make an initial tss so cpu can get interrupt stack on syscall! */ | ||||
rsp0 = (vm_offset_t)thread0.td_pcb; | rsp0 = (vm_offset_t)thread0.td_pcb; | ||||
/* Ensure the stack is aligned to 16 bytes */ | /* Ensure the stack is aligned to 16 bytes */ | ||||
rsp0 &= ~0xFul; | rsp0 &= ~0xFul; | ||||
common_tss[0].tss_rsp0 = pti ? ((vm_offset_t)PCPU_PTR(pti_stack) + | common_tss[0].tss_rsp0 = rsp0; | ||||
PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful : rsp0; | |||||
PCPU_SET(rsp0, rsp0); | PCPU_SET(rsp0, rsp0); | ||||
PCPU_SET(pti_rsp0, ((vm_offset_t)PCPU_PTR(pti_stack) + | |||||
PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful); | |||||
PCPU_SET(curpcb, thread0.td_pcb); | PCPU_SET(curpcb, thread0.td_pcb); | ||||
/* transfer to user mode */ | /* transfer to user mode */ | ||||
_ucodesel = GSEL(GUCODE_SEL, SEL_UPL); | _ucodesel = GSEL(GUCODE_SEL, SEL_UPL); | ||||
_udatasel = GSEL(GUDATA_SEL, SEL_UPL); | _udatasel = GSEL(GUDATA_SEL, SEL_UPL); | ||||
_ucode32sel = GSEL(GUCODE32_SEL, SEL_UPL); | _ucode32sel = GSEL(GUCODE32_SEL, SEL_UPL); | ||||
_ufssel = GSEL(GUFS32_SEL, SEL_UPL); | _ufssel = GSEL(GUFS32_SEL, SEL_UPL); | ||||
▲ Show 20 Lines • Show All 816 Lines • Show Last 20 Lines |