/[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 trunk/ppc32.c revision 12 by dpavlin, Sat Oct 6 16:45:40 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 64  int ppc32_init(cpu_ppc_t *cpu) Line 70  int ppc32_init(cpu_ppc_t *cpu)
70     cpu->gen->set_idle_pc = (void *)ppc32_set_idle_pc;     cpu->gen->set_idle_pc = (void *)ppc32_set_idle_pc;
71     cpu->gen->get_idling_pc = (void *)ppc32_get_idling_pc;     cpu->gen->get_idling_pc = (void *)ppc32_get_idling_pc;
72    
73       /* zzz */
74       memset(cpu->vtlb,0xFF,sizeof(cpu->vtlb));
75    
76     /* Set the startup parameters */     /* Set the startup parameters */
77     ppc32_reset(cpu);     ppc32_reset(cpu);
78     return(0);     return(0);
# Line 226  int ppc32_get_idling_pc(cpu_gen_t *cpu) Line 235  int ppc32_get_idling_pc(cpu_gen_t *cpu)
235        printf("Restart the emulator with \"--idle-pc=0x%llx\" (for example)\n",        printf("Restart the emulator with \"--idle-pc=0x%llx\" (for example)\n",
236               cpu->idle_pc_prop[0].pc);               cpu->idle_pc_prop[0].pc);
237     } else {     } else {
238        printf("Done. No suggestion for idling PC\n");        printf("Done. No suggestion for idling PC, dumping the full table:\n");
239    
240          for(i=0;i<IDLE_HASH_SIZE;i++)
241             for(p=pc_hash[i];p;p=p->next) {
242                printf("  0x%8.8x (%3u)\n",p->ia,p->count);
243    
244                if (cpu->idle_pc_prop_count < CPU_IDLE_PC_MAX_RES) {
245                   res = &cpu->idle_pc_prop[cpu->idle_pc_prop_count++];
246    
247                   res->pc    = p->ia;
248                   res->count = p->count;
249                }
250             }
251          
252          printf("\n");
253     }     }
254    
255     /* Re-enable IRQ */     /* Re-enable IRQ */
# Line 400  void ppc32_dump_regs(cpu_gen_t *cpu) Line 423  void ppc32_dump_regs(cpu_gen_t *cpu)
423     printf("\n");     printf("\n");
424     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);
425     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",
426            pcpu->cr, pcpu->msr,            ppc32_get_cr(pcpu), pcpu->msr,
427            pcpu->xer | (pcpu->xer_ca << PPC32_XER_CA_BIT),            pcpu->xer | (pcpu->xer_ca << PPC32_XER_CA_BIT),
428            pcpu->dec);            pcpu->dec);
429    
# Line 418  void ppc32_dump_regs(cpu_gen_t *cpu) Line 441  void ppc32_dump_regs(cpu_gen_t *cpu)
441     printf("  Timer IRQ count: %llu, pending: %u, timer drift: %u\n\n",     printf("  Timer IRQ count: %llu, pending: %u, timer drift: %u\n\n",
442            pcpu->timer_irq_count,pcpu->timer_irq_pending,pcpu->timer_drift);            pcpu->timer_irq_count,pcpu->timer_irq_pending,pcpu->timer_drift);
443    
444       printf("  Device access count: %llu\n",cpu->dev_access_counter);
445    
446     printf("\n");     printf("\n");
447  }  }
448    

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

  ViewVC Help
Powered by ViewVC 1.1.26