/[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

Annotation of /trunk/src/include/machine.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 28 - (hide annotations)
Mon Oct 8 16:20:26 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: text/plain
File size: 15443 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.1298 2006/07/22 11:27:46 debug Exp $
20060626	Continuing on SPARC emulation (beginning on the 'save'
		instruction, register windows, etc).
20060629	Planning statistics gathering (new -s command line option),
		and renaming speed_tricks to allow_instruction_combinations.
20060630	Some minor manual page updates.
		Various cleanups.
		Implementing the -s command line option.
20060701	FINALLY found the bug which prevented Linux and Ultrix from
		running without the ugly hack in the R2000/R3000 cache isol
		code; it was the phystranslation hint array which was buggy.
		Removing the phystranslation hint code completely, for now.
20060702	Minor dyntrans cleanups; invalidation of physpages now only
		invalidate those parts of a page that have actually been
		translated. (32 parts per page.)
		Some MIPS non-R3000 speed fixes.
		Experimenting with MIPS instruction combination for some
		addiu+bne+sw loops, and sw+sw+sw.
		Adding support (again) for larger-than-4KB pages in MIPS tlbw*.
		Continuing on SPARC emulation: adding load/store instructions.
20060704	Fixing a virtual vs physical page shift bug in the new tlbw*
		implementation. Problem noticed by Jakub Jermar. (Many thanks.)
		Moving rfe and eret to cpu_mips_instr.c, since that is the
		only place that uses them nowadays.
20060705	Removing the BSD license from the "testmachine" include files,
		placing them in the public domain instead; this enables the
		testmachine stuff to be used from projects which are
		incompatible with the BSD license for some reason.
20060707	Adding instruction combinations for the R2000/R3000 L1
		I-cache invalidation code used by NetBSD/pmax 3.0, lui+addiu,
		various branches followed by addiu or nop, and jr ra followed
		by addiu. The time it takes to perform a full NetBSD/pmax R3000
		install on the laptop has dropped from 573 seconds to 539. :-)
20060708	Adding a framebuffer controller device (dev_fbctrl), which so
		far can be used to change the fb resolution during runtime, but
		in the future will also be useful for accelerated block fill/
		copy, and possibly also simplified character output.
		Adding an instruction combination for NetBSD/pmax' strlen.
20060709	Minor fixes: reading raw files in src/file.c wasn't memblock
		aligned, removing buggy multi_sw MIPS instruction combination,
		etc.
20060711	Adding a machine_qemu.c, which contains a "qemu_mips" machine.
		(It mimics QEMU's MIPS machine mode, so that a test kernel
		made for QEMU_MIPS also can run in GXemul... at least to some
		extent.)  Adding a short section about how to run this mode to
		doc/guestoses.html.
20060714	Misc. minor code cleanups.
20060715	Applying a patch which adds getchar() to promemul/yamon.c
		(from Oleksandr Tymoshenko).
		Adding yamon.h from NetBSD, and rewriting yamon.c to use it
		(instead of ugly hardcoded numbers) + some cleanup.
20060716	Found and fixed the bug which broke single-stepping of 64-bit
		programs between 0.4.0 and 0.4.0.1 (caused by too quick
		refactoring and no testing). Hopefully this fix will not
		break too many other things.
20060718	Continuing on the 8253 PIT; it now works with Linux/QEMU_MIPS.
		Re-adding the sw+sw+sw instr comb (the problem was that I had
		ignored endian issues); however, it doesn't seem to give any
		big performance gain.
20060720	Adding a dummy Transputer mode (T414, T800 etc) skeleton (only
		the 'j' and 'ldc' instructions are implemented so far). :-}
20060721	Adding gtreg.h from NetBSD, updating dev_gt.c to use it, plus
		misc. other updates to get Linux 2.6 for evbmips/malta working
		(thanks to Alec Voropay for the details).
		FINALLY found and fixed the bug which made tlbw* for non-R3000
		buggy; it was a reference count problem in the dyntrans core.
20060722	Testing stuff; things seem stable enough for a new release.

==============  RELEASE 0.4.1  ==============


