/[dynamips]/trunk/ppc32.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/ppc32.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.7-RC1/ppc32.c revision 7 by dpavlin, Sat Oct 6 16:23:47 2007 UTC upstream/dynamips-0.2.7/ppc32.c revision 10 by dpavlin, Sat Oct 6 16:29:14 2007 UTC
# Line 42  int ppc32_reset(cpu_ppc_t *cpu) Line 42  int ppc32_reset(cpu_ppc_t *cpu)
42  /* Initialize a PowerPC processor */  /* Initialize a PowerPC processor */
43  int ppc32_init(cpu_ppc_t *cpu)  int ppc32_init(cpu_ppc_t *cpu)
44  {  {
45       /* Initialize JIT operations */
46       jit_op_init_cpu(cpu->gen);
47    
48     /* Initialize idle timer */     /* Initialize idle timer */
49     cpu->gen->idle_max = 1500;     cpu->gen->idle_max = 1500;
50     cpu->gen->idle_sleep_time = 30000;     cpu->gen->idle_sleep_time = 30000;
# Line 50  int ppc32_init(cpu_ppc_t *cpu) Line 53  int ppc32_init(cpu_ppc_t *cpu)
53     cpu->timer_irq_check_itv = 1000;     cpu->timer_irq_check_itv = 1000;
54     cpu->timer_irq_freq      = 250;     cpu->timer_irq_freq      = 250;
55    
56       /* Enable/disable direct block jump */
57       cpu->exec_blk_direct_jump = cpu->vm->exec_blk_direct_jump;
58    
59     /* Idle loop mutex and condition */     /* Idle loop mutex and condition */
60     pthread_mutex_init(&cpu->gen->idle_mutex,NULL);     pthread_mutex_init(&cpu->gen->idle_mutex,NULL);
61     pthread_cond_init(&cpu->gen->idle_cond,NULL);     pthread_cond_init(&cpu->gen->idle_cond,NULL);
# Line 226  int ppc32_get_idling_pc(cpu_gen_t *cpu) Line 232  int ppc32_get_idling_pc(cpu_gen_t *cpu)
232        printf("Restart the emulator with \"--idle-pc=0x%llx\" (for example)\n",        printf("Restart the emulator with \"--idle-pc=0x%llx\" (for example)\n",
233               cpu->idle_pc_prop[0].pc);               cpu->idle_pc_prop[0].pc);
234     } else {     } else {
235        printf("Done. No suggestion for idling PC\n");        printf("Done. No suggestion for idling PC, dumping the full table:\n");
236    
237          for(i=0;i<IDLE_HASH_SIZE;i++)
238             for(p=pc_hash[i];p;p=p->next) {
239                printf("  0x%8.8x (%3u)\n",p->ia,p->count);
240    
241                if (cpu->idle_pc_prop_count < CPU_IDLE_PC_MAX_RES) {
242                   res = &cpu->idle_pc_prop[cpu->idle_pc_prop_count++];
243    
244                   res->pc    = p->ia;
245                   res->count = p->count;
246                }
247             }
248          
249          printf("\n");
250     }     }
251    
252     /* Re-enable IRQ */     /* Re-enable IRQ */
# Line 400  void ppc32_dump_regs(cpu_gen_t *cpu) Line 420  void ppc32_dump_regs(cpu_gen_t *cpu)
420     printf("\n");     printf("\n");
421     printf("  ia = 0x%8.8x, lr = 0x%8.8x\n", pcpu->ia, pcpu->lr);     printf("  ia = 0x%8.8x, lr = 0x%8.8x\n", pcpu->ia, pcpu->lr);
422     printf("  cr = 0x%8.8x, msr = 0x%8.8x, xer = 0x%8.8x, dec = 0x%8.8x\n",     printf("  cr = 0x%8.8x, msr = 0x%8.8x, xer = 0x%8.8x, dec = 0x%8.8x\n",
423            pcpu->cr, pcpu->msr,            ppc32_get_cr(pcpu), pcpu->msr,
424            pcpu->xer | (pcpu->xer_ca << PPC32_XER_CA_BIT),            pcpu->xer | (pcpu->xer_ca << PPC32_XER_CA_BIT),
425            pcpu->dec);            pcpu->dec);
426    
# Line 418  void ppc32_dump_regs(cpu_gen_t *cpu) Line 438  void ppc32_dump_regs(cpu_gen_t *cpu)
438     printf("  Timer IRQ count: %llu, pending: %u, timer drift: %u\n\n",     printf("  Timer IRQ count: %llu, pending: %u, timer drift: %u\n\n",
439            pcpu->timer_irq_count,pcpu->timer_irq_pending,pcpu->timer_drift);            pcpu->timer_irq_count,pcpu->timer_irq_pending,pcpu->timer_drift);
440    
441       printf("  Device access count: %llu\n",cpu->dev_access_counter);
442    
443     printf("\n");     printf("\n");
444  }  }
445    

Legend:
Removed from v.7  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26