/[gxemul]/trunk/src/include/machine.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/machine.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 40 by dpavlin, Mon Oct 8 16:22:11 2007 UTC
# Line 2  Line 2 
2  #define MACHINE_H  #define MACHINE_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: machine.h,v 1.136 2006/10/25 09:24:06 debug Exp $   *  $Id: machine.h,v 1.162 2007/04/19 15:18:16 debug Exp $
32   */   */
33    
34  #include <sys/types.h>  #include <sys/types.h>
35  #include <sys/time.h>  #include <sys/time.h>
36    
 #include "debugger_gdb.h"  
37  #include "symbol.h"  #include "symbol.h"
38    
39  #include "machine_arc.h"  #include "machine_arc.h"
40  #include "machine_pmax.h"  #include "machine_pmax.h"
 #include "machine_x86.h"  
41    
42    
43  #define MAX_BREAKPOINTS         8  #define MAX_BREAKPOINTS         8
 #define BREAKPOINT_FLAG_R       1  
44    
45  #define MAX_TICK_FUNCTIONS      16  #define MAX_TICK_FUNCTIONS      16
46    
# Line 57  struct memory; Line 54  struct memory;
54  struct of_data;  struct of_data;
55  struct settings;  struct settings;
56    
 /*  Ugly:  */  
 struct kn230_csr;  
 struct kn02_csr;  
 struct dec_ioasic_data;  
 struct ps2_data;  
 struct footbridge_data;  
 struct dec5800_data;  
 struct au1x00_ic_data;  
 struct malta_data;  
 struct vr41xx_data;  
 struct jazz_data;  
 struct crime_data;  
 struct mace_data;  
 struct sgi_ip20_data;  
 struct sgi_ip22_data;  
 struct sgi_ip30_data;  
57    
58    /*  TODO: This should probably go away...  */
59  struct isa_pic_data {  struct isa_pic_data {
60          struct pic8259_data     *pic1;          struct pic8259_data     *pic1;
61          struct pic8259_data     *pic2;          struct pic8259_data     *pic2;
62    
63          int                     *pending_timer_interrupts;          int                     *pending_timer_interrupts;
64          int                     last_int;          int                     last_int;
   
         int                     native_irq;  
         int                     native_secondary_irq;  
         uint8_t                 secondary_mask1;  
 };  
   
   
 struct machine_bus {  
         struct machine_bus *next;  
   
         char            *name;  
   
         void            (*debug_dump)(void *);  
         void            *extra;  
65  };  };
66    
67    
# Line 107  struct machine { Line 75  struct machine {
75          /*  Name as choosen by the user:  */          /*  Name as choosen by the user:  */
76          char    *name;          char    *name;
77    
78            /*  Full "path" to the machine, e.g. "emul[0].machine[0]":  */
79            char    *path;
80    
81          int     arch;                   /*  ARCH_MIPS, ARCH_PPC, ..  */          int     arch;                   /*  ARCH_MIPS, ARCH_PPC, ..  */
82          int     machine_type;           /*  MACHINE_PMAX, ..  */          int     machine_type;           /*  MACHINE_PMAX, ..  */
83          int     machine_subtype;        /*  MACHINE_DEC_3MAX_5000, ..  */          int     machine_subtype;        /*  MACHINE_DEC_3MAX_5000, ..  */
84    
85            /*  NOTE/TODO: This isn't working yet:  */
86          int     cycle_accurate;         /*  Set to non-zero for cycle          int     cycle_accurate;         /*  Set to non-zero for cycle
87                                              accurate (slow) emulation.  */                                              accurate (slow) emulation.  */
88    
# Line 149  struct machine { Line 121  struct machine {
121          void    *tick_extra[MAX_TICK_FUNCTIONS];          void    *tick_extra[MAX_TICK_FUNCTIONS];
122          double  tick_hz[MAX_TICK_FUNCTIONS];          double  tick_hz[MAX_TICK_FUNCTIONS];
123    
         void    (*md_interrupt)(struct machine *m, struct cpu *cpu,  
                     int irq_nr, int assert);  
   
124          char    *cpu_name;  /*  TODO: remove this, there could be several          char    *cpu_name;  /*  TODO: remove this, there could be several
125                                  cpus with different names in a machine  */                                  cpus with different names in a machine  */
126          int     byte_order_override;          int     byte_order_override;
# Line 161  struct machine { Line 130  struct machine {
130          int     ncpus;          int     ncpus;
131          struct cpu **cpus;          struct cpu **cpus;
132    
         /*  Registered busses:  */  
         struct machine_bus *first_bus;  
         int     n_busses;  
   
