Revision 5fafdf24 tests/qruncom.c

b/tests/qruncom.c
59 59
    return 0;
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
{
65 65
    unsigned int e1, e2;
......
141 141
    *(uint16_t *)seg_to_linear(env->segs[R_SS].selector, env->regs[R_ESP]) = val;
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
{
147 147
    if (cpu_signal_handler(host_signum, info, puc)) {
......
160 160
    if (argc != 2)
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) {
168 168
        perror("mmap");
......
185 185
    /* install exception handler for CPU emulator */
186 186
    {
187 187
        struct sigaction act;
188
        
188
       
189 189
        sigfillset(&act.sa_mask);
190 190
        act.sa_flags = SA_SIGINFO;
191 191
        //        act.sa_flags |= SA_ONSTACK;
......
218 218
    /* flags setup : we activate the IRQs by default as in user
219 219
       mode. We also activate the VM86 flag to run DOS code */
220 220
    env->eflags |= IF_MASK | VM_MASK;
221
    
221
   
222 222
    /* init basic registers */
223 223
    env->eip = 0x100;
224 224
    env->regs[R_ESP] = 0xfffe;
225 225
    seg = (COM_BASE_ADDR - 0x100) >> 4;
226 226

  
227
    cpu_x86_load_seg_cache(env, R_CS, seg, 
227
    cpu_x86_load_seg_cache(env, R_CS, seg,
228 228
                           (seg << 4), 0xffff, 0);
229
    cpu_x86_load_seg_cache(env, R_SS, seg, 
229
    cpu_x86_load_seg_cache(env, R_SS, seg,
230 230
                           (seg << 4), 0xffff, 0);
231
    cpu_x86_load_seg_cache(env, R_DS, seg, 
231
    cpu_x86_load_seg_cache(env, R_DS, seg,
232 232
                           (seg << 4), 0xffff, 0);
233
    cpu_x86_load_seg_cache(env, R_ES, seg, 
233
    cpu_x86_load_seg_cache(env, R_ES, seg,
234 234
                           (seg << 4), 0xffff, 0);
235
    cpu_x86_load_seg_cache(env, R_FS, seg, 
235
    cpu_x86_load_seg_cache(env, R_FS, seg,
236 236
                           (seg << 4), 0xffff, 0);
237
    cpu_x86_load_seg_cache(env, R_GS, seg, 
237
    cpu_x86_load_seg_cache(env, R_GS, seg,
238 238
                           (seg << 4), 0xffff, 0);
239 239

  
240 240
    /* exception support */
......
260 260
    set_idt(17, 0);
261 261
    set_idt(18, 0);
262 262
    set_idt(19, 0);
263
        
263
       
264 264
    /* put return code */
265 265
    *seg_to_linear(env->segs[R_CS].selector, 0) = 0xb4; /* mov ah, $0 */
266 266
    *seg_to_linear(env->segs[R_CS].selector, 1) = 0x00;
......
275 275
    env->regs[R_EDI] = 0xfffe;
276 276

  
277 277
    /* inform the emulator of the mmaped memory */
278
    page_set_flags(0x00000000, 0x110000, 
278
    page_set_flags(0x00000000, 0x110000,
279 279
                   PAGE_WRITE | PAGE_READ | PAGE_EXEC | PAGE_VALID);
280 280

  
281 281
    for(;;) {

Also available in: Unified diff