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

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

revision 25 by dpavlin, Mon Oct 8 16:19:56 2007 UTC revision 26 by dpavlin, Mon Oct 8 16:20:10 2007 UTC
# Line 28  Line 28 
28   *  SUCH DAMAGE.   *  SUCH DAMAGE.
29   *   *
30   *   *
31   *  $Id: cpu.h,v 1.75 2006/06/16 18:31:26 debug Exp $   *  $Id: cpu.h,v 1.79 2006/06/25 00:27:36 debug Exp $
32   *   *
33   *  CPU-related definitions.   *  CPU-related definitions.
34   */   */
# Line 114  Line 114 
114  #define DYNTRANS_ITC(arch)      struct arch ## _tc_physpage *cur_physpage;  \  #define DYNTRANS_ITC(arch)      struct arch ## _tc_physpage *cur_physpage;  \
115                                  struct arch ## _instr_call  *cur_ic_page;   \                                  struct arch ## _instr_call  *cur_ic_page;   \
116                                  struct arch ## _instr_call  *next_ic;       \                                  struct arch ## _instr_call  *next_ic;       \
117                                    struct arch ## _tc_physpage *physpage_template;\
118                                  void (*combination_check)(struct cpu *,     \                                  void (*combination_check)(struct cpu *,     \
119                                      struct arch ## _instr_call *, int low_addr);                                      struct arch ## _instr_call *, int low_addr);
120    
# Line 224  struct cpu_family { Line 225  struct cpu_family {
225                                      uint64_t dumpaddr);                                      uint64_t dumpaddr);
226          void                    (*register_dump)(struct cpu *cpu,          void                    (*register_dump)(struct cpu *cpu,
227                                      int gprs, int coprocs);                                      int gprs, int coprocs);
228          int                     (*run)(struct emul *emul,          int                     (*run_instr)(struct emul *emul,
229                                      struct machine *machine);                                      struct cpu *cpu);
230          void                    (*dumpinfo)(struct cpu *cpu);          void                    (*dumpinfo)(struct cpu *cpu);
231          void                    (*tlbdump)(struct machine *m, int x,          void                    (*tlbdump)(struct machine *m, int x,
232                                      int rawflag);                                      int rawflag);
# Line 235  struct cpu_family { Line 236  struct cpu_family {
236          void                    (*functioncall_trace)(struct cpu *,          void                    (*functioncall_trace)(struct cpu *,
237                                      uint64_t f, int n_args);                                      uint64_t f, int n_args);
238          char                    *(*gdb_stub)(struct cpu *, char *cmd);          char                    *(*gdb_stub)(struct cpu *, char *cmd);
239            void                    (*init_tables)(struct cpu *cpu);
240  };  };
241    
242    
# Line 258  struct cpu_family { Line 260  struct cpu_family {
260  #define N_SAFE_DYNTRANS_LIMIT_SHIFT     14  #define N_SAFE_DYNTRANS_LIMIT_SHIFT     14
261  #define N_SAFE_DYNTRANS_LIMIT   ((1 << (N_SAFE_DYNTRANS_LIMIT_SHIFT - 1)) - 1)  #define N_SAFE_DYNTRANS_LIMIT   ((1 << (N_SAFE_DYNTRANS_LIMIT_SHIFT - 1)) - 1)
262    
263  #define DYNTRANS_CACHE_SIZE             (16*1048576)  #define DYNTRANS_CACHE_SIZE             (24*1048576)
264  #define DYNTRANS_CACHE_MARGIN           300000  #define DYNTRANS_CACHE_MARGIN           350000
265    
266  #define N_BASE_TABLE_ENTRIES            32768  #define N_BASE_TABLE_ENTRIES            32768
267  #define PAGENR_TO_TABLE_INDEX(a)        ((a) & (N_BASE_TABLE_ENTRIES-1))  #define PAGENR_TO_TABLE_INDEX(a)        ((a) & (N_BASE_TABLE_ENTRIES-1))
# Line 286  struct cpu { Line 288  struct cpu {
288                              struct memory *mem, uint64_t vaddr,                              struct memory *mem, uint64_t vaddr,
289                              unsigned char *data, size_t len,                              unsigned char *data, size_t len,
290                              int writeflag, int cache_flags);                              int writeflag, int cache_flags);
291          int             (*translate_address)(struct cpu *, uint64_t vaddr,          int             (*translate_v2p)(struct cpu *, uint64_t vaddr,
292                              uint64_t *return_addr, int flags);                              uint64_t *return_paddr, int flags);
293          void            (*update_translation_table)(struct cpu *,          void            (*update_translation_table)(struct cpu *,
294                              uint64_t vaddr_page, unsigned char *host_page,                              uint64_t vaddr_page, unsigned char *host_page,
295                              int writeflag, uint64_t paddr_page);                              int writeflag, uint64_t paddr_page);
# Line 351  void cpu_functioncall_trace(struct cpu * Line 353  void cpu_functioncall_trace(struct cpu *
353  void cpu_functioncall_trace_return(struct cpu *cpu);  void cpu_functioncall_trace_return(struct cpu *cpu);
354  void cpu_create_or_reset_tc(struct cpu *cpu);  void cpu_create_or_reset_tc(struct cpu *cpu);
355  void cpu_run_init(struct machine *machine);  void cpu_run_init(struct machine *machine);
 int cpu_run(struct emul *emul, struct machine *machine);  