133          /*  These are used by stuff in cpu.c, mostly:  */          /*  These are used by stuff in cpu.c, mostly:  */
134            /*  TODO: Move to cpu.h!  */
135          int64_t ninstrs;          int64_t ninstrs;
136          int64_t ninstrs_show;          int64_t ninstrs_show;
137          int64_t ninstrs_flush;          int64_t ninstrs_flush;
# Line 188  struct machine { Line 154  struct machine {
154          char    *bootstr;          char    *bootstr;
155          char    *bootarg;          char    *bootarg;
156    
         struct debugger_gdb gdb;  
   
157          /*  Breakpoints:  */          /*  Breakpoints:  */
158          int     n_breakpoints;          int     n_breakpoints;
159          char    *breakpoint_string[MAX_BREAKPOINTS];          char    *breakpoint_string[MAX_BREAKPOINTS];
# Line 197  struct machine { Line 161  struct machine {
161          int     breakpoint_flags[MAX_BREAKPOINTS];          int     breakpoint_flags[MAX_BREAKPOINTS];
162    
163          /*  Cache sizes: (1 << x) x=0 for default values  */          /*  Cache sizes: (1 << x) x=0 for default values  */
164          /*  TODO: these are _PER CPU_!  */          /*  TODO: these should be _PER CPU_!  */
165          int     cache_picache;          int     cache_picache;
166          int     cache_pdcache;          int     cache_pdcache;
167          int     cache_secondary;          int     cache_secondary;
# Line 206  struct machine { Line 170  struct machine {
170          int     cache_secondary_linesize;          int     cache_secondary_linesize;
171    
172          int     dbe_on_nonexistant_memaccess;          int     dbe_on_nonexistant_memaccess;
173            int     halt_on_nonexistant_memaccess;
174          int     instruction_trace;          int     instruction_trace;
175          int     show_nr_of_instructions;          int     show_nr_of_instructions;
176          int     show_trace_tree;          int     show_trace_tree;
# Line 231  struct machine { Line 196  struct machine {
196          union {          union {
197                  struct machine_arcbios  arc;                  struct machine_arcbios  arc;
198                  struct machine_pmax     pmax;                  struct machine_pmax     pmax;
199                  struct machine_pc       pc;                  struct of_data          *of_data;
200          } md;          } md;
201    
         /*  OpenFirmware:  */  
         struct of_data *of_data;  
   
202          /*  Bus-specific interrupt data:  */          /*  Bus-specific interrupt data:  */
203            /*  TODO: Remove!  */
204          struct isa_pic_data isa_pic_data;          struct isa_pic_data isa_pic_data;
205    
         /*  Machine-dependent interrupt specific structs:  */  
         union {  
                 struct kn230_csr *kn230_csr;  
                 struct kn02_csr *kn02_csr;  
                 struct dec_ioasic_data *dec_ioasic_data;  
                 struct ps2_data *ps2_data;  
                 struct dec5800_data *dec5800_csr;  
                 struct au1x00_ic_data *au1x00_ic_data;  
                 struct vr41xx_data *vr41xx_data;        
                 struct jazz_data *jazz_data;  
                 struct malta_data *malta_data;  
                 struct sgi_ip20_data *sgi_ip20_data;  
                 struct sgi_ip22_data *sgi_ip22_data;  
                 struct sgi_ip30_data *sgi_ip30_data;  
                 struct {  
                         struct crime_data *crime_data;  
                         struct mace_data *mace_data;  
                 } ip32;  
                 struct footbridge_data *footbridge_data;  
                 struct bebox_data *bebox_data;  
                 struct prep_data *prep_data;  
                 struct cpc700_data *cpc700_data;  
                 struct gc_data *gc_data;  
                 struct v3_data *v3_data;  
         } md_int;  
   
