Lines Matching refs:sregs
726 /* The sregs has been synced with HAX kernel already before this call */
727 static int hax_get_segments(CPUX86State *env, struct vcpu_state_t *sregs)
729 get_seg(&env->segs[R_CS], &sregs->_cs);
730 get_seg(&env->segs[R_DS], &sregs->_ds);
731 get_seg(&env->segs[R_ES], &sregs->_es);
732 get_seg(&env->segs[R_FS], &sregs->_fs);
733 get_seg(&env->segs[R_GS], &sregs->_gs);
734 get_seg(&env->segs[R_SS], &sregs->_ss);
736 get_seg(&env->tr, &sregs->_tr);
737 get_seg(&env->ldt, &sregs->_ldt);
738 env->idt.limit = sregs->_idt.limit;
739 env->idt.base = sregs->_idt.base;
740 env->gdt.limit = sregs->_gdt.limit;
741 env->gdt.base = sregs->_gdt.base;
745 static int hax_set_segments(CPUX86State *env, struct vcpu_state_t *sregs)
748 set_v8086_seg(&sregs->_cs, &env->segs[R_CS]);
749 set_v8086_seg(&sregs->_ds, &env->segs[R_DS]);
750 set_v8086_seg(&sregs->_es, &env->segs[R_ES]);
751 set_v8086_seg(&sregs->_fs, &env->segs[R_FS]);
752 set_v8086_seg(&sregs->_gs, &env->segs[R_GS]);
753 set_v8086_seg(&sregs->_ss, &env->segs[R_SS]);
755 set_seg(&sregs->_cs, &env->segs[R_CS]);
756 set_seg(&sregs->_ds, &env->segs[R_DS]);
757 set_seg(&sregs->_es, &env->segs[R_ES]);
758 set_seg(&sregs->_fs, &env->segs[R_FS]);
759 set_seg(&sregs->_gs, &env->segs[R_GS]);
760 set_seg(&sregs->_ss, &env->segs[R_SS]);
764 sregs->_ss.selector = (sregs->_ss.selector & ~3) |
765 (sregs->_cs.selector & 3);
766 sregs->_ss.dpl = sregs->_ss.selector & 3;
770 set_seg(&sregs->_tr, &env->tr);
771 set_seg(&sregs->_ldt, &env->ldt);
772 sregs->_idt.limit = env->idt.limit;
773 sregs->_idt.base = env->idt.base;
774 sregs->_gdt.limit = env->gdt.limit;
775 sregs->_gdt.base = env->gdt.base;