Revision bfed01fc cpu-exec.c

b/cpu-exec.c
40 40
//#define DEBUG_EXEC
41 41
//#define DEBUG_SIGNAL
42 42

  
43
#if defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_M68K) || \
44
    defined(TARGET_ALPHA)
45
/* XXX: unify with i386 target */
46 43
void cpu_loop_exit(void)
47 44
{
45
    /* NOTE: the register at this point must be saved by hand because
46
       longjmp restore them */
47
    regs_to_env();
48 48
    longjmp(env->jmp_env, 1);
49 49
}
50
#endif
50

  
51 51
#if !(defined(TARGET_SPARC) || defined(TARGET_SH4) || defined(TARGET_M68K))
52 52
#define reg_T2
53 53
#endif
......
249 249
    TranslationBlock *tb;
250 250
    uint8_t *tc_ptr;
251 251

  
252
#if defined(TARGET_I386)
253
    /* handle exit of HALTED state */
254
    if (env1->hflags & HF_HALTED_MASK) {
255
        /* disable halt condition */
256
        if ((env1->interrupt_request & CPU_INTERRUPT_HARD) &&
257
            (env1->eflags & IF_MASK)) {
258
            env1->hflags &= ~HF_HALTED_MASK;
259
        } else {
260
            return EXCP_HALTED;
261
        }
262
    }
263
#elif defined(TARGET_PPC)
264
    if (env1->halted) {
265
        if (env1->msr[MSR_EE] && 
266
            (env1->interrupt_request & CPU_INTERRUPT_HARD)) {
267
            env1->halted = 0;
268
        } else {
269
            return EXCP_HALTED;
270
        }
271
    }
272
#elif defined(TARGET_SPARC)
273
    if (env1->halted) {
274
        if ((env1->interrupt_request & CPU_INTERRUPT_HARD) &&
275
            (env1->psret != 0)) {
276
            env1->halted = 0;
277
        } else {
278
            return EXCP_HALTED;
279
        }
280
    }
281
#elif defined(TARGET_ARM)
282
    if (env1->halted) {
283
        /* An interrupt wakes the CPU even if the I and F CPSR bits are
284
           set.  We use EXITTB to silently wake CPU without causing an
285
           actual interrupt.  */
286
        if (env1->interrupt_request &
287
            (CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB)) {
288
            env1->halted = 0;
289
        } else {
290
            return EXCP_HALTED;
291
        }
292
    }
293
#elif defined(TARGET_MIPS)
294
    if (env1->halted) {
295
        if (env1->interrupt_request &
296
            (CPU_INTERRUPT_HARD | CPU_INTERRUPT_TIMER)) {
297
            env1->halted = 0;
298
        } else {
299
            return EXCP_HALTED;
300
        }
301
    }
302
#elif defined(TARGET_ALPHA) || defined(TARGET_M68K)
303
    if (env1->halted) {
304
        if (env1->interrupt_request & CPU_INTERRUPT_HARD) {
305
            env1->halted = 0;
306
        } else {
307
            return EXCP_HALTED;
308
        }
309
    }
310
#endif
252
    if (cpu_halted(env1) == EXCP_HALTED)
253
        return EXCP_HALTED;
311 254

  
312 255
    cpu_single_env = env1; 
313 256

  

Also available in: Unified diff