Changeset 36140 in vbox for trunk/src/recompiler/tests/qruncom.c
- Timestamp:
- Mar 3, 2011 1:48:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/tests/qruncom.c
r33540 r36140 60 60 } 61 61 62 static void set_gate(void *ptr, unsigned int type, unsigned int dpl, 62 static void set_gate(void *ptr, unsigned int type, unsigned int dpl, 63 63 unsigned long addr, unsigned int sel) 64 64 { … … 142 142 } 143 143 144 static void host_segv_handler(int host_signum, siginfo_t *info, 144 static void host_segv_handler(int host_signum, siginfo_t *info, 145 145 void *puc) 146 146 { … … 161 161 usage(); 162 162 filename = argv[1]; 163 164 vm86_mem = mmap((void *)0x00000000, 0x110000, 165 PROT_WRITE | PROT_READ | PROT_EXEC, 163 164 vm86_mem = mmap((void *)0x00000000, 0x110000, 165 PROT_WRITE | PROT_READ | PROT_EXEC, 166 166 MAP_FIXED | MAP_ANON | MAP_PRIVATE, -1, 0); 167 167 if (vm86_mem == MAP_FAILED) { … … 186 186 { 187 187 struct sigaction act; 188 188 189 189 sigfillset(&act.sa_mask); 190 190 act.sa_flags = SA_SIGINFO; … … 194 194 sigaction(SIGSEGV, &act, NULL); 195 195 sigaction(SIGBUS, &act, NULL); 196 #if defined (TARGET_I386) && defined(USE_CODE_COPY)197 sigaction(SIGFPE, &act, NULL);198 #endif199 196 } 200 197 201 198 // cpu_set_log(CPU_LOG_TB_IN_ASM | CPU_LOG_TB_OUT_ASM | CPU_LOG_EXEC); 202 199 203 env = cpu_init(); 204 205 /* disable code copy to simplify debugging */ 206 code_copy_enabled = 0; 200 env = cpu_init("qemu32"); 207 201 208 202 /* set user mode state (XXX: should be done automatically by … … 219 213 mode. We also activate the VM86 flag to run DOS code */ 220 214 env->eflags |= IF_MASK | VM_MASK; 221 215 222 216 /* init basic registers */ 223 217 env->eip = 0x100; … … 225 219 seg = (COM_BASE_ADDR - 0x100) >> 4; 226 220 227 cpu_x86_load_seg_cache(env, R_CS, seg, 228 (seg << 4), 0xffff, 0); 229 cpu_x86_load_seg_cache(env, R_SS, seg, 230 (seg << 4), 0xffff, 0); 231 cpu_x86_load_seg_cache(env, R_DS, seg, 232 (seg << 4), 0xffff, 0); 233 cpu_x86_load_seg_cache(env, R_ES, seg, 234 (seg << 4), 0xffff, 0); 235 cpu_x86_load_seg_cache(env, R_FS, seg, 236 (seg << 4), 0xffff, 0); 237 cpu_x86_load_seg_cache(env, R_GS, seg, 221 cpu_x86_load_seg_cache(env, R_CS, seg, 222 (seg << 4), 0xffff, 0); 223 cpu_x86_load_seg_cache(env, R_SS, seg, 224 (seg << 4), 0xffff, 0); 225 cpu_x86_load_seg_cache(env, R_DS, seg, 226 (seg << 4), 0xffff, 0); 227 cpu_x86_load_seg_cache(env, R_ES, seg, 228 (seg << 4), 0xffff, 0); 229 cpu_x86_load_seg_cache(env, R_FS, seg, 230 (seg << 4), 0xffff, 0); 231 cpu_x86_load_seg_cache(env, R_GS, seg, 238 232 (seg << 4), 0xffff, 0); 239 233 … … 261 255 set_idt(18, 0); 262 256 set_idt(19, 0); 263 257 264 258 /* put return code */ 265 259 *seg_to_linear(env->segs[R_CS].selector, 0) = 0xb4; /* mov ah, $0 */ … … 275 269 env->regs[R_EDI] = 0xfffe; 276 270 277 /* inform the emulator of the m apped memory */278 page_set_flags(0x00000000, 0x110000, 271 /* inform the emulator of the mmaped memory */ 272 page_set_flags(0x00000000, 0x110000, 279 273 PAGE_WRITE | PAGE_READ | PAGE_EXEC | PAGE_VALID); 280 274
Note:
See TracChangeset
for help on using the changeset viewer.