Lines Matching refs:pcb
122 pcb_t pcb = THREAD_TO_PCB(new);
153 if (is_saved_state64(pcb->iss)) {
164 assert(is_saved_state64(pcb->iss));
166 iss64 = (x86_saved_state64_tagged_t *) pcb->iss;
178 /* Interrupt stack is pcb */
182 * Top of temporary sysenter stack points to pcb stack.
206 if ((pcb->cthread_self != 0) || (new->task != kernel_task)) {
207 if ((cdp->cpu_uber.cu_user_gs_base != pcb->cthread_self) || (pcb->cthread_self != rdmsr64(MSR_IA32_KERNEL_GS_BASE))) {
208 cdp->cpu_uber.cu_user_gs_base = pcb->cthread_self;
209 wrmsr64(MSR_IA32_KERNEL_GS_BASE, pcb->cthread_self);
216 assert(is_saved_state32(pcb->iss));
217 iss32compat = (x86_saved_state_compat32_t *) pcb->iss;
230 /* Top of temporary sysenter stack points to pcb stack */
233 /* Interrupt stack is pcb */
241 cdp->cpu_uber_arg_store_valid = (vm_offset_t)&pcb->arg_store_valid;
242 pcb->arg_store_valid = 0;
258 ldtp[sel_idx(USER_CTHREAD)] = pcb->cthread_desc;
259 if (pcb->uldt_selector != 0)
260 ldtp[sel_idx(pcb->uldt_selector)] = pcb->uldt_desc;
261 cdp->cpu_uber.cu_user_gs_base = pcb->cthread_self;
293 ((unsigned long)pcb->iss & PAGE_MASK));
297 pmap_high_map(pcb->iss_pte0, HIGH_CPU_ISS0);
298 pmap_high_map(pcb->iss_pte1, HIGH_CPU_ISS1);
306 * For fast syscall, top of interrupt stack points to pcb stack
312 } else if (is_saved_state64(pcb->iss)) {
323 assert(is_saved_state64(pcb->iss));
325 iss64 = (x86_saved_state64_tagged_t *) pcb->iss;
336 /* Interrupt stack is pcb */
340 * Top of temporary sysenter stack points to pcb stack.
359 assert(is_saved_state32(pcb->iss));
360 iss32compat = (x86_saved_state_compat32_t *) pcb->iss;
373 /* Top of temporary sysenter stack points to pcb stack */
376 /* Interrupt stack is pcb */
384 cdp->cpu_uber_arg_store_valid = UBER64((vm_offset_t)&pcb->arg_store_valid);
385 pcb->arg_store_valid = 0;
402 ldtp[sel_idx(USER_CTHREAD)] = pcb->cthread_desc;
403 if (pcb->uldt_selector != 0)
404 ldtp[sel_idx(pcb->uldt_selector)] = pcb->uldt_desc;
410 cdp->cpu_uber.cu_user_gs_base = pcb->cthread_self;
521 pcb_t pcb = THREAD_TO_PCB(thread);
534 if (pcb->sf == NULL) {
536 pcb->sf = zalloc(iss_zone);
537 if (pcb->sf == NULL)
544 sf64 = (x86_sframe64_t *) pcb->sf;
563 sfc32 = (x86_sframe_compat32_t *)pcb->sf;
581 sf32 = (x86_sframe32_t *) pcb->sf;
588 pcb->iss_pte0 = pte_kernel_rw(kvtophys((vm_offset_t)iss));
590 pcb->iss_pte1 = INTEL_PTE_INVALID;
592 pcb->iss_pte1 = pte_kernel_rw(paddr);
596 pcb->cthread_desc = ldtp[sel_idx(USER_DS)];
597 pcb->uldt_desc = ldtp[sel_idx(USER_DS)];
613 pcb->iss = iss;
615 simple_lock_init(&pcb->lock, 0);
617 pcb->arg_store_valid = 0;
618 pcb->cthread_self = 0;
619 pcb->uldt_selector = 0;
624 if ((pcb->cthread_desc.access & ACC_P) == 0) {
627 pcb->cthread_desc = ldtp[sel_idx(USER_DS)];
640 register pcb_t pcb = THREAD_TO_PCB(thread);
642 if (pcb->ifps != 0)
643 fpu_free(pcb->ifps);
644 if (pcb->sf != 0) {
645 zfree(iss_zone, pcb->sf);
646 pcb->sf = 0;
648 if (pcb->ids) {
649 zfree(ids_zone, pcb->ids);
650 pcb->ids = NULL;