berkus / qemu-omap3

Automatically exported from code.google.com/p/qemu-omap3
0 stars 0 forks source link

how to force lookup of first TB? #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In cpu-exec.c,I see next_tb = 0; /* force lookup of first TB */ 
But i don't known how to force lookup of first TB only by next_tb=0.
      next_tb = 0; /* force lookup of first TB */
            for(;;) {
                interrupt_request = env->interrupt_request;
                if (unlikely(interrupt_request)) {
#elif defined(TARGET_PPC)
#if 0
                    if ((interrupt_request & CPU_INTERRUPT_RESET)) {
                        cpu_ppc_reset(env);
                    }
#endif
                    if (interrupt_request & CPU_INTERRUPT_HARD) {
                        ppc_hw_interrupt(env);
                        if (env->pending_interrupts == 0)
                            env->interrupt_request &= ~CPU_INTERRUPT_HARD;
                        next_tb = 0;
                    }
               spin_lock(&tb_lock);
                tb = tb_find_fast();
                /* Note: we do it here to avoid a gcc bug on Mac OS X when
                   doing it in tb_find_slow */
                if (tb_invalidated_flag) {
                    /* as some TB could have been invalidated because
                       of memory exceptions while generating the code, we
                       must recompute the hash index here */
                    next_tb = 0;
                    tb_invalidated_flag = 0;
                }
   In here,I see tb is computed by    
   tb = env->tb_jmp_cache[tb_jmp_cache_hash_func(pc)] in the 
  function tb_find_fast,here only require the value called pc, but next_tb.
    where is next_tb? 
   I very thanks to anyone who help me here.

Original issue reported on code.google.com by owenu...@gmail.com on 29 Apr 2009 at 4:36