/[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 34 - (hide annotations)
Mon Oct 8 16:21:17 2007 UTC (16 years, 7 months ago) by dpavlin
File MIME type: text/plain
File size: 13985 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.1480 2007/02/19 01:34:42 debug Exp $
20061029	Changing usleep(1) calls in the debugger to usleep(10000)
20061107	Adding a new disk image option (-d o...) which sets the ISO9660
		filesystem base offset; also making some other hacks to allow
		NetBSD/dreamcast and homebrew demos/games to boot directly
		from a filesystem image.
		Moving Dreamcast-specific stuff in the documentation to its
		own page (dreamcast.html).
		Adding a border to the Dreamcast PVR framebuffer.
20061108	Adding a -T command line option (again?), for halting the
		emulator on unimplemented memory accesses.
20061109	Continuing on various SH4 and Dreamcast related things.
		The emulator should now halt on more unimplemented device
		accesses, instead of just printing a warning, forcing me to
		actually implement missing stuff :)
20061111	Continuing on SH4 and Dreamcast stuff.
		Adding a bogus Landisk (SH4) machine mode.
20061112	Implementing some parts of the Dreamcast GDROM device. With
		some ugly hacks, NetBSD can (barely) mount an ISO image.
20061113	NetBSD/dreamcast now starts booting from the Live CD image,
		but crashes randomly quite early on in the boot process.
20061122	Beginning on a skeleton interrupt.h and interrupt.c for the
		new interrupt subsystem.
20061124	Continuing on the new interrupt system; taking the first steps
		to attempt to connect CPUs (SuperH and MIPS) and devices
		(dev_cons and SH4 timer interrupts) to it. Many things will
		probably break from now on.
20061125	Converting dev_ns16550, dev_8253 to the new interrupt system.
		Attempting to begin to convert the ISA bus.
20061130	Incorporating a patch from Brian Foley for the configure
		script, which checks for X11 libs in /usr/X11R6/lib64 (which
		is used on some Linux systems).
20061227	Adding a note in the man page about booting from Dreamcast
		CDROM images (i.e. that no external kernel is needed).
20061229	Continuing on the interrupt system rewrite: beginning to
		convert more devices, adding abort() calls for legacy interrupt
		system calls so that everything now _has_ to be rewritten!
		Almost all machine modes are now completely broken.
20061230	More progress on removing old interrupt code, mostly related
		to the ISA bus + devices, the LCA bus (on AlphaBook1), and
		the Footbridge bus (for CATS). And some minor PCI stuff.
		Connecting the ARM cpu to the new interrupt system.
		The CATS, NetWinder, and QEMU_MIPS machine modes now work with
		the new interrupt system :)
20061231	Connecting PowerPC CPUs to the new interrupt system.
		Making PReP machines (IBM 6050) work again.
		Beginning to convert the GT PCI controller (for e.g. Malta
		and Cobalt emulation). Some things work, but not everything.
		Updating Copyright notices for 2007.
20070101	Converting dev_kn02 from legacy style to devinit; the 3max
		machine mode now works with the new interrupt system :-]
20070105	Beginning to convert the SGI O2 machine to the new interrupt
		system; finally converting O2 (IP32) devices to devinit, etc.
20070106	Continuing on the interrupt system redesign/rewrite; KN01
		(PMAX), KN230, and Dreamcast ASIC interrupts should work again,
		moving out stuff from machine.h and devices.h into the
		corresponding devices, beginning the rewrite of i80321
		interrupts, etc.
20070107	Beginning on the rewrite of Eagle interrupt stuff (PReP, etc).
20070117	Beginning the rewrite of Algor (V3) interrupts (finally
		changing dev_v3 into devinit style).
20070118	Removing the "bus" registry concept from machine.h, because
		it was practically meaningless.
		Continuing on the rewrite of Algor V3 ISA interrupts.
20070121	More work on Algor interrupts; they are now working again,
		well enough to run NetBSD/algor. :-)
20070122	Converting VR41xx (HPCmips) interrupts. NetBSD/hpcmips
		can be installed using the new interrupt system :-)
20070123	Making the testmips mode work with the new interrupt system.
20070127	Beginning to convert DEC5800 devices to devinit, and to the
		new interrupt system.
		Converting Playstation 2 devices to devinit, and converting
		the interrupt system. Also fixing a severe bug: the interrupt
		mask register on Playstation 2 is bitwise _toggled_ on writes.
