Lines Matching +full:cs +full:- +full:setup

23 #include "signal-common.h"
32 env->cr[0] = CR0_PG_MASK | CR0_WP_MASK | CR0_PE_MASK; in target_cpu_init()
33 env->hflags |= HF_PE_MASK | HF_CPL_MASK; in target_cpu_init()
34 if (env->features[FEAT_1_EDX] & CPUID_SSE) { in target_cpu_init()
35 env->cr[4] |= CR4_OSFXSR_MASK; in target_cpu_init()
36 env->hflags |= HF_OSFXSR_MASK; in target_cpu_init()
39 /* flags setup : we activate the IRQs by default as in user mode */ in target_cpu_init()
40 env->eflags |= IF_MASK; in target_cpu_init()
42 /* register setup */ in target_cpu_init()
43 env->regs[R_EAX] = regs->eax; in target_cpu_init()
44 env->regs[R_EBX] = regs->ebx; in target_cpu_init()
45 env->regs[R_ECX] = regs->ecx; in target_cpu_init()
46 env->regs[R_EDX] = regs->edx; in target_cpu_init()
47 env->regs[R_ESI] = regs->esi; in target_cpu_init()
48 env->regs[R_EDI] = regs->edi; in target_cpu_init()
49 env->regs[R_EBP] = regs->ebp; in target_cpu_init()
50 env->regs[R_ESP] = regs->esp; in target_cpu_init()
51 env->eip = regs->eip; in target_cpu_init()
53 /* interrupt setup */ in target_cpu_init()
54 env->idt.limit = 255; in target_cpu_init()
56 env->idt.base = target_mmap(0, sizeof(uint64_t) * (env->idt.limit + 1), in target_cpu_init()
57 PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in target_cpu_init()
58 bsd_i386_set_idt_base(env->idt.base); in target_cpu_init()
81 /* segment setup */ in target_cpu_init()
82 env->gdt.base = target_mmap(0, sizeof(uint64_t) * TARGET_GDT_ENTRIES, in target_cpu_init()
83 PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in target_cpu_init()
84 env->gdt.limit = sizeof(uint64_t) * TARGET_GDT_ENTRIES - 1; in target_cpu_init()
85 gdt_table = g2h_untagged(env->gdt.base); in target_cpu_init()
102 env->segs[R_FS].selector = 0; in target_cpu_init()
107 CPUState *cs = env_cpu(env); in target_cpu_loop() local
113 cpu_exec_start(cs); in target_cpu_loop()
114 trapnr = cpu_exec(cs); in target_cpu_loop()
115 cpu_exec_end(cs); in target_cpu_loop()
116 process_queued_cpu_work(cs); in target_cpu_loop()
121 abi_ulong params = (abi_ulong) env->regs[R_ESP] + in target_cpu_loop()
123 int32_t syscall_nr = env->regs[R_EAX]; in target_cpu_loop()
148 env->regs[R_EAX] = do_freebsd_syscall(env, in target_cpu_loop()
159 if (((abi_ulong)env->regs[R_EAX]) >= (abi_ulong)(-515)) { in target_cpu_loop()
160 env->regs[R_EAX] = -env->regs[R_EAX]; in target_cpu_loop()
161 env->eflags |= CC_C; in target_cpu_loop()
163 env->eflags &= ~CC_C; in target_cpu_loop()
176 cpu_exec_step_atomic(cs); in target_cpu_loop()
180 pc = env->segs[R_CS].base + env->eip; in target_cpu_loop()
181 fprintf(stderr, "qemu: 0x%08lx: unhandled CPU exception 0x%x - " in target_cpu_loop()
192 env->regs[R_ESP] = newsp; in target_cpu_clone_regs()
194 env->regs[R_EAX] = 0; in target_cpu_clone_regs()