/[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 30 - (hide annotations)
Mon Oct 8 16:20:40 2007 UTC (16 years, 7 months ago) by dpavlin
File MIME type: text/plain
File size: 15532 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.1325 2006/08/15 15:38:37 debug Exp $
20060723	More Transputer instructions (pfix, nfix, opr, mint, ldl, ldlp,
		eqc, rev, ajw, stl, stlf, sthf, sub, ldnl, ldnlp, ldpi, move,
		wcnt, add, bcnt).
		Adding more SPARC instructions (andcc, addcc, bl, rdpr).
		Progress on the igsfb framebuffer used by NetBSD/netwinder.
		Enabling 8-bit fills in dev_fb.
		NetBSD/netwinder 3.0.1 can now run from a disk image :-)
20060724	Cleanup/performance fix for 64-bit virtual translation table
		updates (by removing the "timestamp" stuff). A full NetBSD/pmax
		3.0.1 install for R4400 has dropped from 667 seconds to 584 :)
		Fixing the igsfb "almost vga" color (it is 24-bit, not 18-bit).
		Adding some MIPS instruction combinations (3*lw, and 3*addu).
		The 8048 keyboard now turns off interrupt enable between the
		KBR_ACK and the KBR_RSTDONE, to work better with Linux 2.6.
		Not causing PPC DEC interrupts if PPC_NO_DEC is set for a
		specific CPU; NetBSD/bebox gets slightly further than before.
		Adding some more SPARC instructions: branches, udiv.
20060725	Refreshing dev_pckbc.c a little.
		Cleanups for the SH emulation mode, and adding the first
		"compact" (16-bit) instructions: various simple movs, nop,
		shll, stc, or, ldc.
20060726	Adding dummy "pcn" (AMD PCnet NIC) PCI glue.
20060727	Various cleanups; removing stuff from cpu.h, such as
		running_translated (not really meaningful anymore), and
		page flags (breaking into the debugger clears all translations
		anyway).
		Minor MIPS instruction combination updates.
20060807	Expanding the 3*sw and 3*lw MIPS instruction combinations to
		work with 2* and 4* too, resulting in a minor performance gain.
		Implementing a usleep hack for the RM52xx/MIPS32/MIPS64 "wait"
		instruction (when emulating 1 cpu).
20060808	Experimenting with some more MIPS instruction combinations.
		Implementing support for showing a (hardcoded 12x22) text
		cursor in igsfb.
20060809	Simplifying the NetBSD/evbmips (Malta) install instructions
		somewhat (by using a NetBSD/pmax ramdisk install kernel).
20060812	Experimenting more with the MIPS 'wait' instruction.
		PCI configuration register writes can now be handled, which
		allow PCI IDE controllers to work with NetBSD/Malta 3.0.1 and
		NetBSD/cobalt 3.0.1. (Previously only NetBSD 2.1 worked.)
20060813	Updating dev_gt.c based on numbers from Alec Voropay, to enable
		Linux 2.6 to use PCI on Malta.
		Continuing on Algor interrupt stuff.
20060814	Adding support for routing ISA interrupts to two different
		interrupts, making it possible to run NetBSD/algor :-)
20060814-15	Testing for the release.

==============  RELEASE 0.4.2  ==============


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

  ViewVC Help
Powered by ViewVC 1.1.26