Lines Matching defs:cdp
416 cpu_desc_init(cpu_data_t *cdp)
418 cpu_desc_index_t *cdi = &cdp->cpu_desc_index;
420 if (cdp == &cpu_data_master) {
465 cpu_desc_table_t *cdt = (cpu_desc_table_t *) cdp->cpu_desc_tablep;
470 cdp->cpu_number,
495 cdp->cpu_number,
497 (vm_offset_t) cdp->cpu_ldtp,
505 bcopy((char *)master_ldt, (char *)cdp->cpu_ldtp, sizeof(master_ldt));
524 cdt->gdt[sel_idx(CPU_DATA_GS)].offset = (vm_offset_t) cdp;
530 cpu_userwindow_init(cdp->cpu_number);
531 cpu_physwindow_init(cdp->cpu_number);
538 cpu_desc_init64(cpu_data_t *cdp)
540 cpu_desc_index_t *cdi = &cdp->cpu_desc_index;
542 if (cdp == &cpu_data_master) {
584 cpu_desc_table64_t *cdt = (cpu_desc_table64_t *) cdp->cpu_desc_tablep;
598 cdi->cdi_ldt = cdp->cpu_ldtp;
607 bcopy((char *)master_ldt, (char *)cdp->cpu_ldtp, sizeof(master_ldt));
634 cdt->gdt[sel_idx(CPU_DATA_GS)].offset = (vm_offset_t) cdp;
638 cpu_userwindow_init(cdp->cpu_number);
639 cpu_physwindow_init(cdp->cpu_number);
650 cpu_desc_load(cpu_data_t *cdp)
652 cpu_desc_index_t *cdi = &cdp->cpu_desc_index;
654 cdi->cdi_idt.size = 0x1000 + cdp->cpu_number;
668 cpu_desc_load64(cpu_data_t *cdp)
670 cpu_desc_index_t *cdi = &cdp->cpu_desc_index;
686 idtptr64.length = 0x1000 + cdp->cpu_number;
697 cdi->cdi_idt.size = 0x1000 + cdp->cpu_number;
704 wrmsr64(MSR_IA32_GS_BASE, (uintptr_t) cdp);
705 wrmsr64(MSR_IA32_KERNEL_GS_BASE, (uintptr_t) cdp);
718 fast_syscall_init(__unused cpu_data_t *cdp)
730 fast_syscall_init64(__unused cpu_data_t *cdp)
760 wrmsr64(MSR_IA32_KERNEL_GS_BASE, UBER64(cdp));
774 cpu_data_t *cdp;
778 cdp = cpu_datap(0);
779 if (cdp->cpu_processor == NULL) {
781 cdp->cpu_processor = cpu_processor_alloc(TRUE);
783 cdp->cpu_pmap = pmap_cpu_alloc(TRUE);
786 return cdp;
792 ret = kmem_alloc(kernel_map, (vm_offset_t *) &cdp, sizeof(cpu_data_t));
797 bzero((void*) cdp, sizeof(cpu_data_t));
798 cdp->cpu_this = cdp;
801 cdp->cpu_is64bit = cpu_mode_is64bit();
807 (vm_offset_t *) &cdp->cpu_int_stack_top,
813 bzero((void*) cdp->cpu_int_stack_top, INTSTACK_SIZE);
814 cdp->cpu_int_stack_top += INTSTACK_SIZE;
822 (vm_offset_t *) &cdp->cpu_desc_tablep,
823 cdp->cpu_is64bit ? sizeof(cpu_desc_table64_t)
834 (vm_offset_t *) &cdp->cpu_ldtp,
843 mca_cpu_alloc(cdp);
848 cpu_data_ptr[real_ncpus] = cdp;
849 cdp->cpu_number = real_ncpus;
853 cdp->cpu_nanotime = &pal_rtc_nanotime_info;
858 cdp->cpu_number, cdp, cdp->cpu_desc_tablep, cdp->cpu_ldtp,
859 (long)(cdp->cpu_int_stack_top - INTSTACK_SIZE), (long)(cdp->cpu_int_stack_top));
861 return cdp;
864 if (cdp) {
865 if (cdp->cpu_desc_tablep)
866 kfree((void *) cdp->cpu_desc_tablep,
867 sizeof(*cdp->cpu_desc_tablep));
868 if (cdp->cpu_int_stack_top)
869 kfree((void *) (cdp->cpu_int_stack_top - INTSTACK_SIZE),
871 kfree((void *) cdp, sizeof(*cdp));
957 cpu_data_t *cdp = cpu_data_ptr[cpu];
1001 cdp->cpu_copywindow_base = user_window;
1006 cdp->cpu_copywindow_pdp = pmap_pde(kernel_pmap, user_window);
1009 cpu_desc_index_t *cdi = &cdp->cpu_desc_index;
1020 cpu_data_t *cdp = cpu_data_ptr[cpu];
1021 vm_offset_t phys_window = cdp->cpu_physwindow_base;
1037 cdp->cpu_physwindow_base = phys_window;
1038 cdp->cpu_physwindow_ptep = vtopte(phys_window);
1041 cpu_desc_index_t *cdi = &cdp->cpu_desc_index;
1054 cpu_mode_init(cpu_data_t *cdp)
1057 if (cdp->cpu_is64bit) {
1058 cpu_IA32e_enable(cdp);
1059 cpu_desc_load64(cdp);
1060 fast_syscall_init64(cdp);
1062 fast_syscall_init(cdp);
1065 fast_syscall_init64(cdp);
1080 cpu_data_t *cdp;
1090 ret = kmem_alloc(kernel_map, (vm_offset_t *) &cdp, sizeof(cpu_data_t));
1096 bcopy((void *) &cpu_data_master, (void*) cdp, sizeof(cpu_data_t));
1097 cdp->cpu_this = cdp;
1098 cdp->cpu_int_stack_top = stack;
1099 timer_call_initialize_queue(&cdp->rtclock_timer.queue);
1102 (void *) cdp, (void *) stack);
1108 cpu_data_ptr[0] = cdp;
1109 wrmsr64(MSR_IA32_GS_BASE, (uintptr_t) cdp);
1110 wrmsr64(MSR_IA32_KERNEL_GS_BASE, (uintptr_t) cdp);