206          /*  X11/framebuffer stuff:  */          /*  X11/framebuffer stuff:  */
207          int     use_x11;          int     use_x11;
208          int     x11_scaledown;          int     x11_scaledown;
# Line 292  struct machine { Line 229  struct machine {
229  #define ARCH_PPC                2  #define ARCH_PPC                2
230  #define ARCH_SPARC              3  #define ARCH_SPARC              3
231  #define ARCH_ALPHA              4  #define ARCH_ALPHA              4
232  #define ARCH_X86                5  #define ARCH_ARM                5
233  #define ARCH_ARM                6  #define ARCH_SH                 6
234  #define ARCH_IA64               7  #define ARCH_AVR                7
235  #define ARCH_M68K               8  #define ARCH_M88K               8
 #define ARCH_SH                 9  
 #define ARCH_HPPA               10  
 #define ARCH_I960               11  
 #define ARCH_AVR                12  
 #define ARCH_TRANSPUTER         13  
 #define ARCH_RCA180X            14  
 #define ARCH_AVR32              15  
236    
237  /*  MIPS:  */  /*  MIPS:  */
238  #define MACHINE_BAREMIPS        1000  #define MACHINE_BAREMIPS        1000
# Line 323  struct machine { Line 253  struct machine {
253  /*  PPC:  */  /*  PPC:  */
254  #define MACHINE_BAREPPC         2000  #define MACHINE_BAREPPC         2000
255  #define MACHINE_TESTPPC         2001  #define MACHINE_TESTPPC         2001
256  #define MACHINE_WALNUT          2002  #define MACHINE_PMPPC           2002
257  #define MACHINE_PMPPC           2003  #define MACHINE_SANDPOINT       2003
258  #define MACHINE_SANDPOINT       2004  #define MACHINE_BEBOX           2004
259  #define MACHINE_BEBOX           2005  #define MACHINE_PREP            2005
260  #define MACHINE_PREP            2006  #define MACHINE_MACPPC          2006
261  #define MACHINE_MACPPC          2007  #define MACHINE_MVMEPPC         2007
 #define MACHINE_DB64360         2008  
 #define MACHINE_MVMEPPC         2009  
262    
263  /*  SPARC:  */  /*  SPARC:  */
264  #define MACHINE_BARESPARC       3000  #define MACHINE_BARESPARC       3000
# Line 342  struct machine { Line 270  struct machine {
270  #define MACHINE_TESTALPHA       4001  #define MACHINE_TESTALPHA       4001
271  #define MACHINE_ALPHA           4002  #define MACHINE_ALPHA           4002
272    
 /*  X86:  */  
 #define MACHINE_BAREX86         5000  
 #define MACHINE_X86             5001  
   
273  /*  ARM:  */  /*  ARM:  */
274  #define MACHINE_BAREARM         6000  #define MACHINE_BAREARM         5000
275  #define MACHINE_TESTARM         6001  #define MACHINE_TESTARM         5001
276  #define MACHINE_CATS            6002  #define MACHINE_CATS            5002
277  #define MACHINE_HPCARM          6003  #define MACHINE_HPCARM          5003
278  #define MACHINE_ZAURUS          6004  #define MACHINE_ZAURUS          5004
279  #define MACHINE_NETWINDER       6005  #define MACHINE_NETWINDER       5005
280  #define MACHINE_SHARK           6006  #define MACHINE_SHARK           5006
281  #define MACHINE_IQ80321         6007  #define MACHINE_IQ80321         5007
282  #define MACHINE_IYONIX          6008  #define MACHINE_IYONIX          5008
283  #define MACHINE_TS7200          6009  #define MACHINE_QEMU_ARM        5009
 #define MACHINE_QEMU_ARM        6010  
   
 /*  IA64:  */  
 #define MACHINE_BAREIA64        7000  
 #define MACHINE_TESTIA64        7001  
   
 /*  M68K:  */  
 #define MACHINE_BAREM68K        8000  
 #define MACHINE_TESTM68K        8001  
284    
285  /*  SH:  */  /*  SH:  */
286  #define MACHINE_BARESH          9000  #define MACHINE_BARESH          6000
287  #define MACHINE_TESTSH          9001  #define MACHINE_TESTSH          6001
288  #define MACHINE_HPCSH           9002  #define MACHINE_HPCSH           6002
289  #define MACHINE_DREAMCAST       9003  #define MACHINE_DREAMCAST       6003
290    #define MACHINE_LANDISK         6004
 /*  HPPA:  */  
 #define MACHINE_BAREHPPA        10000  
 #define MACHINE_TESTHPPA        10001  
   
 /*  I960:  */  
 #define MACHINE_BAREI960        11000  
 #define MACHINE_TESTI960        11001  
