/[dynamips]/upstream/dynamips-0.2.7-RC3/mips_mts.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 /upstream/dynamips-0.2.7-RC3/mips_mts.c

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

upstream/dynamips-0.2.7-RC1/mips_mts.c revision 7 by dpavlin, Sat Oct 6 16:23:47 2007 UTC upstream/dynamips-0.2.7-RC2/mips_mts.c revision 8 by dpavlin, Sat Oct 6 16:24:54 2007 UTC
# Line 571  fastcall u_int MTS_PROTO(sdc1)(cpu_mips_ Line 571  fastcall u_int MTS_PROTO(sdc1)(cpu_mips_
571  fastcall u_int MTS_PROTO(cache)(cpu_mips_t *cpu,m_uint64_t vaddr,u_int op)  fastcall u_int MTS_PROTO(cache)(cpu_mips_t *cpu,m_uint64_t vaddr,u_int op)
572  {  {
573     mips64_jit_tcb_t *block;     mips64_jit_tcb_t *block;
574     m_uint32_t phys_page;     m_uint32_t pc_hash;
575    
576  #if DEBUG_CACHE  #if DEBUG_CACHE
577     cpu_log(cpu->gen,     cpu_log(cpu->gen,
# Line 579  fastcall u_int MTS_PROTO(cache)(cpu_mips Line 579  fastcall u_int MTS_PROTO(cache)(cpu_mips
579             cpu->pc, vaddr, op & 0x3, op >> 2);             cpu->pc, vaddr, op & 0x3, op >> 2);
580  #endif  #endif
581    
582     if (!cpu->translate(cpu,vaddr,&phys_page)) {     if (cpu->exec_blk_map) {
583        if ((phys_page < 1048576) && cpu->exec_phys_map) {        pc_hash = mips64_jit_get_pc_hash(cpu->pc);
584           block = cpu->exec_phys_map[phys_page];        block = cpu->exec_blk_map[pc_hash];
585    
586           if (block) {        if (block && mips64_jit_tcb_match(cpu,block)) {
             if ((cpu->pc < block->start_pc) ||  
                 ((cpu->pc - block->start_pc) >= MIPS_MIN_PAGE_SIZE))  
             {  
587  #if DEBUG_CACHE  #if DEBUG_CACHE
588                 cpu_log(cpu->gen,"MTS",           cpu_log(cpu->gen,"MTS",
589                         "CACHE: removing compiled page at 0x%llx, pc=0x%llx\n",                   "CACHE: removing compiled page at 0x%llx, pc=0x%llx\n",
590                         block->start_pc,cpu->pc);                   block->start_pc,cpu->pc);
591  #endif  #endif
592                 cpu->exec_phys_map[phys_page] = NULL;           cpu->exec_blk_map[pc_hash] = NULL;
593                 mips64_jit_tcb_free(cpu,block,TRUE);           mips64_jit_tcb_free(cpu,block,TRUE);
594              }        }
595              else        else
596              {        {
597  #if DEBUG_CACHE  #if DEBUG_CACHE
598                 cpu_log(cpu->gen,"MTS",           cpu_log(cpu->gen,"MTS",
599                         "CACHE: trying to remove page 0x%llx with pc=0x%llx\n",                   "CACHE: trying to remove page 0x%llx with pc=0x%llx\n",
600                         block->start_pc,cpu->pc);                   block->start_pc,cpu->pc);
601  #endif  #endif
             }  
          }  
602        }        }
603     }     }
604    

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

  ViewVC Help
Powered by ViewVC 1.1.26