20070128	Removing the dummy NetGear machine mode and the 8250 device
		(which was only used by the NetGear machine).
		Beginning to convert the MacPPC GC (Grand Central) interrupt
		controller to the new interrupt system.
		Converting Jazz interrupts (PICA61 etc.) to the new interrupt
		system. NetBSD/arc can be installed again :-)
		Fixing the JAZZ timer (hardcoding it at 100 Hz, works with
		NetBSD and it is better than a completely dummy timer as it
		was before).
		Converting dev_mp to the new interrupt system, although I
		haven't had time to actually test it yet.
		Completely removing src/machines/interrupts.c, cpu_interrupt
		and cpu_interrupt_ack in src/cpu.c, and
		src/include/machine_interrupts.h! Adding fatal error messages
		+ abort() in the few places that are left to fix.
		Converting dev_z8530 to the new interrupt system.
		FINALLY removing the md_int struct completely from the
		machine struct.
		SH4 fixes (adding a PADDR invalidation in the ITLB replacement
		code in memory_sh.c); the NetBSD/dreamcast LiveCD now runs
		all the way to the login prompt, and can be interacted with :-)
		Converting the CPC700 controller (PCI and interrupt controller
		for PM/PPC) to the new interrupt system.
20070129	Fixing MACE ISA interrupts (SGI IP32 emulation). Both NetBSD/
		sgimips' and OpenBSD/sgi's ramdisk kernels can now be
		interacted with again.
20070130	Moving out the MIPS multi_lw and _sw instruction combinations
		so that they are auto-generated at compile time instead.
20070131	Adding detection of amd64/x86_64 hosts in the configure script,
		for doing initial experiments (again :-) with native code
		generation.
		Adding a -k command line option to set the size of the dyntrans
		cache, and a -B command line option to disable native code
		generation, even if GXemul was compiled with support for
		native code generation for the specific host CPU architecture.
20070201	Experimenting with a skeleton for native code generation.
		Changing the default behaviour, so that native code generation
		is now disabled by default, and has to be enabled by using
		-b on the command line.
20070202	Continuing the native code generation experiments.
		Making PCI interrupts work for Footbridge again.
20070203	More native code generation experiments.
		Removing most of the native code generation experimental code,
		it does not make sense to include any quick hacks like this.
		Minor cleanup/removal of some more legacy MIPS interrupt code.
20070204	Making i80321 interrupts work again (for NetBSD/evbarm etc.),
		and fixing the timer at 100 Hz.
20070206	Experimenting with removing the wdc interrupt slowness hack.
20070207	Lowering the number of dyntrans TLB entries for MIPS from
		192 to 128, resulting in a minor speed improvement.
		Minor optimization to the code invalidation routine in
		cpu_dyntrans.c.
20070208	Increasing (experimentally) the nr of dyntrans instructions per
		loop from 60 to 120.
20070210	Commenting out (experimentally) the dyntrans_device_danger
		detection in memory_rw.c.
		Changing the testmips and baremips machines to use a revision 2
		MIPS64 CPU by default, instead of revision 1.
		Removing the dummy i960, IA64, x86, AVR32, and HP PA-RISC
		files, the PC bios emulation, and the Olivetti M700 (ARC) and
		db64360 emulation modes.
20070211	Adding an "mp" demo to the demos directory, which tests the
		SMP functionality of the testmips machine.
		Fixing PReP interrupts some more. NetBSD/prep now boots again.
20070216	Adding a "nop workaround" for booting Mach/PMAX to the
		documentation; thanks to Artur Bujdoso for the values.
		Converting more of the MacPPC interrupt stuff to the new
		system.
		Beginning to convert BeBox interrupts to the new system.
		PPC603e should NOT have the PPC_NO_DEC flag! Removing it.
		Correcting BeBox clock speed (it was set to 100 in the NetBSD
		bootinfo block, but should be 33000000/4), allowing NetBSD
		to start without using the (incorrect) PPC_NO_DEC hack.
20070217	Implementing (slow) AltiVec vector loads and stores, allowing
		NetBSD/macppc to finally boot using the GENERIC kernel :-)
		Updating the documentation with install instructions for
		NetBSD/macppc.
