Lines Matching refs:kenv
511 struct kqemu_cpu_state *kenv) in do_syscall() argument
520 env->regs[R_ECX] = kenv->next_eip; in do_syscall()
544 env->regs[R_ECX] = (uint32_t)kenv->next_eip; in do_syscall()
693 struct kqemu_cpu_state kcpu_state, *kenv = &kcpu_state; in kqemu_cpu_exec() local
708 kenv->regs[i] = env->regs[i]; in kqemu_cpu_exec()
709 kenv->eip = env->eip; in kqemu_cpu_exec()
710 kenv->eflags = env->eflags; in kqemu_cpu_exec()
712 kqemu_load_seg(&kenv->segs[i], &env->segs[i]); in kqemu_cpu_exec()
713 kqemu_load_seg(&kenv->ldt, &env->ldt); in kqemu_cpu_exec()
714 kqemu_load_seg(&kenv->tr, &env->tr); in kqemu_cpu_exec()
715 kqemu_load_seg(&kenv->gdt, &env->gdt); in kqemu_cpu_exec()
716 kqemu_load_seg(&kenv->idt, &env->idt); in kqemu_cpu_exec()
717 kenv->cr0 = env->cr[0]; in kqemu_cpu_exec()
718 kenv->cr2 = env->cr[2]; in kqemu_cpu_exec()
719 kenv->cr3 = env->cr[3]; in kqemu_cpu_exec()
720 kenv->cr4 = env->cr[4]; in kqemu_cpu_exec()
721 kenv->a20_mask = env->a20_mask; in kqemu_cpu_exec()
722 kenv->efer = env->efer; in kqemu_cpu_exec()
723 kenv->tsc_offset = 0; in kqemu_cpu_exec()
724 kenv->star = env->star; in kqemu_cpu_exec()
725 kenv->sysenter_cs = env->sysenter_cs; in kqemu_cpu_exec()
726 kenv->sysenter_esp = env->sysenter_esp; in kqemu_cpu_exec()
727 kenv->sysenter_eip = env->sysenter_eip; in kqemu_cpu_exec()
729 kenv->lstar = env->lstar; in kqemu_cpu_exec()
730 kenv->cstar = env->cstar; in kqemu_cpu_exec()
731 kenv->fmask = env->fmask; in kqemu_cpu_exec()
732 kenv->kernelgsbase = env->kernelgsbase; in kqemu_cpu_exec()
735 kenv->dr7 = env->dr[7]; in kqemu_cpu_exec()
736 kenv->dr0 = env->dr[0]; in kqemu_cpu_exec()
737 kenv->dr1 = env->dr[1]; in kqemu_cpu_exec()
738 kenv->dr2 = env->dr[2]; in kqemu_cpu_exec()
739 kenv->dr3 = env->dr[3]; in kqemu_cpu_exec()
741 kenv->dr7 = 0; in kqemu_cpu_exec()
743 kenv->dr6 = env->dr[6]; in kqemu_cpu_exec()
745 kenv->cpl = cpl; in kqemu_cpu_exec()
746 kenv->nb_pages_to_flush = nb_pages_to_flush; in kqemu_cpu_exec()
747 kenv->user_only = (env->kqemu_enabled == 1); in kqemu_cpu_exec()
748 kenv->nb_ram_pages_to_update = nb_ram_pages_to_update; in kqemu_cpu_exec()
750 kenv->nb_modified_ram_pages = nb_modified_ram_pages; in kqemu_cpu_exec()
761 kenv, sizeof(struct kqemu_cpu_state), in kqemu_cpu_exec()
762 kenv, sizeof(struct kqemu_cpu_state), in kqemu_cpu_exec()
764 ret = kenv->retval; in kqemu_cpu_exec()
769 ioctl(kqemu_fd, KQEMU_EXEC, kenv); in kqemu_cpu_exec()
770 ret = kenv->retval; in kqemu_cpu_exec()
778 env->regs[i] = kenv->regs[i]; in kqemu_cpu_exec()
779 env->eip = kenv->eip; in kqemu_cpu_exec()
780 env->eflags = kenv->eflags; in kqemu_cpu_exec()
782 kqemu_save_seg(&env->segs[i], &kenv->segs[i]); in kqemu_cpu_exec()
783 cpu_x86_set_cpl(env, kenv->cpl); in kqemu_cpu_exec()
784 kqemu_save_seg(&env->ldt, &kenv->ldt); in kqemu_cpu_exec()
785 env->cr[0] = kenv->cr0; in kqemu_cpu_exec()
786 env->cr[4] = kenv->cr4; in kqemu_cpu_exec()
787 env->cr[3] = kenv->cr3; in kqemu_cpu_exec()
788 env->cr[2] = kenv->cr2; in kqemu_cpu_exec()
789 env->dr[6] = kenv->dr6; in kqemu_cpu_exec()
791 env->kernelgsbase = kenv->kernelgsbase; in kqemu_cpu_exec()
795 if (kenv->nb_pages_to_flush >= KQEMU_FLUSH_ALL) { in kqemu_cpu_exec()
798 for(i = 0; i < kenv->nb_pages_to_flush; i++) { in kqemu_cpu_exec()
809 if (kenv->nb_ram_pages_to_update > 0) { in kqemu_cpu_exec()
813 if (kenv->nb_modified_ram_pages > 0) { in kqemu_cpu_exec()
814 for(i = 0; i < kenv->nb_modified_ram_pages; i++) { in kqemu_cpu_exec()
868 return do_syscall(env, kenv); in kqemu_cpu_exec()
874 env->exception_next_eip = kenv->next_eip; in kqemu_cpu_exec()
883 env->error_code = kenv->error_code; in kqemu_cpu_exec()