291    
292  /*  AVR:  */  /*  AVR:  */
293  #define MACHINE_BAREAVR         12000  #define MACHINE_BAREAVR         7000
294  #define MACHINE_AVR_PAL         12001  #define MACHINE_AVR_PAL         7001
295  #define MACHINE_AVR_MAHPONG     12002  #define MACHINE_AVR_MAHPONG     7002
296    
297  /*  TRANSPUTER:  */  /*  M88K:  */
298  #define MACHINE_BARETRANSPUTER  13000  #define MACHINE_BAREM88K        8000
299    #define MACHINE_TESTM88K        8001
 /*  ARCH_RCA180X:  */  
 #define MACHINE_BARE180X        14000  
 #define MACHINE_CHIP8           14001  
   
 /*  AVR32:  */  
 #define MACHINE_BAREAVR32       15000  
 #define MACHINE_TESTAVR32       15001  
300    
301  /*  Other "pseudo"-machines:  */  /*  Other "pseudo"-machines:  */
302  #define MACHINE_NONE            0  #define MACHINE_NONE            0
# Line 454  struct machine { Line 355  struct machine {
355  /*  EVBMIPS:  */  /*  EVBMIPS:  */
356  #define MACHINE_EVBMIPS_MALTA           1  #define MACHINE_EVBMIPS_MALTA           1
357  #define MACHINE_EVBMIPS_MALTA_BE        2  #define MACHINE_EVBMIPS_MALTA_BE        2
 #define MACHINE_EVBMIPS_MESHCUBE        3  
 #define MACHINE_EVBMIPS_PB1000          4  
358    
359  /*  PReP:  */  /*  PReP:  */
360  #define MACHINE_PREP_IBM6050            1  #define MACHINE_PREP_IBM6050            1
# Line 466  struct machine { Line 365  struct machine {
365  #define MACHINE_SPARC_SS20              2  #define MACHINE_SPARC_SS20              2
366  #define MACHINE_SPARC_ULTRA1            3  #define MACHINE_SPARC_ULTRA1            3
367  #define MACHINE_SPARC_ULTRA60           4  #define MACHINE_SPARC_ULTRA60           4
368    #define MACHINE_SPARC_SUN4V             5
369    
370  /*  MacPPC:  TODO: Real model names  */  /*  MacPPC:  TODO: Real model names  */
371  #define MACHINE_MACPPC_G3               1  #define MACHINE_MACPPC_G3               1
# Line 477  struct machine { Line 377  struct machine {
377  #define MACHINE_MVMEPPC_2100            2  #define MACHINE_MVMEPPC_2100            2
378  #define MACHINE_MVMEPPC_5500            3  #define MACHINE_MVMEPPC_5500            3
379    
 /*  X86:  */  
 #define MACHINE_X86_GENERIC             1  
 #define MACHINE_X86_XT                  2  
   
380    
381  /*  For the automachine system:  */  /*  For the automachine system:  */
382  struct machine_entry_subtype {  struct machine_entry_subtype {
# Line 524  void automachine_init(void); Line 420  void automachine_init(void);
420    
421    
422  /*  machine.c:  */  /*  machine.c:  */
423  struct machine *machine_new(char *name, struct emul *emul);  struct machine *machine_new(char *name, struct emul *emul, int id);
424  void machine_destroy(struct machine *machine);  void machine_destroy(struct machine *machine);
425  int machine_name_to_type(char *stype, char *ssubtype,  int machine_name_to_type(char *stype, char *ssubtype,
426          int *type, int *subtype, int *arch);          int *type, int *subtype, int *arch);
# Line 558  void machine_setup(struct machine *); Line 454  void machine_setup(struct machine *);
454  void machine_memsize_fix(struct machine *);  void machine_memsize_fix(struct machine *);
455  void machine_default_cputype(struct machine *);  void machine_default_cputype(struct machine *);
456  void machine_dumpinfo(struct machine *);  void machine_dumpinfo(struct machine *);
 void machine_bus_register(struct machine *, char *busname,  
         void (*debug_dump)(void *), void *extra);  
457  int machine_run(struct machine *machine);  int machine_run(struct machine *machine);
458  void machine_list_available_types_and_cpus(void);  void machine_list_available_types_and_cpus(void);
459  struct machine_entry *machine_entry_new(const char *name,  struct machine_entry *machine_entry_new(const char *name,

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

  ViewVC Help
Powered by ViewVC 1.1.26