1 dpavlin 4 #ifndef MACHINE_H
2     #define MACHINE_H
3    
4     /*
5 dpavlin 22 * Copyright (C) 2005-2006 Anders Gavare. All rights reserved.
6 dpavlin 4 *
7     * Redistribution and use in source and binary forms, with or without
8     * modification, are permitted provided that the following conditions are met:
9     *
10     * 1. Redistributions of source code must retain the above copyright
11     * notice, this list of conditions and the following disclaimer.
12     * 2. Redistributions in binary form must reproduce the above copyright
13     * notice, this list of conditions and the following disclaimer in the
14     * documentation and/or other materials provided with the distribution.
15     * 3. The name of the author may not be used to endorse or promote products
16     * derived from this software without specific prior written permission.
17     *
18     * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19     * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20     * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21     * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22     * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23     * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24     * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25     * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26     * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27     * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28     * SUCH DAMAGE.
29     *
30     *
31 dpavlin 28 * $Id: machine.h,v 1.126 2006/07/21 16:55:41 debug Exp $
32 dpavlin 4 */
33    
34     #include <sys/types.h>
35     #include <sys/time.h>
36    
37 dpavlin 24 #include "debugger_gdb.h"
38 dpavlin 4 #include "symbol.h"
39    
40 dpavlin 14 #include "machine_arc.h"
41 dpavlin 24 #include "machine_pmax.h"
42 dpavlin 6 #include "machine_x86.h"
43 dpavlin 4
44 dpavlin 14
45 dpavlin 4 #define MAX_BREAKPOINTS 8
46     #define BREAKPOINT_FLAG_R 1
47    
48 dpavlin 24 #define MAX_TICK_FUNCTIONS 16
49 dpavlin 4
50 dpavlin 28 #define MAX_STATISTICS_FIELDS 8
51    
52 dpavlin 4 struct cpu_family;
53     struct diskimage;
54     struct emul;
55     struct fb_window;
56     struct memory;
57 dpavlin 22 struct of_data;
58 dpavlin 4
59     /* Ugly: */
60     struct kn230_csr;
61     struct kn02_csr;
62     struct dec_ioasic_data;
63     struct ps2_data;
64 dpavlin 14 struct footbridge_data;
65 dpavlin 4 struct dec5800_data;
66     struct au1x00_ic_data;
67 dpavlin 10 struct malta_data;
68 dpavlin 4 struct vr41xx_data;
69     struct jazz_data;
70     struct crime_data;
71     struct mace_data;
72     struct sgi_ip20_data;
73     struct sgi_ip22_data;
74     struct sgi_ip30_data;
75 dpavlin 12 struct isa_pic_data {
76 dpavlin 20 struct pic8259_data *pic1;
77     struct pic8259_data *pic2;
78     int last_int;
79     int native_irq;
80 dpavlin 12 };
81 dpavlin 4
82 dpavlin 12
83 dpavlin 22 struct machine_bus {
84     struct machine_bus *next;
85    
86     char *name;
87    
88     void (*debug_dump)(void *);
89     void *extra;
90     };
91    
92    
93 dpavlin 4 struct machine {
94     /* Pointer back to the emul struct we are in: */
95     struct emul *emul;
96    
97     /* Name as choosen by the user: */
98     char *name;
99    
100     int arch; /* ARCH_MIPS, ARCH_PPC, .. */
101 dpavlin 22 int machine_type; /* MACHINE_PMAX, .. */
102 dpavlin 4 int machine_subtype; /* MACHINE_DEC_3MAX_5000, .. */
103    
104 dpavlin 24 int cycle_accurate; /* Set to non-zero for cycle
105     accurate (slow) emulation. */
106    
107 dpavlin 22 /* Name set by code in src/machines/machine_*.c: */
108 dpavlin 4 char *machine_name;
109    
110 dpavlin 22 int stable; /* startup warning for non-stable
111     emulation modes. */
112    
113 dpavlin 4 /* The serial number is mostly used when emulating multiple machines
114     in a network. nr_of_nics is the current nr of network cards, which
115     is useful when emulating multiple cards in one machine: */
116     int serial_nr;
117     int nr_of_nics;
118    
119 dpavlin 28 /* TODO: How about multiple cpu familys in one machine? */
120 dpavlin 4 struct cpu_family *cpu_family;
121    
122     /*
123     * The "mainbus":
124     *
125     * o) memory
126     * o) devices
127     * o) CPUs
128     */
129    
130     struct memory *memory;
131    
132     int main_console_handle;
133    
134     /* Hardware devices, run every x clock cycles. */
135     int n_tick_entries;
136     int ticks_till_next[MAX_TICK_FUNCTIONS];
137     int ticks_reset_value[MAX_TICK_FUNCTIONS];
138     void (*tick_func[MAX_TICK_FUNCTIONS])(struct cpu *, void *);
139     void *tick_extra[MAX_TICK_FUNCTIONS];
140 dpavlin 24 double tick_hz[MAX_TICK_FUNCTIONS];
141 dpavlin 4
142     void (*md_interrupt)(struct machine *m, struct cpu *cpu,
143     int irq_nr, int assert);
144    
145     char *cpu_name; /* TODO: remove this, there could be several
146     cpus with different names in a machine */
147     int byte_order_override;
148     int bootstrap_cpu;
149     int use_random_bootstrap_cpu;
150     int start_paused;
151     int ncpus;
152     struct cpu **cpus;
153    
154 dpavlin 22 /* Registered busses: */
155     struct machine_bus *first_bus;
156     int n_busses;
157    
158 dpavlin 4 /* These are used by stuff in cpu.c, mostly: */
159 dpavlin 28 int64_t ninstrs;
160     int64_t ninstrs_show;
161     int64_t ninstrs_flush;
162     int64_t ninstrs_since_gettimeofday;
163 dpavlin 10 struct timeval starttime;
164 dpavlin 4
165     struct diskimage *first_diskimage;
166    
167     struct symbol_context symbol_context;
168    
169     int random_mem_contents;
170     int physical_ram_in_mb;
171     int memory_offset_in_mb;
172     int prom_emulation;
173     int register_dump;
174 dpavlin 12 int arch_pagesize;
175 dpavlin 4
176 dpavlin 22 int bootdev_type;
177     int bootdev_id;
178     char *bootstr;
179     char *bootarg;
180    
181 dpavlin 24 struct debugger_gdb gdb;
182    
183 dpavlin 28 /* Breakpoints: */
184 dpavlin 4 int n_breakpoints;
185     char *breakpoint_string[MAX_BREAKPOINTS];
186     uint64_t breakpoint_addr[MAX_BREAKPOINTS];
187     int breakpoint_flags[MAX_BREAKPOINTS];
188    
189     /* Cache sizes: (1 << x) x=0 for default values */
190     /* TODO: these are _PER CPU_! */
191     int cache_picache;
192     int cache_pdcache;
193     int cache_secondary;
194     int cache_picache_linesize;
195     int cache_pdcache_linesize;
196     int cache_secondary_linesize;
197    
198     int dbe_on_nonexistant_memaccess;
199     int instruction_trace;
200     int show_nr_of_instructions;
201 dpavlin 28 int show_trace_tree;
202 dpavlin 4 int show_symbolic_register_names;
203     int emulated_hz;
204 dpavlin 28 int allow_instruction_combinations;
205 dpavlin 4 char *userland_emul; /* NULL for no userland emulation */
206     int force_netboot;
207     int slow_serial_interrupts_hack_for_linux;
208     uint64_t file_loaded_end_addr;
209     char *boot_kernel_filename;
210     char *boot_string_argument;
211     int automatic_clock_adjustment;
212     int exit_without_entering_debugger;
213     int n_gfx_cards;
214    
215 dpavlin 28 /* Instruction statistics: */
216     char *statistics_filename;
217     FILE *statistics_file;
218     int statistics_enabled;
219     char *statistics_fields; /* "vpi" etc. */
220    
221 dpavlin 6 /* Machine-dependent: (PROM stuff, etc.) */
222     union {
223     struct machine_arcbios arc;
224 dpavlin 24 struct machine_pmax pmax;
225 dpavlin 6 struct machine_pc pc;
226     } md;
227 dpavlin 4
228 dpavlin 22 /* OpenFirmware: */
229     struct of_data *of_data;
230    
231 dpavlin 14 /* Bus-specific interrupt data: */
232     struct isa_pic_data isa_pic_data;
233    
234 dpavlin 6 /* Machine-dependent interrupt specific structs: */
235     union {
236     struct kn230_csr *kn230_csr;
237     struct kn02_csr *kn02_csr;
238     struct dec_ioasic_data *dec_ioasic_data;
239     struct ps2_data *ps2_data;
240     struct dec5800_data *dec5800_csr;
241     struct au1x00_ic_data *au1x00_ic_data;
242     struct vr41xx_data *vr41xx_data;
243     struct jazz_data *jazz_data;
244 dpavlin 10 struct malta_data *malta_data;
245 dpavlin 6 struct sgi_ip20_data *sgi_ip20_data;
246     struct sgi_ip22_data *sgi_ip22_data;
247     struct sgi_ip30_data *sgi_ip30_data;
248     struct {
249     struct crime_data *crime_data;
250     struct mace_data *mace_data;
251     } ip32;
252 dpavlin 14 struct footbridge_data *footbridge_data;
253 dpavlin 20 struct bebox_data *bebox_data;
254     struct prep_data *prep_data;
255     struct cpc700_data *cpc700_data;
256 dpavlin 22 struct gc_data *gc_data;
257     struct v3_data *v3_data;
258 dpavlin 6 } md_int;
259    
260 dpavlin 4 /* X11/framebuffer stuff: */
261     int use_x11;
262     int x11_scaledown;
263 dpavlin 20 int x11_scaleup;
264 dpavlin 4 int x11_n_display_names;
265     char **x11_display_names;
266     int x11_current_display_name_nr; /* updated by x11.c */
267    
268     int n_fb_windows;
269     struct fb_window **fb_windows;
270     };
271    
272    
273 dpavlin 28 /* Tick function "prototype": */
274     #define DEVICE_TICK(x) void dev_ ## x ## _tick(struct cpu *cpu, void *extra)
275    
276    
277 dpavlin 4 /*
278     * Machine emulation types:
279     */
280    
281     #define ARCH_NOARCH 0
282     #define ARCH_MIPS 1
283     #define ARCH_PPC 2
284     #define ARCH_SPARC 3
285 dpavlin 12 #define ARCH_ALPHA 4
286     #define ARCH_X86 5
287     #define ARCH_ARM 6
288     #define ARCH_IA64 7
289     #define ARCH_M68K 8
290 dpavlin 14 #define ARCH_SH 9
291     #define ARCH_HPPA 10
292     #define ARCH_I960 11
293     #define ARCH_AVR 12
294 dpavlin 28 #define ARCH_TRANSPUTER 13
295 dpavlin 4
296     /* MIPS: */
297     #define MACHINE_BAREMIPS 1000
298     #define MACHINE_TESTMIPS 1001
299 dpavlin 22 #define MACHINE_PMAX 1002
300 dpavlin 4 #define MACHINE_COBALT 1003
301     #define MACHINE_HPCMIPS 1004
302     #define MACHINE_PS2 1005
303     #define MACHINE_SGI 1006
304     #define MACHINE_ARC 1007
305 dpavlin 24 #define MACHINE_NETGEAR 1008
306     #define MACHINE_SONYNEWS 1009
307     #define MACHINE_EVBMIPS 1010
308     #define MACHINE_PSP 1011
309     #define MACHINE_ALGOR 1012
310 dpavlin 28 #define MACHINE_QEMU_MIPS 1013
311 dpavlin 4
312     /* PPC: */
313     #define MACHINE_BAREPPC 2000
314     #define MACHINE_TESTPPC 2001
315     #define MACHINE_WALNUT 2002
316     #define MACHINE_PMPPC 2003
317     #define MACHINE_SANDPOINT 2004
318     #define MACHINE_BEBOX 2005
319     #define MACHINE_PREP 2006
320     #define MACHINE_MACPPC 2007
321     #define MACHINE_DB64360 2008
322 dpavlin 22 #define MACHINE_MVMEPPC 2009
323 dpavlin 4
324     /* SPARC: */
325     #define MACHINE_BARESPARC 3000
326 dpavlin 12 #define MACHINE_TESTSPARC 3001
327 dpavlin 24 #define MACHINE_SPARC 3002
328 dpavlin 4
329     /* Alpha: */
330 dpavlin 12 #define MACHINE_BAREALPHA 4000
331     #define MACHINE_TESTALPHA 4001
332     #define MACHINE_ALPHA 4002
333 dpavlin 4
334     /* X86: */
335 dpavlin 12 #define MACHINE_BAREX86 5000
336     #define MACHINE_X86 5001
337 dpavlin 4
338 dpavlin 6 /* ARM: */
339 dpavlin 12 #define MACHINE_BAREARM 6000
340     #define MACHINE_TESTARM 6001
341 dpavlin 14 #define MACHINE_CATS 6002
342     #define MACHINE_HPCARM 6003
343     #define MACHINE_ZAURUS 6004
344     #define MACHINE_NETWINDER 6005
345     #define MACHINE_SHARK 6006
346     #define MACHINE_IQ80321 6007
347     #define MACHINE_IYONIX 6008
348 dpavlin 22 #define MACHINE_TS7200 6009
349 dpavlin 6
350 dpavlin 12 /* IA64: */
351     #define MACHINE_BAREIA64 7000
352     #define MACHINE_TESTIA64 7001
353    
354     /* M68K: */
355     #define MACHINE_BAREM68K 8000
356     #define MACHINE_TESTM68K 8001
357    
358 dpavlin 14 /* SH: */
359     #define MACHINE_BARESH 9000
360     #define MACHINE_TESTSH 9001
361     #define MACHINE_HPCSH 9002
362    
363     /* HPPA: */
364     #define MACHINE_BAREHPPA 10000
365     #define MACHINE_TESTHPPA 10001
366    
367     /* I960: */
368     #define MACHINE_BAREI960 11000
369     #define MACHINE_TESTI960 11001
370    
371     /* AVR: */
372     #define MACHINE_BAREAVR 12000
373 dpavlin 24 #define MACHINE_AVR_PAL 12001
374     #define MACHINE_AVR_MAHPONG 12002
375 dpavlin 14
376 dpavlin 28 /* TRANSPUTER: */
377     #define MACHINE_BARETRANSPUTER 13000
378    
379 dpavlin 4 /* Other "pseudo"-machines: */
380     #define MACHINE_NONE 0
381     #define MACHINE_USERLAND 100000
382    
383     /* DEC: */
384     #define MACHINE_DEC_PMAX_3100 1
385     #define MACHINE_DEC_3MAX_5000 2
386     #define MACHINE_DEC_3MIN_5000 3
387     #define MACHINE_DEC_3MAXPLUS_5000 4
388     #define MACHINE_DEC_5800 5
389     #define MACHINE_DEC_5400 6
390     #define MACHINE_DEC_MAXINE_5000 7
391     #define MACHINE_DEC_5500 11
392     #define MACHINE_DEC_MIPSMATE_5100 12
393    
394     #define DEC_PROM_CALLBACK_STRUCT 0xffffffffbfc04000ULL
395     #define DEC_PROM_EMULATION 0xffffffffbfc08000ULL
396     #define DEC_PROM_INITIAL_ARGV (INITIAL_STACK_POINTER + 0x80)
397     #define DEC_PROM_STRINGS 0xffffffffbfc20000ULL
398     #define DEC_PROM_TCINFO 0xffffffffbfc2c000ULL
399     #define DEC_MEMMAP_ADDR 0xffffffffbfc30000ULL
400    
401     /* HPCmips: */
402     #define MACHINE_HPCMIPS_CASIO_BE300 1
403     #define MACHINE_HPCMIPS_CASIO_E105 2
404     #define MACHINE_HPCMIPS_NEC_MOBILEPRO_770 3
405     #define MACHINE_HPCMIPS_NEC_MOBILEPRO_780 4
406     #define MACHINE_HPCMIPS_NEC_MOBILEPRO_800 5
407     #define MACHINE_HPCMIPS_NEC_MOBILEPRO_880 6
408     #define MACHINE_HPCMIPS_AGENDA_VR3 7
409     #define MACHINE_HPCMIPS_IBM_WORKPAD_Z50 8
410    
411 dpavlin 14 /* HPCarm: */
412     #define MACHINE_HPCARM_IPAQ 1
413     #define MACHINE_HPCARM_JORNADA720 2
414    
415     /* HPCsh: */
416     #define MACHINE_HPCSH_JORNADA680 1
417     #define MACHINE_HPCSH_JORNADA690 2
418    
419 dpavlin 4 /* SGI and ARC: */
420     #define MACHINE_ARC_NEC_RD94 1
421     #define MACHINE_ARC_JAZZ_PICA 2
422     #define MACHINE_ARC_NEC_R94 3
423     #define MACHINE_ARC_DESKTECH_TYNE 4
424     #define MACHINE_ARC_JAZZ_MAGNUM 5
425     #define MACHINE_ARC_NEC_R98 6
426     #define MACHINE_ARC_JAZZ_M700 7
427     #define MACHINE_ARC_NEC_R96 8
428    
429 dpavlin 20 /* Algor: */
430     #define MACHINE_ALGOR_P4032 4
431     #define MACHINE_ALGOR_P5064 5
432    
433 dpavlin 8 /* EVBMIPS: */
434     #define MACHINE_EVBMIPS_MALTA 1
435 dpavlin 12 #define MACHINE_EVBMIPS_MALTA_BE 2
436 dpavlin 24 #define MACHINE_EVBMIPS_MESHCUBE 3
437     #define MACHINE_EVBMIPS_PB1000 4
438 dpavlin 8
439 dpavlin 22 /* PReP: */
440     #define MACHINE_PREP_IBM6050 1
441     #define MACHINE_PREP_MVME2400 2
442    
443 dpavlin 24 /* Sun SPARC: */
444     #define MACHINE_SPARC_SS5 1
445     #define MACHINE_SPARC_SS20 2
446     #define MACHINE_SPARC_ULTRA1 3
447     #define MACHINE_SPARC_ULTRA60 4
448    
449 dpavlin 4 /* MacPPC: TODO: Real model names */
450 dpavlin 24 #define MACHINE_MACPPC_G3 1
451     #define MACHINE_MACPPC_G4 2
452     #define MACHINE_MACPPC_G5 3
453 dpavlin 4
454 dpavlin 22 /* MVMEPPC */
455     #define MACHINE_MVMEPPC_1600 1
456     #define MACHINE_MVMEPPC_2100 2
457     #define MACHINE_MVMEPPC_5500 3
458    
459 dpavlin 6 /* X86: */
460     #define MACHINE_X86_GENERIC 1
461     #define MACHINE_X86_XT 2
462 dpavlin 4
463 dpavlin 6
464 dpavlin 22 /* For the automachine system: */
465     struct machine_entry_subtype {
466     int machine_subtype;/* Old-style subtype */
467     const char *name; /* Official name */
468     int n_aliases;
469     char **aliases; /* Aliases */
470     };
471    
472     struct machine_entry {
473     struct machine_entry *next;
474    
475     /* Machine type: */
476     int arch;
477     int machine_type; /* Old-style type */
478     const char *name; /* Official name */
479     int n_aliases;
480     char **aliases; /* Aliases */
481    
482     void (*setup)(struct machine *, struct cpu *);
483     void (*set_default_cpu)(struct machine *);
484     void (*set_default_ram)(struct machine *);
485    
486     /* Machine subtypes: */
487     int n_subtypes;
488     struct machine_entry_subtype **subtype;
489     };
490    
491     #define MACHINE_SETUP_TYPE(n) void (*n)(struct machine *, struct cpu *)
492     #define MACHINE_SETUP(x) void machine_setup_ ## x(struct machine *machine, \
493     struct cpu *cpu)
494     #define MACHINE_DEFAULT_CPU(x) void machine_default_cpu_ ## x(struct machine *machine)
495     #define MACHINE_DEFAULT_RAM(x) void machine_default_ram_ ## x(struct machine *machine)
496     #define MACHINE_REGISTER(x) void machine_register_ ## x(void)
497 dpavlin 26 #define MR_DEFAULT(x,name,arch,type) struct machine_entry \
498     *me = machine_entry_new(name,arch,type); \
499     me->setup = machine_setup_ ## x; \
500     me->set_default_cpu = machine_default_cpu_ ## x; \
501     machine_entry_register(me, arch);
502 dpavlin 22 void automachine_init(void);
503    
504    
505 dpavlin 4 /* machine.c: */
506     struct machine *machine_new(char *name, struct emul *emul);
507     int machine_name_to_type(char *stype, char *ssubtype,
508     int *type, int *subtype, int *arch);
509     void machine_add_tickfunction(struct machine *machine,
510 dpavlin 24 void (*func)(struct cpu *, void *), void *extra,
511     int clockshift, double hz);
512 dpavlin 28 void machine_statistics_init(struct machine *, char *fname);
513 dpavlin 22 void machine_register(char *name, MACHINE_SETUP_TYPE(setup));
514 dpavlin 4 void dump_mem_string(struct cpu *cpu, uint64_t addr);
515     void store_string(struct cpu *cpu, uint64_t addr, char *s);
516     int store_64bit_word(struct cpu *cpu, uint64_t addr, uint64_t data64);
517     int store_32bit_word(struct cpu *cpu, uint64_t addr, uint64_t data32);
518     int store_16bit_word(struct cpu *cpu, uint64_t addr, uint64_t data16);
519 dpavlin 6 void store_byte(struct cpu *cpu, uint64_t addr, uint8_t data);
520 dpavlin 4 void store_64bit_word_in_host(struct cpu *cpu, unsigned char *data,
521     uint64_t data32);
522     void store_32bit_word_in_host(struct cpu *cpu, unsigned char *data,
523     uint64_t data32);
524     void store_16bit_word_in_host(struct cpu *cpu, unsigned char *data,
525     uint16_t data16);
526     uint32_t load_32bit_word(struct cpu *cpu, uint64_t addr);
527     uint16_t load_16bit_word(struct cpu *cpu, uint64_t addr);
528     void store_buf(struct cpu *cpu, uint64_t addr, char *s, size_t len);
529 dpavlin 22 void add_environment_string(struct cpu *cpu, char *s, uint64_t *addr);
530     void add_environment_string_dual(struct cpu *cpu,
531     uint64_t *ptrp, uint64_t *addrp, char *s1, char *s2);
532     void store_pointer_and_advance(struct cpu *cpu, uint64_t *addrp,
533     uint64_t data, int flag64);
534 dpavlin 4 void machine_setup(struct machine *);
535     void machine_memsize_fix(struct machine *);
536     void machine_default_cputype(struct machine *);
537     void machine_dumpinfo(struct machine *);
538 dpavlin 22 void machine_bus_register(struct machine *, char *busname,
539     void (*debug_dump)(void *), void *extra);
540 dpavlin 26 int machine_run(struct machine *machine);
541 dpavlin 4 void machine_list_available_types_and_cpus(void);
542 dpavlin 22 struct machine_entry *machine_entry_new(const char *name,
543 dpavlin 26 int arch, int oldstyle_type);
544     void machine_entry_add_alias(struct machine_entry *me, const char *name);
545     void machine_entry_add_subtype(struct machine_entry *me, const char *name,
546     int oldstyle_subtype, ...);
547     void machine_entry_register(struct machine_entry *me, int arch);
548 dpavlin 4 void machine_init(void);
549    
550    
551     #endif /* MACHINE_H */

  ViewVC Help
Powered by ViewVC 1.1.26