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

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

revision 24 by dpavlin, Mon Oct 8 16:19:56 2007 UTC revision 26 by dpavlin, Mon Oct 8 16:20:10 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: cpu.c,v 1.342 2006/06/22 13:27:03 debug Exp $   *  $Id: cpu.c,v 1.344 2006/06/24 21:47:22 debug Exp $
29   *   *
30   *  Common routines for CPU emulation. (Not specific to any CPU type.)   *  Common routines for CPU emulation. (Not specific to any CPU type.)
31   */   */
# Line 96  struct cpu *cpu_new(struct memory *mem, Line 96  struct cpu *cpu_new(struct memory *mem,
96                                              "NULL\n");                                              "NULL\n");
97                                          exit(1);                                          exit(1);
98                                  }                                  }
99                                  return cpu;                                  break;
100                          }                          }
101                  }                  }
102    
103                  fp = fp->next;                  fp = fp->next;
104          }          }
105    
106          fatal("\ncpu_new(): unknown cpu type '%s'\n", cpu_type_name);          if (fp == NULL) {
107          return NULL;                  fatal("\ncpu_new(): unknown cpu type '%s'\n", cpu_type_name);
108                    return NULL;
109            }
110    
111            fp->init_tables(cpu);
112    
113            return cpu;
114  }  }
115    
116    
# Line 322  void cpu_create_or_reset_tc(struct cpu * Line 328  void cpu_create_or_reset_tc(struct cpu *
328  }  }
329    
330    
 /*  
  *  cpu_run():  
  *  
  *  Run instructions on all CPUs in this machine, for a "medium duration"  
  *  (or until all CPUs have halted).  
  *  
  *  Return value is 1 if anything happened, 0 if all CPUs are stopped.  
  */  
 int cpu_run(struct emul *emul, struct machine *m)  
 {  
         if (m->cpu_family == NULL || m->cpu_family->run == NULL) {  
                 fatal("cpu_run(): NULL\n");  
                 return 0;  
         } else  
                 return m->cpu_family->run(emul, m);  
 }  
   
   
331  /*  /*
332   *  cpu_dumpinfo():   *  cpu_dumpinfo():
333   *   *

Legend:
Removed from v.24  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.26