20070218-19	Regression testing for the release.

==============  RELEASE 0.4.4  ==============


1 dpavlin 4 #ifndef MACHINE_H
2     #define MACHINE_H
3    
4     /*
5 dpavlin 34 * Copyright (C) 2005-2007 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 34 * $Id: machine.h,v 1.156 2007/02/10 14:29:55 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 4
43 dpavlin 14
44 dpavlin 4 #define MAX_BREAKPOINTS 8
45    
46 dpavlin 24 #define MAX_TICK_FUNCTIONS 16
47 dpavlin 4
48 dpavlin 28 #define MAX_STATISTICS_FIELDS 8
49    
50 dpavlin 4 struct cpu_family;
51     struct diskimage;
52     struct emul;
53     struct fb_window;
54     struct memory;
55 dpavlin 22 struct of_data;
56 dpavlin 32 struct settings;
57 dpavlin 4
58 dpavlin 32
59 dpavlin 34 /* TODO: This should probably go away... */
60 dpavlin 12 struct isa_pic_data {
61 dpavlin 20 struct pic8259_data *pic1;
62     struct pic8259_data *pic2;
63 dpavlin 30
64 dpavlin 32 int *pending_timer_interrupts;
65 dpavlin 20 int last_int;
66 dpavlin 12 };
67 dpavlin 4
68 dpavlin 12
69 dpavlin 4 struct machine {
70     /* Pointer back to the emul struct we are in: */
71     struct emul *emul;
72    
73 dpavlin 32 /* Settings: */
74     struct settings *settings;
75    
76 dpavlin 4 /* Name as choosen by the user: */
77     char *name;
78    
79 dpavlin 34 /* Full "path" to the machine, e.g. "emul[0].machine[0]": */
80     char *path;
81    
82 dpavlin 4 int arch; /* ARCH_MIPS, ARCH_PPC, .. */
83 dpavlin 22 int machine_type; /* MACHINE_PMAX, .. */
84 dpavlin 4 int machine_subtype; /* MACHINE_DEC_3MAX_5000, .. */
85    
86 dpavlin 34 /* NOTE/TODO: This isn't working yet: */
87 dpavlin 24 int cycle_accurate; /* Set to non-zero for cycle
88     accurate (slow) emulation. */
89    
90 dpavlin 22 /* Name set by code in src/machines/machine_*.c: */
91 dpavlin 4 char *machine_name;
92    
93 dpavlin 22 int stable; /* startup warning for non-stable
94     emulation modes. */
95    
96 dpavlin 4 /* The serial number is mostly used when emulating multiple machines
97     in a network. nr_of_nics is the current nr of network cards, which
98     is useful when emulating multiple cards in one machine: */
99     int serial_nr;
100     int nr_of_nics;
101    
102 dpavlin 28 /* TODO: How about multiple cpu familys in one machine? */
103 dpavlin 4 struct cpu_family *cpu_family;
104    
105     /*
106     * The "mainbus":
107     *
108     * o) memory
109     * o) devices
110     * o) CPUs
111     */
112    
113     struct memory *memory;
114    
115     int main_console_handle;
116    
117     /* Hardware devices, run every x clock cycles. */
118     int n_tick_entries;
119     int ticks_till_next[MAX_TICK_FUNCTIONS];
120     int ticks_reset_value[MAX_TICK_FUNCTIONS];
121     void (*tick_func[MAX_TICK_FUNCTIONS])(struct cpu *, void *);
122     void *tick_extra[MAX_TICK_FUNCTIONS];
123 dpavlin 24 double tick_hz[MAX_TICK_FUNCTIONS];
124 dpavlin 4
125     char *cpu_name; /* TODO: remove this, there could be several
126     cpus with different names in a machine */
127     int byte_order_override;
128     int bootstrap_cpu;
129     int use_random_bootstrap_cpu;
130     int start_paused;
131     int ncpus;
132     struct cpu **cpus;
133    
134     /* These are used by stuff in cpu.c, mostly: */
135 dpavlin 34 /* TODO: Move to cpu.h! */
136 dpavlin 28 int64_t ninstrs;
137     int64_t ninstrs_show;
138     int64_t ninstrs_flush;
139     int64_t ninstrs_since_gettimeofday;
140 dpavlin 10 struct timeval starttime;
141 dpavlin 4
142     struct diskimage *first_diskimage;
143    
144     struct symbol_context symbol_context;
145    
146     int random_mem_contents;
147     int physical_ram_in_mb;
148     int memory_offset_in_mb;
149     int prom_emulation;
150     int register_dump;
151 dpavlin 12 int arch_pagesize;
152 dpavlin 4
153 dpavlin 22 int bootdev_type;
154     int bootdev_id;
155     char *bootstr;
156     char *bootarg;
157    
158 dpavlin 24 struct debugger_gdb gdb;
159    
160 dpavlin 28 /* Breakpoints: */
161 dpavlin 4 int n_breakpoints;
162     char *breakpoint_string[MAX_BREAKPOINTS];
163     uint64_t breakpoint_addr[MAX_BREAKPOINTS];
164     int breakpoint_flags[MAX_BREAKPOINTS];
165    
166     /* Cache sizes: (1 << x) x=0 for default values */
167 dpavlin 34 /* TODO: these should be _PER CPU_! */
168 dpavlin 4 int cache_picache;
169     int cache_pdcache;
170     int cache_secondary;
171     int cache_picache_linesize;
172     int cache_pdcache_linesize;
173     int cache_secondary_linesize;
174    
175     int dbe_on_nonexistant_memaccess;
176 dpavlin 34 int halt_on_nonexistant_memaccess;
177 dpavlin 4 int instruction_trace;
178     int show_nr_of_instructions;
179 dpavlin 28 int show_trace_tree;
180 dpavlin 4 int show_symbolic_register_names;
181     int emulated_hz;
182 dpavlin 28 int allow_instruction_combinations;
183 dpavlin 4 char *userland_emul; /* NULL for no userland emulation */
184     int force_netboot;
185     int slow_serial_interrupts_hack_for_linux;
186     uint64_t file_loaded_end_addr;
187     char *boot_kernel_filename;
188     char *boot_string_argument;
189     int exit_without_entering_debugger;
190     int n_gfx_cards;
191    
192 dpavlin 28 /* Instruction statistics: */
193     char *statistics_filename;
194     FILE *statistics_file;
195     int statistics_enabled;
196     char *statistics_fields; /* "vpi" etc. */
197    
198 dpavlin 6 /* Machine-dependent: (PROM stuff, etc.) */
199     union {
200     struct machine_arcbios arc;
201 dpavlin 24 struct machine_pmax pmax;
202 dpavlin 34 struct of_data *of_data;
203 dpavlin 6 } md;
204 dpavlin 4
205 dpavlin 14 /* Bus-specific interrupt data: */
206 dpavlin 34 /* TODO: Remove! */
207 dpavlin 14 struct isa_pic_data isa_pic_data;
208    
209 dpavlin 4 /* X11/framebuffer stuff: */
210     int use_x11;
211     int x11_scaledown;
212 dpavlin 20 int x11_scaleup;
213 dpavlin 4 int x11_n_display_names;
214     char **x11_display_names;
215     int x11_current_display_name_nr; /* updated by x11.c */
216    
217     int n_fb_windows;
218     struct fb_window **fb_windows;
219     };
220    
221    
222 dpavlin 28 /* Tick function "prototype": */
223     #define DEVICE_TICK(x) void dev_ ## x ## _tick(struct cpu *cpu, void *extra)
224    
225    
226 dpavlin 4 /*
227     * Machine emulation types:
228     */
229    
230     #define ARCH_NOARCH 0
231     #define ARCH_MIPS 1
232     #define ARCH_PPC 2
233     #define ARCH_SPARC 3
234 dpavlin 12 #define ARCH_ALPHA 4
235 dpavlin 34 #define ARCH_ARM 5
236     #define ARCH_M68K 6
237     #define ARCH_SH 7
238     #define ARCH_AVR 8
239     #define ARCH_TRANSPUTER 9
240     #define ARCH_RCA180X 10
241 dpavlin 4
242     /* MIPS: */
243     #define MACHINE_BAREMIPS 1000
244     #define MACHINE_TESTMIPS 1001
245 dpavlin 22 #define MACHINE_PMAX 1002
246 dpavlin 4 #define MACHINE_COBALT 1003
247     #define MACHINE_HPCMIPS 1004
248     #define MACHINE_PS2 1005
249     #define MACHINE_SGI 1006
250     #define MACHINE_ARC 1007
251 dpavlin 24 #define MACHINE_NETGEAR 1008
252     #define MACHINE_SONYNEWS 1009
253     #define MACHINE_EVBMIPS 1010
254     #define MACHINE_PSP 1011
255     #define MACHINE_ALGOR 1012
256 dpavlin 28 #define MACHINE_QEMU_MIPS 1013
257 dpavlin 4
258     /* PPC: */
259     #define MACHINE_BAREPPC 2000
260     #define MACHINE_TESTPPC 2001
261     #define MACHINE_WALNUT 2002
262     #define MACHINE_PMPPC 2003
263     #define MACHINE_SANDPOINT 2004
264     #define MACHINE_BEBOX 2005
265     #define MACHINE_PREP 2006
266     #define MACHINE_MACPPC 2007
267 dpavlin 34 #define MACHINE_MVMEPPC 2008
268 dpavlin 4
269     /* SPARC: */
270     #define MACHINE_BARESPARC 3000
271 dpavlin 12 #define MACHINE_TESTSPARC 3001
272 dpavlin 24 #define MACHINE_SPARC 3002
273 dpavlin 4
274     /* Alpha: */
275 dpavlin 12 #define MACHINE_BAREALPHA 4000
276     #define MACHINE_TESTALPHA 4001
277     #define MACHINE_ALPHA 4002
278 dpavlin 4
279 dpavlin 6 /* ARM: */
280 dpavlin 34 #define MACHINE_BAREARM 5000
281     #define MACHINE_TESTARM 5001
282     #define MACHINE_CATS 5002
283     #define MACHINE_HPCARM 5003
284     #define MACHINE_ZAURUS 5004
285     #define MACHINE_NETWINDER 5005
286     #define MACHINE_SHARK 5006
287     #define MACHINE_IQ80321 5007
288     #define MACHINE_IYONIX 5008
289     #define MACHINE_TS7200 5009
290     #define MACHINE_QEMU_ARM 5010
291 dpavlin 6
292 dpavlin 12 /* M68K: */
293 dpavlin 34 #define MACHINE_BAREM68K 6000
294     #define MACHINE_TESTM68K 6001
295 dpavlin 12
296 dpavlin 14 /* SH: */
297 dpavlin 34 #define MACHINE_BARESH 7000
298     #define MACHINE_TESTSH 7001
299     #define MACHINE_HPCSH 7002
300     #define MACHINE_DREAMCAST 7003
301     #define MACHINE_LANDISK 7004
302 dpavlin 14
303     /* AVR: */
304 dpavlin 34 #define MACHINE_BAREAVR 8000
305     #define MACHINE_AVR_PAL 8001
306     #define MACHINE_AVR_MAHPONG 8002
307 dpavlin 14
308 dpavlin 28 /* TRANSPUTER: */
309 dpavlin 34 #define MACHINE_BARETRANSPUTER 9000
310 dpavlin 28
311 dpavlin 32 /* ARCH_RCA180X: */
312 dpavlin 34 #define MACHINE_BARE180X 10000
313     #define MACHINE_CHIP8 10001
314 dpavlin 32
315 dpavlin 4 /* Other "pseudo"-machines: */
316     #define MACHINE_NONE 0
317     #define MACHINE_USERLAND 100000
318    
319     /* DEC: */
320     #define MACHINE_DEC_PMAX_3100 1
321     #define MACHINE_DEC_3MAX_5000 2
322     #define MACHINE_DEC_3MIN_5000 3
323     #define MACHINE_DEC_3MAXPLUS_5000 4
324     #define MACHINE_DEC_5800 5
325     #define MACHINE_DEC_5400 6
326     #define MACHINE_DEC_MAXINE_5000 7
327     #define MACHINE_DEC_5500 11
328     #define MACHINE_DEC_MIPSMATE_5100 12
329    
330     #define DEC_PROM_CALLBACK_STRUCT 0xffffffffbfc04000ULL
331     #define DEC_PROM_EMULATION 0xffffffffbfc08000ULL
332     #define DEC_PROM_INITIAL_ARGV (INITIAL_STACK_POINTER + 0x80)
333     #define DEC_PROM_STRINGS 0xffffffffbfc20000ULL
334     #define DEC_PROM_TCINFO 0xffffffffbfc2c000ULL
335     #define DEC_MEMMAP_ADDR 0xffffffffbfc30000ULL
336    
337     /* HPCmips: */
338     #define MACHINE_HPCMIPS_CASIO_BE300 1
339     #define MACHINE_HPCMIPS_CASIO_E105 2
340     #define MACHINE_HPCMIPS_NEC_MOBILEPRO_770 3
341     #define MACHINE_HPCMIPS_NEC_MOBILEPRO_780 4
342     #define MACHINE_HPCMIPS_NEC_MOBILEPRO_800 5
343     #define MACHINE_HPCMIPS_NEC_MOBILEPRO_880 6
344     #define MACHINE_HPCMIPS_AGENDA_VR3 7
345     #define MACHINE_HPCMIPS_IBM_WORKPAD_Z50 8
346    
347 dpavlin 14 /* HPCarm: */
348     #define MACHINE_HPCARM_IPAQ 1
349     #define MACHINE_HPCARM_JORNADA720 2
350    
351     /* HPCsh: */
352     #define MACHINE_HPCSH_JORNADA680 1
353     #define MACHINE_HPCSH_JORNADA690 2
354    
355 dpavlin 4 /* SGI and ARC: */
356     #define MACHINE_ARC_NEC_RD94 1
357     #define MACHINE_ARC_JAZZ_PICA 2
358     #define MACHINE_ARC_NEC_R94 3
359     #define MACHINE_ARC_DESKTECH_TYNE 4
360     #define MACHINE_ARC_JAZZ_MAGNUM 5
361     #define MACHINE_ARC_NEC_R98 6
362     #define MACHINE_ARC_JAZZ_M700 7
363     #define MACHINE_ARC_NEC_R96 8
364    
365 dpavlin 20 /* Algor: */
366     #define MACHINE_ALGOR_P4032 4
367     #define MACHINE_ALGOR_P5064 5
368    
369 dpavlin 8 /* EVBMIPS: */
370     #define MACHINE_EVBMIPS_MALTA 1
371 dpavlin 12 #define MACHINE_EVBMIPS_MALTA_BE 2
372 dpavlin 24 #define MACHINE_EVBMIPS_MESHCUBE 3
373     #define MACHINE_EVBMIPS_PB1000 4
374 dpavlin 8
375 dpavlin 22 /* PReP: */
376     #define MACHINE_PREP_IBM6050 1
377     #define MACHINE_PREP_MVME2400 2
378    
379 dpavlin 24 /* Sun SPARC: */
380     #define MACHINE_SPARC_SS5 1
381     #define MACHINE_SPARC_SS20 2
382     #define MACHINE_SPARC_ULTRA1 3
383     #define MACHINE_SPARC_ULTRA60 4
384    
385 dpavlin 4 /* MacPPC: TODO: Real model names */
386 dpavlin 24 #define MACHINE_MACPPC_G3 1
387     #define MACHINE_MACPPC_G4 2
388     #define MACHINE_MACPPC_G5 3
389 dpavlin 4
390 dpavlin 22 /* MVMEPPC */
391     #define MACHINE_MVMEPPC_1600 1
392     #define MACHINE_MVMEPPC_2100 2
393     #define MACHINE_MVMEPPC_5500 3
394    
395 dpavlin 4
396 dpavlin 22 /* For the automachine system: */
397     struct machine_entry_subtype {
398     int machine_subtype;/* Old-style subtype */
399     const char *name; /* Official name */
400     int n_aliases;
401     char **aliases; /* Aliases */
402     };
403    
404     struct machine_entry {
405     struct machine_entry *next;
406    
407     /* Machine type: */
408     int arch;
409     int machine_type; /* Old-style type */
410     const char *name; /* Official name */
411     int n_aliases;
412     char **aliases; /* Aliases */
413    
414     void (*setup)(struct machine *, struct cpu *);
415     void (*set_default_cpu)(struct machine *);
416     void (*set_default_ram)(struct machine *);
417    
418     /* Machine subtypes: */
419     int n_subtypes;
420     struct machine_entry_subtype **subtype;
421     };
422    
423     #define MACHINE_SETUP_TYPE(n) void (*n)(struct machine *, struct cpu *)
424     #define MACHINE_SETUP(x) void machine_setup_ ## x(struct machine *machine, \
425     struct cpu *cpu)
426     #define MACHINE_DEFAULT_CPU(x) void machine_default_cpu_ ## x(struct machine *machine)
427     #define MACHINE_DEFAULT_RAM(x) void machine_default_ram_ ## x(struct machine *machine)
428     #define MACHINE_REGISTER(x) void machine_register_ ## x(void)
429 dpavlin 26 #define MR_DEFAULT(x,name,arch,type) struct machine_entry \
430     *me = machine_entry_new(name,arch,type); \
431     me->setup = machine_setup_ ## x; \
432     me->set_default_cpu = machine_default_cpu_ ## x; \
433     machine_entry_register(me, arch);
434 dpavlin 22 void automachine_init(void);
435    
436    
437 dpavlin 4 /* machine.c: */
438 dpavlin 34 struct machine *machine_new(char *name, struct emul *emul, int id);
439 dpavlin 32 void machine_destroy(struct machine *machine);
440 dpavlin 4 int machine_name_to_type(char *stype, char *ssubtype,
441     int *type, int *subtype, int *arch);
442     void machine_add_tickfunction(struct machine *machine,
443 dpavlin 24 void (*func)(struct cpu *, void *), void *extra,
444     int clockshift, double hz);
445 dpavlin 28 void machine_statistics_init(struct machine *, char *fname);
446 dpavlin 22 void machine_register(char *name, MACHINE_SETUP_TYPE(setup));
447 dpavlin 4 void dump_mem_string(struct cpu *cpu, uint64_t addr);
448     void store_string(struct cpu *cpu, uint64_t addr, char *s);
449     int store_64bit_word(struct cpu *cpu, uint64_t addr, uint64_t data64);
450     int store_32bit_word(struct cpu *cpu, uint64_t addr, uint64_t data32);
451     int store_16bit_word(struct cpu *cpu, uint64_t addr, uint64_t data16);
452 dpavlin 6 void store_byte(struct cpu *cpu, uint64_t addr, uint8_t data);
453 dpavlin 4 void store_64bit_word_in_host(struct cpu *cpu, unsigned char *data,
454     uint64_t data32);
455     void store_32bit_word_in_host(struct cpu *cpu, unsigned char *data,
456     uint64_t data32);
457     void store_16bit_word_in_host(struct cpu *cpu, unsigned char *data,
458     uint16_t data16);
459 dpavlin 32 uint64_t load_64bit_word(struct cpu *cpu, uint64_t addr);
460 dpavlin 4 uint32_t load_32bit_word(struct cpu *cpu, uint64_t addr);
461     uint16_t load_16bit_word(struct cpu *cpu, uint64_t addr);
462     void store_buf(struct cpu *cpu, uint64_t addr, char *s, size_t len);
463 dpavlin 22 void add_environment_string(struct cpu *cpu, char *s, uint64_t *addr);
464     void add_environment_string_dual(struct cpu *cpu,
465     uint64_t *ptrp, uint64_t *addrp, char *s1, char *s2);
466     void store_pointer_and_advance(struct cpu *cpu, uint64_t *addrp,
467     uint64_t data, int flag64);
468 dpavlin 4 void machine_setup(struct machine *);
469     void machine_memsize_fix(struct machine *);
470     void machine_default_cputype(struct machine *);
471     void machine_dumpinfo(struct machine *);
472 dpavlin 26 int machine_run(struct machine *machine);
473 dpavlin 4 void machine_list_available_types_and_cpus(void);
474 dpavlin 22 struct machine_entry *machine_entry_new(const char *name,
475 dpavlin 26 int arch, int oldstyle_type);
476     void machine_entry_add_alias(struct machine_entry *me, const char *name);
477     void machine_entry_add_subtype(struct machine_entry *me, const char *name,
478     int oldstyle_subtype, ...);
479     void machine_entry_register(struct machine_entry *me, int arch);
480 dpavlin 4 void machine_init(void);
481    
482    
483     #endif /* MACHINE_H */

  ViewVC Help
Powered by ViewVC 1.1.26