Lines Matching defs:env

19 int cpu_get_pic_interrupt(CPUState *env)
24 uint64_t cpu_get_tsc(CPUState *env)
105 static inline void pushw(CPUState *env, int val)
107 env->regs[R_ESP] = (env->regs[R_ESP] & ~0xffff) | ((env->regs[R_ESP] - 2) & 0xffff);
108 *(uint16_t *)seg_to_linear(env->segs[R_SS].selector, env->regs[R_ESP]) = val;
125 CPUState *env;
167 env = cpu_init("qemu32");
169 cpu_x86_set_cpl(env, 3);
171 env->cr[0] = CR0_PG_MASK | CR0_WP_MASK | CR0_PE_MASK;
173 env->hflags |= HF_PE_MASK | VM_MASK;
177 env->eflags |= IF_MASK | VM_MASK;
180 env->eip = 0x100;
181 env->regs[R_ESP] = 0xfffe;
184 cpu_x86_load_seg_cache(env, R_CS, seg,
186 cpu_x86_load_seg_cache(env, R_SS, seg,
188 cpu_x86_load_seg_cache(env, R_DS, seg,
190 cpu_x86_load_seg_cache(env, R_ES, seg,
192 cpu_x86_load_seg_cache(env, R_FS, seg,
194 cpu_x86_load_seg_cache(env, R_GS, seg,
198 env->idt.base = (unsigned long)idt_table;
199 env->idt.limit = sizeof(idt_table) - 1;
222 *seg_to_linear(env->segs[R_CS].selector, 0) = 0xb4; /* mov ah, $0 */
223 *seg_to_linear(env->segs[R_CS].selector, 1) = 0x00;
224 *seg_to_linear(env->segs[R_CS].selector, 2) = 0xcd; /* int $0x21 */
225 *seg_to_linear(env->segs[R_CS].selector, 3) = 0x21;
226 pushw(env, 0x0000);
229 env->regs[R_ESI] = 0x100;
230 env->regs[R_ECX] = 0xff;
231 env->regs[R_EBP] = 0x0900;
232 env->regs[R_EDI] = 0xfffe;
239 ret = cpu_x86_exec(env);
244 int_num = *(uint8_t *)(env->segs[R_CS].base + env->eip + 1);
247 ah = (env->regs[R_EAX] >> 8) & 0xff;
253 uint8_t c = env->regs[R_EDX];
261 c = *seg_to_linear(env->segs[R_DS].selector, env->regs[R_EAX]);
266 env->regs[R_EAX] = (env->regs[R_EAX] & ~0xff) | '$';
272 cpu_dump_state(env, stderr, fprintf, 0);
275 env->eip += 2;
280 cpu_dump_state(env, stderr, fprintf, 0);