/[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 32 by dpavlin, Mon Oct 8 16:20:58 2007 UTC revision 34 by dpavlin, Mon Oct 8 16:21:17 2007 UTC
# Line 2  Line 2 
2  #define CPU_H  #define CPU_H
3    
4  /*  /*
5   *  Copyright (C) 2005-2006  Anders Gavare.  All rights reserved.   *  Copyright (C) 2005-2007  Anders Gavare.  All rights reserved.
6   *   *
7   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
8   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 28  Line 28 
28   *  SUCH DAMAGE.   *  SUCH DAMAGE.
29   *   *
30   *   *
31   *  $Id: cpu.h,v 1.100 2006/10/25 09:24:06 debug Exp $   *  $Id: cpu.h,v 1.109 2007/02/10 14:29:54 debug Exp $
32   *   *
33   *  CPU-related definitions.   *  CPU-related definitions.
34   */   */
# Line 194  Line 194 
194  #include "cpu_alpha.h"  #include "cpu_alpha.h"
195  #include "cpu_arm.h"  #include "cpu_arm.h"
196  #include "cpu_avr.h"  #include "cpu_avr.h"
 #include "cpu_avr32.h"  
 #include "cpu_hppa.h"  
 #include "cpu_i960.h"  
 #include "cpu_ia64.h"  
197  #include "cpu_m68k.h"  #include "cpu_m68k.h"
198  #include "cpu_mips.h"  #include "cpu_mips.h"
199  #include "cpu_ppc.h"  #include "cpu_ppc.h"
# Line 205  Line 201 
201  #include "cpu_sh.h"  #include "cpu_sh.h"
202  #include "cpu_sparc.h"  #include "cpu_sparc.h"
203  #include "cpu_transputer.h"  #include "cpu_transputer.h"
 #include "cpu_x86.h"  
204    
205  struct cpu;  struct cpu;
206  struct emul;  struct emul;
# Line 258  struct cpu_family { Line 253  struct cpu_family {
253          void                    (*tlbdump)(struct machine *m, int x,          void                    (*tlbdump)(struct machine *m, int x,
254                                      int rawflag);                                      int rawflag);
255    
         /*  Assert an interrupt.  */  
         int                     (*interrupt)(struct cpu *cpu, uint64_t irq_nr);  
   
         /*  De-assert an interrupt.  */  
         int                     (*interrupt_ack)(struct cpu *cpu,  
                                     uint64_t irq_nr);  
   
256          /*  Print architecture-specific function call arguments.          /*  Print architecture-specific function call arguments.
257              (This is called for each function call, if running with -t.)  */              (This is called for each function call, if running with -t.)  */
258          void                    (*functioncall_trace)(struct cpu *,          void                    (*functioncall_trace)(struct cpu *,
# Line 291  struct cpu_family { Line 279  struct cpu_family {
279  #define N_SAFE_DYNTRANS_LIMIT_SHIFT     14  #define N_SAFE_DYNTRANS_LIMIT_SHIFT     14
280  #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)
281    
282  #define DYNTRANS_CACHE_SIZE             (32*1048576)  #define DEFAULT_DYNTRANS_CACHE_SIZE     (40*1048576)
283  #define DYNTRANS_CACHE_MARGIN           200000  #define DYNTRANS_CACHE_MARGIN           200000
284    
285  #define N_BASE_TABLE_ENTRIES            32768  #define N_BASE_TABLE_ENTRIES            32768
# Line 312  struct cpu { Line 300  struct cpu {
300          /*  CPU-specific name, e.g. "R2000", "21164PC", etc.  */          /*  CPU-specific name, e.g. "R2000", "21164PC", etc.  */
301          char            *name;          char            *name;
302    
303            /*  Full "path" to the CPU, e.g. "emul[0].machine[0].cpu[0]":  */
304            char            *path;
305    
306          /*  EMUL_LITTLE_ENDIAN or EMUL_BIG_ENDIAN.  */          /*  EMUL_LITTLE_ENDIAN or EMUL_BIG_ENDIAN.  */
307          int             byte_order;          int             byte_order;
308    
# Line 381  struct cpu { Line 372  struct cpu {
372           *  _decreases_ n_translated_instrs. That way, once the dyntrans loop           *  _decreases_ n_translated_instrs. That way, once the dyntrans loop
373           *  exits, only real instructions will be counted, and not the           *  exits, only real instructions will be counted, and not the
374           *  "nothing" instructions.           *  "nothing" instructions.
375             *
376             *  The translation cache is a relative large chunk of memory (say,
377             *  32 MB) which is used for translations. When it has been used up,
378             *  everything restarts from scratch.
379             *
380             *  When translating to native code, currently_translating_to_native
381             *  is non-zero, and native_code_function_pointer points to the
382             *  "ic->f" which will be modified (once the translation has finished)
383             *  to point to the newly translated code.
384           */           */
385          int             n_translated_instrs;          int             n_translated_instrs;
386          unsigned char   *translation_cache;          unsigned char   *translation_cache;
387          size_t          translation_cache_cur_ofs;          size_t          translation_cache_cur_ofs;
388            int             currently_translating_to_native;
389            int             nr_of_instructions_translated_to_native;
390            unsigned char   *native_cur_output_ptr;
391            void            **native_code_function_pointer;
392    
393          /*          /*
394           *  CPU-family dependent:           *  CPU-family dependent:
# Line 396  struct cpu { Line 400  struct cpu {
400                  struct alpha_cpu      alpha;                  struct alpha_cpu      alpha;
401                  struct arm_cpu        arm;                  struct arm_cpu        arm;
402                  struct avr_cpu        avr;                  struct avr_cpu        avr;
                 struct avr32_cpu      avr32;  
                 struct hppa_cpu       hppa;  
                 struct i960_cpu       i960;  
                 struct ia64_cpu       ia64;  
403                  struct m68k_cpu       m68k;                  struct m68k_cpu       m68k;
404                  struct mips_cpu       mips;                  struct mips_cpu       mips;
405                  struct ppc_cpu        ppc;                  struct ppc_cpu        ppc;
# Line 407  struct cpu { Line 407  struct cpu {
407                  struct sh_cpu         sh;                  struct sh_cpu         sh;
408                  struct sparc_cpu      sparc;                  struct sparc_cpu      sparc;
409                  struct transputer_cpu transputer;                  struct transputer_cpu transputer;
                 struct x86_cpu        x86;  
410          } cd;          } cd;
411  };  };
412    
# Line 424  int cpu_disassemble_instr(struct machine Line 423  int cpu_disassemble_instr(struct machine
423          unsigned char *instr, int running, uint64_t addr);          unsigned char *instr, int running, uint64_t addr);
424  char *cpu_gdb_stub(struct cpu *cpu, char *cmd);  char *cpu_gdb_stub(struct cpu *cpu, char *cmd);
425    
 int cpu_interrupt(struct cpu *cpu, uint64_t irq_nr);  
 int cpu_interrupt_ack(struct cpu *cpu, uint64_t irq_nr);  
426  void cpu_functioncall_trace(struct cpu *cpu, uint64_t f);  void cpu_functioncall_trace(struct cpu *cpu, uint64_t f);
427  void cpu_functioncall_trace_return(struct cpu *cpu);  void cpu_functioncall_trace_return(struct cpu *cpu);
428    
# Line 475  void cpu_init(void); Line 472  void cpu_init(void);
472          fp->disassemble_instr = n ## _cpu_disassemble_instr;            \          fp->disassemble_instr = n ## _cpu_disassemble_instr;            \
473          fp->register_dump = n ## _cpu_register_dump;                    \          fp->register_dump = n ## _cpu_register_dump;                    \
474          fp->dumpinfo = n ## _cpu_dumpinfo;                              \          fp->dumpinfo = n ## _cpu_dumpinfo;                              \
         fp->interrupt = n ## _cpu_interrupt;                            \  
         fp->interrupt_ack = n ## _cpu_interrupt_ack;                    \  
475          fp->functioncall_trace = n ## _cpu_functioncall_trace;          \          fp->functioncall_trace = n ## _cpu_functioncall_trace;          \
476          fp->gdb_stub = n ## _cpu_gdb_stub;                              \          fp->gdb_stub = n ## _cpu_gdb_stub;                              \
477          fp->tlbdump = n ## _cpu_tlbdump;                                \          fp->tlbdump = n ## _cpu_tlbdump;                                \

Legend:
Removed from v.32  
changed lines
  Added in v.34

  ViewVC Help
Powered by ViewVC 1.1.26