356  void cpu_run_deinit(struct machine *machine);  void cpu_run_deinit(struct machine *machine);
357  void cpu_dumpinfo(struct machine *m, struct cpu *cpu);  void cpu_dumpinfo(struct machine *m, struct cpu *cpu);
358  void cpu_list_available_types(void);  void cpu_list_available_types(void);
# Line 366  void cpu_init(void); Line 367  void cpu_init(void);
367  #define INVALIDATE_VADDR                8  #define INVALIDATE_VADDR                8
368  #define INVALIDATE_VADDR_UPPER4         16      /*  useful for PPC emulation  */  #define INVALIDATE_VADDR_UPPER4         16      /*  useful for PPC emulation  */
369    
 #define TLB_CODE                        0x02  
   
370    
371  #define CPU_FAMILY_INIT(n,s)    int n ## _cpu_family_init(              \  #define CPU_FAMILY_INIT(n,s)    int n ## _cpu_family_init(              \
372          struct cpu_family *fp) {                                        \          struct cpu_family *fp) {                                        \
# Line 378  void cpu_init(void); Line 377  void cpu_init(void);
377          fp->register_match = n ## _cpu_register_match;                  \          fp->register_match = n ## _cpu_register_match;                  \
378          fp->disassemble_instr = n ## _cpu_disassemble_instr;            \          fp->disassemble_instr = n ## _cpu_disassemble_instr;            \
379          fp->register_dump = n ## _cpu_register_dump;                    \          fp->register_dump = n ## _cpu_register_dump;                    \
         fp->run = n ## _cpu_run;                                        \  
380          fp->dumpinfo = n ## _cpu_dumpinfo;                              \          fp->dumpinfo = n ## _cpu_dumpinfo;                              \
381          fp->interrupt = n ## _cpu_interrupt;                            \          fp->interrupt = n ## _cpu_interrupt;                            \
382          fp->interrupt_ack = n ## _cpu_interrupt_ack;                    \          fp->interrupt_ack = n ## _cpu_interrupt_ack;                    \
383          fp->functioncall_trace = n ## _cpu_functioncall_trace;          \          fp->functioncall_trace = n ## _cpu_functioncall_trace;          \
384          fp->gdb_stub = n ## _cpu_gdb_stub;                              \          fp->gdb_stub = n ## _cpu_gdb_stub;                              \
385          fp->tlbdump = n ## _cpu_tlbdump;                                \          fp->tlbdump = n ## _cpu_tlbdump;                                \
386            fp->run_instr = n ## _cpu_run_instr;                            \
387            fp->init_tables = n ## _cpu_init_tables;                        \
388          return 1;                                                       \          return 1;                                                       \
389          }          }
390    

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

  ViewVC Help
Powered by ViewVC 1.1.26