/[gxemul]/trunk/src/cpus/cpu_dyntrans.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/src/cpus/cpu_dyntrans.c

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

revision 37 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 38 by dpavlin, Mon Oct 8 16:21:53 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: cpu_dyntrans.c,v 1.142 2007/02/11 10:47:31 debug Exp $   *  $Id: cpu_dyntrans.c,v 1.145 2007/04/10 17:26:20 debug Exp $
29   *   *
30   *  Common dyntrans routines. Included from cpu_*.c.   *  Common dyntrans routines. Included from cpu_*.c.
31   */   */
# Line 488  void DYNTRANS_FUNCTION_TRACE(struct cpu Line 488  void DYNTRANS_FUNCTION_TRACE(struct cpu
488           *  than were passed in register.           *  than were passed in register.
489           */           */
490          for (x=0; x<n_args_to_print; x++) {          for (x=0; x<n_args_to_print; x++) {
491                  int64_t d;                  int64_t d = cpu->cd.DYNTRANS_ARCH.
 #if defined(DYNTRANS_TRANSPUTER)  
                 d = 0;          /*  TODO  */  
 #else  
                 /*  Args in registers:  */  
                 d = cpu->cd.DYNTRANS_ARCH.  
492  #ifdef DYNTRANS_ALPHA  #ifdef DYNTRANS_ALPHA
493                      r[ALPHA_A0                      r[ALPHA_A0
494  #endif  #endif
# Line 514  void DYNTRANS_FUNCTION_TRACE(struct cpu Line 509  void DYNTRANS_FUNCTION_TRACE(struct cpu
509  #ifdef DYNTRANS_PPC  #ifdef DYNTRANS_PPC
510                      gpr[3                      gpr[3
511  #endif  #endif
 #ifdef DYNTRANS_RCA180X  
                     r[0         /*  TODO  */  
 #endif  
512  #ifdef DYNTRANS_SH  #ifdef DYNTRANS_SH
513                      r[4         /*  NetBSD seems to use 4? But 2 seems                      r[4         /*  NetBSD seems to use 4? But 2 seems
514                                          to be used by other code? TODO  */                                          to be used by other code? TODO  */
# Line 525  void DYNTRANS_FUNCTION_TRACE(struct cpu Line 517  void DYNTRANS_FUNCTION_TRACE(struct cpu
517                      r[8         /*  o0..o5  */                      r[8         /*  o0..o5  */
518  #endif  #endif
519                      + x];                      + x];
520  #endif  
521                  symbol = get_symbol_name(&cpu->machine->symbol_context, d, &ot);                  symbol = get_symbol_name(&cpu->machine->symbol_context, d, &ot);
522    
523                  if (d > -256 && d < 256)                  if (d > -256 && d < 256)
# Line 565  static void DYNTRANS_TC_ALLOCATE_DEFAULT Line 557  static void DYNTRANS_TC_ALLOCATE_DEFAULT
557  {  {
558          struct DYNTRANS_TC_PHYSPAGE *ppp;          struct DYNTRANS_TC_PHYSPAGE *ppp;
559    
         native_commit(cpu);  
   
560          ppp = (struct DYNTRANS_TC_PHYSPAGE *)(cpu->translation_cache          ppp = (struct DYNTRANS_TC_PHYSPAGE *)(cpu->translation_cache
561              + cpu->translation_cache_cur_ofs);              + cpu->translation_cache_cur_ofs);
562    
# Line 752  void DYNTRANS_PC_TO_POINTERS_GENERIC(str Line 742  void DYNTRANS_PC_TO_POINTERS_GENERIC(str
742                  physpage_ofs = ppp->next_ofs;                  physpage_ofs = ppp->next_ofs;
743          }          }
744    
745          /*  If the offset is 0 (or ppp is NULL), then we need to create a          /*
746              new "default" empty translation page.  */           *  If the offset is 0, then no translation exists yet for this
747             *  physical address. Let's create a new page, and add it first in
748             *  the chain.
749             */
750            if (physpage_ofs == 0) {
751                    uint32_t previous_first_page_in_chain;
752    
         if (ppp == NULL) {  
753                  /*  fatal("CREATING page %lli (physaddr 0x%"PRIx64"), table "                  /*  fatal("CREATING page %lli (physaddr 0x%"PRIx64"), table "
754                      "index %i\n", (long long)pagenr, (uint64_t)physaddr,                      "index %i\n", (long long)pagenr, (uint64_t)physaddr,
755                      (int)table_index);  */                      (int)table_index);  */
756                  native_commit(cpu);  
757                    previous_first_page_in_chain = *physpage_entryp;
758    
759                    /*  Insert the new page first in the chain:  */
760                  *physpage_entryp = physpage_ofs =                  *physpage_entryp = physpage_ofs =
761                      cpu->translation_cache_cur_ofs;                      cpu->translation_cache_cur_ofs;
762    
# Line 768  void DYNTRANS_PC_TO_POINTERS_GENERIC(str Line 765  void DYNTRANS_PC_TO_POINTERS_GENERIC(str
765    
766                  ppp = (struct DYNTRANS_TC_PHYSPAGE *)(cpu->translation_cache                  ppp = (struct DYNTRANS_TC_PHYSPAGE *)(cpu->translation_cache
767                      + physpage_ofs);                      + physpage_ofs);
768    
769                    /*  Point to the other pages in the same chain:  */
770                    ppp->next_ofs = previous_first_page_in_chain;
771          }          }
772    
773            /*  Here, ppp points to a valid physical page struct.  */
774    
775  #ifdef MODE32  #ifdef MODE32
776          if (cpu->cd.DYNTRANS_ARCH.host_load[index] != NULL)          if (cpu->cd.DYNTRANS_ARCH.host_load[index] != NULL)
777                  cpu->cd.DYNTRANS_ARCH.phys_page[index] = ppp;                  cpu->cd.DYNTRANS_ARCH.phys_page[index] = ppp;
# Line 1274  void DYNTRANS_INVALIDATE_TC_CODE(struct Line 1276  void DYNTRANS_INVALIDATE_TC_CODE(struct
1276    
1277                  /*  If there is no translation, there is no need to go                  /*  If there is no translation, there is no need to go
1278                      on and try to remove it from the vph_tlb_entry array:  */                      on and try to remove it from the vph_tlb_entry array:  */
1279                  if (ppp == NULL)                  if (physpage_ofs == 0)
1280                          return;                          return;
1281    
1282  #if 0  #if 0

Legend:
Removed from v.37  
changed lines
  Added in v.38

  ViewVC Help
Powered by ViewVC 1.1.26