Lines Matching refs:selector
69 uint32_t *e2_ptr, int selector, in load_segment_ra() argument
76 if (selector & 0x4) { in load_segment_ra()
81 index = selector & ~7; in load_segment_ra()
92 uint32_t *e2_ptr, int selector) in load_segment() argument
94 return load_segment_ra(env, e1_ptr, e2_ptr, selector, 0); in load_segment()
122 static inline void load_seg_vm(CPUX86State *env, int seg, int selector) in load_seg_vm() argument
124 selector &= 0xffff; in load_seg_vm()
126 cpu_x86_load_seg_cache(env, seg, selector, (selector << 4), 0xffff, in load_seg_vm()
162 raise_exception_err_ra(env, EXCP0A_TSS, env->tr.selector & 0xfffc, retaddr); in get_ss_esp_from_tss()
173 static void tss_load_seg(CPUX86State *env, X86Seg seg_reg, int selector, in tss_load_seg() argument
179 if ((selector & 0xfffc) != 0) { in tss_load_seg()
180 if (load_segment_ra(env, &e1, &e2, selector, retaddr) != 0) { in tss_load_seg()
181 raise_exception_err_ra(env, EXCP0A_TSS, selector & 0xfffc, retaddr); in tss_load_seg()
184 raise_exception_err_ra(env, EXCP0A_TSS, selector & 0xfffc, retaddr); in tss_load_seg()
186 rpl = selector & 3; in tss_load_seg()
190 raise_exception_err_ra(env, EXCP0A_TSS, selector & 0xfffc, retaddr); in tss_load_seg()
193 raise_exception_err_ra(env, EXCP0A_TSS, selector & 0xfffc, retaddr); in tss_load_seg()
198 raise_exception_err_ra(env, EXCP0A_TSS, selector & 0xfffc, retaddr); in tss_load_seg()
201 raise_exception_err_ra(env, EXCP0A_TSS, selector & 0xfffc, retaddr); in tss_load_seg()
206 raise_exception_err_ra(env, EXCP0A_TSS, selector & 0xfffc, retaddr); in tss_load_seg()
211 raise_exception_err_ra(env, EXCP0A_TSS, selector & 0xfffc, retaddr); in tss_load_seg()
216 raise_exception_err_ra(env, EXCP0B_NOSEG, selector & 0xfffc, retaddr); in tss_load_seg()
218 cpu_x86_load_seg_cache(env, seg_reg, selector, in tss_load_seg()
224 raise_exception_err_ra(env, EXCP0A_TSS, selector & 0xfffc, retaddr); in tss_load_seg()
359 tss_set_busy(env, env->tr.selector, 0, retaddr); in switch_tss_ra()
381 env->segs[i].selector, retaddr); in switch_tss_ra()
397 env->segs[i].selector, retaddr); in switch_tss_ra()
405 cpu_stw_kernel_ra(env, tss_base, env->tr.selector, retaddr); in switch_tss_ra()
418 env->tr.selector = tss_selector; in switch_tss_ra()
454 env->ldt.selector = new_ldt & ~4; in switch_tss_ra()
605 int type, dpl, selector, ss_dpl, cpl; in do_interrupt_protected() local
682 selector = e1 >> 16; in do_interrupt_protected()
684 if ((selector & 0xfffc) == 0) { in do_interrupt_protected()
687 if (load_segment(env, &e1, &e2, selector) != 0) { in do_interrupt_protected()
688 raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); in do_interrupt_protected()
691 raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); in do_interrupt_protected()
695 raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); in do_interrupt_protected()
698 raise_exception_err(env, EXCP0B_NOSEG, selector & 0xfffc); in do_interrupt_protected()
733 raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); in do_interrupt_protected()
754 PUSHL(ssp, esp, sp_mask, env->segs[R_GS].selector); in do_interrupt_protected()
755 PUSHL(ssp, esp, sp_mask, env->segs[R_FS].selector); in do_interrupt_protected()
756 PUSHL(ssp, esp, sp_mask, env->segs[R_DS].selector); in do_interrupt_protected()
757 PUSHL(ssp, esp, sp_mask, env->segs[R_ES].selector); in do_interrupt_protected()
759 PUSHL(ssp, esp, sp_mask, env->segs[R_SS].selector); in do_interrupt_protected()
763 PUSHL(ssp, esp, sp_mask, env->segs[R_CS].selector); in do_interrupt_protected()
771 PUSHW(ssp, esp, sp_mask, env->segs[R_GS].selector); in do_interrupt_protected()
772 PUSHW(ssp, esp, sp_mask, env->segs[R_FS].selector); in do_interrupt_protected()
773 PUSHW(ssp, esp, sp_mask, env->segs[R_DS].selector); in do_interrupt_protected()
774 PUSHW(ssp, esp, sp_mask, env->segs[R_ES].selector); in do_interrupt_protected()
776 PUSHW(ssp, esp, sp_mask, env->segs[R_SS].selector); in do_interrupt_protected()
780 PUSHW(ssp, esp, sp_mask, env->segs[R_CS].selector); in do_interrupt_protected()
806 selector = (selector & ~3) | dpl; in do_interrupt_protected()
807 cpu_x86_load_seg_cache(env, R_CS, selector, in do_interrupt_protected()
848 raise_exception_err(env, EXCP0A_TSS, env->tr.selector & 0xfffc); in get_rsp_from_tss()
869 int type, dpl, selector, cpl, ist; in do_interrupt64() local
912 selector = e1 >> 16; in do_interrupt64()
915 if ((selector & 0xfffc) == 0) { in do_interrupt64()
919 if (load_segment(env, &e1, &e2, selector) != 0) { in do_interrupt64()
920 raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); in do_interrupt64()
923 raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); in do_interrupt64()
927 raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); in do_interrupt64()
930 raise_exception_err(env, EXCP0B_NOSEG, selector & 0xfffc); in do_interrupt64()
933 raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); in do_interrupt64()
946 raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); in do_interrupt64()
953 PUSHQ(esp, env->segs[R_SS].selector); in do_interrupt64()
956 PUSHQ(esp, env->segs[R_CS].selector); in do_interrupt64()
974 selector = (selector & ~3) | dpl; in do_interrupt64()
975 cpu_x86_load_seg_cache(env, R_CS, selector, in do_interrupt64()
985 int cpl, selector; in helper_sysret() local
994 selector = (env->star >> 48) & 0xffff; in helper_sysret()
1001 cpu_x86_load_seg_cache(env, R_CS, (selector + 16) | 3, in helper_sysret()
1009 cpu_x86_load_seg_cache(env, R_CS, selector | 3, in helper_sysret()
1016 cpu_x86_load_seg_cache(env, R_SS, (selector + 8) | 3, in helper_sysret()
1025 cpu_x86_load_seg_cache(env, R_CS, selector | 3, in helper_sysret()
1031 cpu_x86_load_seg_cache(env, R_SS, (selector + 8) | 3, in helper_sysret()
1045 int selector; in do_interrupt_real() local
1056 selector = cpu_lduw_kernel(env, ptr + 2); in do_interrupt_real()
1064 old_cs = env->segs[R_CS].selector; in do_interrupt_real()
1073 env->segs[R_CS].selector = selector; in do_interrupt_real()
1074 env->segs[R_CS].base = (selector << 4); in do_interrupt_real()
1096 env->segs[R_CS].selector, env->eip, in do_interrupt_all()
1098 env->segs[R_SS].selector, env->regs[R_ESP]); in do_interrupt_all()
1165 void helper_lldt(CPUX86State *env, int selector) in helper_lldt() argument
1172 selector &= 0xffff; in helper_lldt()
1173 if ((selector & 0xfffc) == 0) { in helper_lldt()
1178 if (selector & 0x4) { in helper_lldt()
1179 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_lldt()
1182 index = selector & ~7; in helper_lldt()
1192 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_lldt()
1198 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_lldt()
1201 raise_exception_err_ra(env, EXCP0B_NOSEG, selector & 0xfffc, GETPC()); in helper_lldt()
1216 env->ldt.selector = selector; in helper_lldt()
1219 void helper_ltr(CPUX86State *env, int selector) in helper_ltr() argument
1226 selector &= 0xffff; in helper_ltr()
1227 if ((selector & 0xfffc) == 0) { in helper_ltr()
1233 if (selector & 0x4) { in helper_ltr()
1234 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_ltr()
1237 index = selector & ~7; in helper_ltr()
1247 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_ltr()
1255 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_ltr()
1258 raise_exception_err_ra(env, EXCP0B_NOSEG, selector & 0xfffc, GETPC()); in helper_ltr()
1267 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_ltr()
1279 env->tr.selector = selector; in helper_ltr()
1283 void helper_load_seg(CPUX86State *env, int seg_reg, int selector) in helper_load_seg() argument
1291 selector &= 0xffff; in helper_load_seg()
1293 if ((selector & 0xfffc) == 0) { in helper_load_seg()
1302 cpu_x86_load_seg_cache(env, seg_reg, selector, 0, 0, 0); in helper_load_seg()
1305 if (selector & 0x4) { in helper_load_seg()
1310 index = selector & ~7; in helper_load_seg()
1312 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_load_seg()
1319 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_load_seg()
1321 rpl = selector & 3; in helper_load_seg()
1326 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_load_seg()
1329 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_load_seg()
1334 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_load_seg()
1340 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_load_seg()
1347 raise_exception_err_ra(env, EXCP0C_STACK, selector & 0xfffc, GETPC()); in helper_load_seg()
1349 raise_exception_err_ra(env, EXCP0B_NOSEG, selector & 0xfffc, GETPC()); in helper_load_seg()
1359 cpu_x86_load_seg_cache(env, seg_reg, selector, in helper_load_seg()
1365 selector, (unsigned long)sc->base, sc->limit, sc->flags); in helper_load_seg()
1521 PUSHL_RA(ssp, esp, esp_mask, env->segs[R_CS].selector, GETPC()); in helper_lcall_real()
1524 PUSHW_RA(ssp, esp, esp_mask, env->segs[R_CS].selector, GETPC()); in helper_lcall_real()
1530 env->segs[R_CS].selector = new_cs; in helper_lcall_real()
1539 uint32_t e1, e2, cpl, dpl, rpl, selector, param_count; in helper_lcall_protected() local
1585 PUSHQ_RA(rsp, env->segs[R_CS].selector, GETPC()); in helper_lcall_protected()
1600 PUSHL_RA(ssp, sp, sp_mask, env->segs[R_CS].selector, GETPC()); in helper_lcall_protected()
1603 PUSHW_RA(ssp, sp, sp_mask, env->segs[R_CS].selector, GETPC()); in helper_lcall_protected()
1656 selector = e1 >> 16; in helper_lcall_protected()
1674 if ((selector & 0xfffc) == 0) { in helper_lcall_protected()
1678 if (load_segment_ra(env, &e1, &e2, selector, GETPC()) != 0) { in helper_lcall_protected()
1679 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_lcall_protected()
1682 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_lcall_protected()
1686 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_lcall_protected()
1691 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_lcall_protected()
1694 raise_exception_err_ra(env, EXCP0D_GPF, selector & 0xfffc, GETPC()); in helper_lcall_protected()
1700 raise_exception_err_ra(env, EXCP0B_NOSEG, selector & 0xfffc, GETPC()); in helper_lcall_protected()
1756 PUSHQ_RA(sp, env->segs[R_SS].selector, GETPC()); in helper_lcall_protected()
1762 PUSHL_RA(ssp, sp, sp_mask, env->segs[R_SS].selector, GETPC()); in helper_lcall_protected()
1771 PUSHW_RA(ssp, sp, sp_mask, env->segs[R_SS].selector, GETPC()); in helper_lcall_protected()
1792 PUSHQ_RA(sp, env->segs[R_CS].selector, GETPC()); in helper_lcall_protected()
1797 PUSHL_RA(ssp, sp, sp_mask, env->segs[R_CS].selector, GETPC()); in helper_lcall_protected()
1800 PUSHW_RA(ssp, sp, sp_mask, env->segs[R_CS].selector, GETPC()); in helper_lcall_protected()
1821 selector = (selector & ~3) | dpl; in helper_lcall_protected()
1822 cpu_x86_load_seg_cache(env, R_CS, selector, in helper_lcall_protected()
1854 env->segs[R_CS].selector = new_cs; in helper_iret_real()
1880 (env->segs[seg_reg].selector & 0xfffc) == 0) { in validate_seg()
2229 uint32_t e1, e2, eflags, selector; in helper_lsl() local
2232 selector = selector1 & 0xffff; in helper_lsl()
2234 if ((selector & 0xfffc) == 0) { in helper_lsl()
2237 if (load_segment_ra(env, &e1, &e2, selector, GETPC()) != 0) { in helper_lsl()
2240 rpl = selector & 3; in helper_lsl()
2276 uint32_t e1, e2, eflags, selector; in helper_lar() local
2279 selector = selector1 & 0xffff; in helper_lar()
2281 if ((selector & 0xfffc) == 0) { in helper_lar()
2284 if (load_segment_ra(env, &e1, &e2, selector, GETPC()) != 0) { in helper_lar()
2287 rpl = selector & 3; in helper_lar()
2325 uint32_t e1, e2, eflags, selector; in helper_verr() local
2328 selector = selector1 & 0xffff; in helper_verr()
2330 if ((selector & 0xfffc) == 0) { in helper_verr()
2333 if (load_segment_ra(env, &e1, &e2, selector, GETPC()) != 0) { in helper_verr()
2339 rpl = selector & 3; in helper_verr()
2363 uint32_t e1, e2, eflags, selector; in helper_verw() local
2366 selector = selector1 & 0xffff; in helper_verw()
2368 if ((selector & 0xfffc) == 0) { in helper_verw()
2371 if (load_segment_ra(env, &e1, &e2, selector, GETPC()) != 0) { in helper_verw()
2377 rpl = selector & 3; in helper_verw()