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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 22 - (show annotations)
Mon Oct 8 16:19:37 2007 UTC (16 years, 5 months ago) by dpavlin
File MIME type: text/plain
File size: 15659 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.1121 2006/02/18 21:03:08 debug Exp $
20051126	Cobalt and PReP now work with the 21143 NIC.
		Continuing on Alpha dyntrans things.
		Fixing some more left-shift-by-24 to unsigned.
20051127	Working on OpenFirmware emulation; major cleanup/redesign.
		Progress on MacPPC emulation: NetBSD detects two CPUs (when
		running with -n 2), framebuffer output (for text) works.
		Adding quick-hack Bandit PCI controller and "gc" interrupt
		controller for MacPPC.
20051128	Changing from a Bandit to a Uni-North controller for macppc.
		Continuing on OpenFirmware and MacPPC emulation in general
		(obio controller, and wdc attached to the obio seems to work).
20051129	More work on MacPPC emulation (adding a dummy ADB controller).
		Continuing the PCI bus cleanup (endianness and tag composition)
		and rewriting all PCI controllers' access functions.
20051130	Various minor PPC dyntrans optimizations.
		Manually inlining some parts of the framebuffer redraw routine.
		Slowly beginning the conversion of the old MIPS emulation into
		dyntrans (but this will take quite some time to get right).
		Generalizing quick_pc_to_pointers.
20051201	Documentation update (David Muse has made available a kernel
		which simplifies Debian/DECstation installation).
		Continuing on the ADB bus controller.
20051202	Beginning a rewrite of the Zilog serial controller (dev_zs).
20051203	Continuing on the zs rewrite (now called dev_z8530); conversion
		to devinit style.
		Reworking some of the input-only vs output-only vs input-output
		details of src/console.c, better warning messages, and adding
		a debug dump.
		Removing the concept of "device state"; it wasn't really used.
		Changing some debug output (-vv should now be used to show all
		details about devices and busses; not shown during normal
		startup anymore).
		Beginning on some SPARC instruction disassembly support.
20051204	Minor PPC updates (WALNUT skeleton stuff).
		Continuing on the MIPS dyntrans rewrite.
		More progress on the ADB controller (a keyboard is "detected"
		by NetBSD and OpenBSD).
		Downgrading OpenBSD/arc as a guest OS from "working" to
		"almost working" in the documentation.
		Progress on Algor emulation ("v3" PCI controller).
20051205	Minor updates.
20051207	Sorting devices according to address; this reduces complexity
		of device lookups from O(n) to O(log n) in memory_rw (but no
		real performance increase (yet) in experiments).
20051210	Beginning the work on native dyntrans backends (by making a
		simple skeleton; so far only for Alpha hosts).
20051211	Some very minor SPARC updates.
20051215	Fixing a bug in the MIPS mul (note: not mult) instruction,
		so it also works with non-64-bit emulation. (Thanks to Alec
		Voropay for noticing the problem.)
20051216	More work on the fake/empty/simple/skeleton/whatever backend;
		performance doesn't increase, so this isn't really worth it,
		but it was probably worth it to prepare for a real backend
		later.
20051219	More instr call statistics gathering and analysis stuff.
20051220	Another fix for MIPS 'mul'. Also converting mul and {d,}cl{o,z}
		to dyntrans.
		memory_ppc.c syntax error fix (noticed by Peter Valchev).
		Beginning to move out machines from src/machine.c into
		individual files in src/machines (in a way similar to the
		autodev system for devices).
20051222	Updating the documentation regarding NetBSD/pmax 3.0.
20051223	- " - NetBSD/cats 3.0.
20051225	- " - NetBSD/hpcmips 3.0.
20051226	Continuing on the machine registry redesign.
		Adding support for ARM rrx (33-bit rotate).
		Fixing some signed/unsigned issues (exposed by gcc -W).
20051227	Fixing the bug which prevented a NetBSD/prep 3.0 install kernel
		from starting (triggered when an mtmsr was the last instruction
		on a page). Unfortunately not enough to get the kernel to run
		as well as the 2.1 kernels did.
20051230	Some dyntrans refactoring.
20051231	Continuing on the machine registry redesign.
20060101-10	Continuing... moving more machines. Moving MD interrupt stuff
		from machine.c into a new src/machines/interrupts.c.
20060114	Adding various mvmeppc machine skeletons.
20060115	Continuing on mvme* stuff. NetBSD/mvmeppc prints boot messages
		(for MVME1600) and reaches the root device prompt, but no
		specific hardware devices are emulated yet.
20060116	Minor updates to the mvme1600 emulation mode; the Eagle PCI bus
		seems to work without much modification, and a 21143 can be
		detected, interrupts might work (but untested so far).
		Adding a fake MK48Txx (mkclock) device, for NetBSD/mvmeppc.
20060121	Adding an aux control register for ARM. (A BIG thank you to
		Olivier Houchard for tracking down this bug.)
20060122	Adding more ARM instructions (smulXY), and dev_iq80321_7seg.
20060124	Adding disassembly of more ARM instructions (mia*, mra/mar),
		and some semi-bogus XScale and i80321 registers.
20060201-02	Various minor updates. Moving the last machines out of
		machine.c.
20060204	Adding a -c command line option, for running debugger commands
		before the simulation starts, but after all files have been
		loaded.
		Minor iq80321-related updates.
20060209	Minor hacks (DEVINIT macro, etc).
		Preparing for the generalization of the 64-bit dyntrans address
		translation subsystem.
20060216	Adding ARM ldrd (double-register load).
20060217	Continuing on various ARM-related stuff.
20060218	More progress on the ATA/wdc emulation for NetBSD/iq80321.
		NetBSD/evbarm can now be installed :-)  Updating the docs, etc.
		Continuing on Algor emulation.

==============  RELEASE 0.3.8  ==============


1 #ifndef MACHINE_H
2 #define MACHINE_H
3
4 /*
5 * Copyright (C) 2005-2006 Anders Gavare. All rights reserved.
6 *
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 * $Id: machine.h,v 1.105 2006/02/18 13:42:39 debug Exp $
32 */
33
34 #include <sys/types.h>
35 #include <sys/time.h>
36
37
38 #include "symbol.h"
39
40 #include "machine_arc.h"
41 #include "machine_x86.h"
42
43
44 #define MAX_BREAKPOINTS 8
45 #define BREAKPOINT_FLAG_R 1
46
47 #define MAX_TICK_FUNCTIONS 14
48
49 struct cpu_family;
50 struct diskimage;
51 struct emul;
52 struct fb_window;
53 struct memory;
54 struct of_data;
55
56 /* Ugly: */
57 struct kn230_csr;
58 struct kn02_csr;
59 struct dec_ioasic_data;
60 struct ps2_data;
61 struct footbridge_data;
62 struct dec5800_data;
63 struct au1x00_ic_data;
64 struct malta_data;
65 struct vr41xx_data;
66 struct jazz_data;
67 struct crime_data;
68 struct mace_data;
69 struct sgi_ip20_data;
70 struct sgi_ip22_data;
71 struct sgi_ip30_data;
72 struct isa_pic_data {
73 struct pic8259_data *pic1;
74 struct pic8259_data *pic2;
75 int last_int;
76 int native_irq;
77 };
78
79
80 struct machine_bus {
81 struct machine_bus *next;
82
83 char *name;
84
85 void (*debug_dump)(void *);
86 void *extra;
87 };
88
89
90 #define MACHINE_NAME_MAXBUF 150
91
92 struct machine {
93 /* Pointer back to the emul struct we are in: */
94 struct emul *emul;
95
96 /* Name as choosen by the user: */
97 char *name;
98
99 int arch; /* ARCH_MIPS, ARCH_PPC, .. */
100 int machine_type; /* MACHINE_PMAX, .. */
101 int machine_subtype; /* MACHINE_DEC_3MAX_5000, .. */
102
103 /* Name set by code in src/machines/machine_*.c: */
104 char *machine_name;
105
106 int stable; /* startup warning for non-stable
107 emulation modes. */
108
109 /* The serial number is mostly used when emulating multiple machines
110 in a network. nr_of_nics is the current nr of network cards, which
111 is useful when emulating multiple cards in one machine: */
112 int serial_nr;
113 int nr_of_nics;
114
115 struct cpu_family *cpu_family;
116
117 /*
118 * The "mainbus":
119 *
120 * o) memory
121 * o) devices
122 * o) CPUs
123 */
124
125 struct memory *memory;
126
127 int main_console_handle;
128
129 /* Hardware devices, run every x clock cycles. */
130 int n_tick_entries;
131 int ticks_till_next[MAX_TICK_FUNCTIONS];
132 int ticks_reset_value[MAX_TICK_FUNCTIONS];
133 void (*tick_func[MAX_TICK_FUNCTIONS])(struct cpu *, void *);
134 void *tick_extra[MAX_TICK_FUNCTIONS];
135
136 void (*md_interrupt)(struct machine *m, struct cpu *cpu,
137 int irq_nr, int assert);
138
139 char *cpu_name; /* TODO: remove this, there could be several
140 cpus with different names in a machine */
141 int byte_order_override;
142 int bootstrap_cpu;
143 int use_random_bootstrap_cpu;
144 int start_paused;
145 int ncpus;
146 struct cpu **cpus;
147
148 /* Registered busses: */
149 struct machine_bus *first_bus;
150 int n_busses;
151
152 /* These are used by stuff in cpu.c, mostly: */
153 int64_t ncycles;
154 int64_t ncycles_show;
155 int64_t ncycles_flush;
156 int64_t ncycles_since_gettimeofday;
157 struct timeval starttime;
158 int a_few_cycles;
159 int a_few_instrs;
160
161 struct diskimage *first_diskimage;
162
163 struct symbol_context symbol_context;
164
165 int random_mem_contents;
166 int physical_ram_in_mb;
167 int memory_offset_in_mb;
168 int prom_emulation;
169 int register_dump;
170 int arch_pagesize;
171
172 int bootdev_type;
173 int bootdev_id;
174 char *bootstr;
175 char *bootarg;
176
177 int n_breakpoints;
178 char *breakpoint_string[MAX_BREAKPOINTS];
179 uint64_t breakpoint_addr[MAX_BREAKPOINTS];
180 int breakpoint_flags[MAX_BREAKPOINTS];
181
182 /* Cache sizes: (1 << x) x=0 for default values */
183 /* TODO: these are _PER CPU_! */
184 int cache_picache;
185 int cache_pdcache;
186 int cache_secondary;
187 int cache_picache_linesize;
188 int cache_pdcache_linesize;
189 int cache_secondary_linesize;
190
191 int dbe_on_nonexistant_memaccess;
192 int dyntrans_alignment_check;
193 int bintrans_enable;
194 int old_bintrans_enable;
195 int bintrans_enabled_from_start;
196 size_t bintrans_size;
197 int instruction_trace;
198 int single_step_on_bad_addr;
199 int show_nr_of_instructions;
200 int show_symbolic_register_names;
201 int64_t max_instructions;
202 int emulated_hz;
203 int max_random_cycles_per_chunk;
204 int speed_tricks;
205 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
212 int automatic_clock_adjustment;
213 int exit_without_entering_debugger;
214 int show_trace_tree;
215
216 int n_gfx_cards;
217
218 /* Machine-dependent: (PROM stuff, etc.) */
219 union {
220 struct machine_arcbios arc;
221 struct machine_pc pc;
222 } md;
223
224 /* OpenFirmware: */
225 struct of_data *of_data;
226
227 /* Bus-specific interrupt data: */
228 struct isa_pic_data isa_pic_data;
229
230 /* Machine-dependent interrupt specific structs: */
231 union {
232 struct kn230_csr *kn230_csr;
233 struct kn02_csr *kn02_csr;
234 struct dec_ioasic_data *dec_ioasic_data;
235 struct ps2_data *ps2_data;
236 struct dec5800_data *dec5800_csr;
237 struct au1x00_ic_data *au1x00_ic_data;
238 struct vr41xx_data *vr41xx_data;
239 struct jazz_data *jazz_data;
240 struct malta_data *malta_data;
241 struct sgi_ip20_data *sgi_ip20_data;
242 struct sgi_ip22_data *sgi_ip22_data;
243 struct sgi_ip30_data *sgi_ip30_data;
244 struct {
245 struct crime_data *crime_data;
246 struct mace_data *mace_data;
247 } ip32;
248 struct footbridge_data *footbridge_data;
249 struct bebox_data *bebox_data;
250 struct prep_data *prep_data;
251 struct cpc700_data *cpc700_data;
252 struct gc_data *gc_data;
253 struct v3_data *v3_data;
254 } md_int;
255
256 /* X11/framebuffer stuff: */
257 int use_x11;
258 int x11_scaledown;
259 int x11_scaleup;
260 int x11_n_display_names;
261 char **x11_display_names;
262 int x11_current_display_name_nr; /* updated by x11.c */
263
264 int n_fb_windows;
265 struct fb_window **fb_windows;
266 };
267
268
269 /*
270 * Machine emulation types:
271 */
272
273 #define ARCH_NOARCH 0
274 #define ARCH_MIPS 1
275 #define ARCH_PPC 2
276 #define ARCH_SPARC 3
277 #define ARCH_ALPHA 4
278 #define ARCH_X86 5
279 #define ARCH_ARM 6
280 #define ARCH_IA64 7
281 #define ARCH_M68K 8
282 #define ARCH_SH 9
283 #define ARCH_HPPA 10
284 #define ARCH_I960 11
285 #define ARCH_AVR 12
286
287 /* MIPS: */
288 #define MACHINE_BAREMIPS 1000
289 #define MACHINE_TESTMIPS 1001
290 #define MACHINE_PMAX 1002
291 #define MACHINE_COBALT 1003
292 #define MACHINE_HPCMIPS 1004
293 #define MACHINE_PS2 1005
294 #define MACHINE_SGI 1006
295 #define MACHINE_ARC 1007
296 #define MACHINE_MESHCUBE 1008
297 #define MACHINE_NETGEAR 1009
298 #define MACHINE_SONYNEWS 1010
299 #define MACHINE_EVBMIPS 1011
300 #define MACHINE_PSP 1012
301 #define MACHINE_ALGOR 1013
302
303 /* PPC: */
304 #define MACHINE_BAREPPC 2000
305 #define MACHINE_TESTPPC 2001
306 #define MACHINE_WALNUT 2002
307 #define MACHINE_PMPPC 2003
308 #define MACHINE_SANDPOINT 2004
309 #define MACHINE_BEBOX 2005
310 #define MACHINE_PREP 2006
311 #define MACHINE_MACPPC 2007
312 #define MACHINE_DB64360 2008
313 #define MACHINE_MVMEPPC 2009
314
315 /* SPARC: */
316 #define MACHINE_BARESPARC 3000
317 #define MACHINE_TESTSPARC 3001
318 #define MACHINE_ULTRA1 3002
319
320 /* Alpha: */
321 #define MACHINE_BAREALPHA 4000
322 #define MACHINE_TESTALPHA 4001
323 #define MACHINE_ALPHA 4002
324
325 /* X86: */
326 #define MACHINE_BAREX86 5000
327 #define MACHINE_X86 5001
328
329 /* ARM: */
330 #define MACHINE_BAREARM 6000
331 #define MACHINE_TESTARM 6001
332 #define MACHINE_CATS 6002
333 #define MACHINE_HPCARM 6003
334 #define MACHINE_ZAURUS 6004
335 #define MACHINE_NETWINDER 6005
336 #define MACHINE_SHARK 6006
337 #define MACHINE_IQ80321 6007
338 #define MACHINE_IYONIX 6008
339 #define MACHINE_TS7200 6009
340
341 /* IA64: */
342 #define MACHINE_BAREIA64 7000
343 #define MACHINE_TESTIA64 7001
344
345 /* M68K: */
346 #define MACHINE_BAREM68K 8000
347 #define MACHINE_TESTM68K 8001
348
349 /* SH: */
350 #define MACHINE_BARESH 9000
351 #define MACHINE_TESTSH 9001
352 #define MACHINE_HPCSH 9002
353
354 /* HPPA: */
355 #define MACHINE_BAREHPPA 10000
356 #define MACHINE_TESTHPPA 10001
357
358 /* I960: */
359 #define MACHINE_BAREI960 11000
360 #define MACHINE_TESTI960 11001
361
362 /* AVR: */
363 #define MACHINE_BAREAVR 12000
364
365 /* Other "pseudo"-machines: */
366 #define MACHINE_NONE 0
367 #define MACHINE_USERLAND 100000
368
369 /* DEC: */
370 #define MACHINE_DEC_PMAX_3100 1
371 #define MACHINE_DEC_3MAX_5000 2
372 #define MACHINE_DEC_3MIN_5000 3
373 #define MACHINE_DEC_3MAXPLUS_5000 4
374 #define MACHINE_DEC_5800 5
375 #define MACHINE_DEC_5400 6
376 #define MACHINE_DEC_MAXINE_5000 7
377 #define MACHINE_DEC_5500 11
378 #define MACHINE_DEC_MIPSMATE_5100 12
379
380 #define DEC_PROM_CALLBACK_STRUCT 0xffffffffbfc04000ULL
381 #define DEC_PROM_EMULATION 0xffffffffbfc08000ULL
382 #define DEC_PROM_INITIAL_ARGV (INITIAL_STACK_POINTER + 0x80)
383 #define DEC_PROM_STRINGS 0xffffffffbfc20000ULL
384 #define DEC_PROM_TCINFO 0xffffffffbfc2c000ULL
385 #define DEC_MEMMAP_ADDR 0xffffffffbfc30000ULL
386
387 /* HPCmips: */
388 #define MACHINE_HPCMIPS_CASIO_BE300 1
389 #define MACHINE_HPCMIPS_CASIO_E105 2
390 #define MACHINE_HPCMIPS_NEC_MOBILEPRO_770 3
391 #define MACHINE_HPCMIPS_NEC_MOBILEPRO_780 4
392 #define MACHINE_HPCMIPS_NEC_MOBILEPRO_800 5
393 #define MACHINE_HPCMIPS_NEC_MOBILEPRO_880 6
394 #define MACHINE_HPCMIPS_AGENDA_VR3 7
395 #define MACHINE_HPCMIPS_IBM_WORKPAD_Z50 8
396
397 /* HPCarm: */
398 #define MACHINE_HPCARM_IPAQ 1
399 #define MACHINE_HPCARM_JORNADA720 2
400
401 /* HPCsh: */
402 #define MACHINE_HPCSH_JORNADA680 1
403 #define MACHINE_HPCSH_JORNADA690 2
404
405 /* Playstation 2: */
406 #define PLAYSTATION2_BDA 0xffffffffa0001000ULL
407 #define PLAYSTATION2_OPTARGS 0xffffffff81fff100ULL
408 #define PLAYSTATION2_SIFBIOS 0xffffffffbfc10000ULL
409
410 /* SGI and ARC: */
411 #define MACHINE_ARC_NEC_RD94 1
412 #define MACHINE_ARC_JAZZ_PICA 2
413 #define MACHINE_ARC_NEC_R94 3
414 #define MACHINE_ARC_DESKTECH_TYNE 4
415 #define MACHINE_ARC_JAZZ_MAGNUM 5
416 #define MACHINE_ARC_NEC_R98 6
417 #define MACHINE_ARC_JAZZ_M700 7
418 #define MACHINE_ARC_NEC_R96 8
419
420 /* Algor: */
421 #define MACHINE_ALGOR_P4032 4
422 #define MACHINE_ALGOR_P5064 5
423
424 /* EVBMIPS: */
425 #define MACHINE_EVBMIPS_MALTA 1
426 #define MACHINE_EVBMIPS_MALTA_BE 2
427 #define MACHINE_EVBMIPS_PB1000 3
428
429 /* PReP: */
430 #define MACHINE_PREP_IBM6050 1
431 #define MACHINE_PREP_MVME2400 2
432
433 /* MacPPC: TODO: Real model names */
434 #define MACHINE_MACPPC_G4 1
435 #define MACHINE_MACPPC_G5 2
436
437 /* MVMEPPC */
438 #define MACHINE_MVMEPPC_1600 1
439 #define MACHINE_MVMEPPC_2100 2
440 #define MACHINE_MVMEPPC_5500 3
441
442 /* X86: */
443 #define MACHINE_X86_GENERIC 1
444 #define MACHINE_X86_XT 2
445
446
447 /*
448 * Problem: kernels seem to be loaded at low addresses in RAM, so
449 * storing environment strings and memory descriptors there is a bad
450 * idea. They are stored at 0xbfc..... instead. The ARC SPB must
451 * be at physical address 0x1000 though.
452 */
453 #define SGI_SPB_ADDR 0xffffffff80001000ULL
454 /* 0xbfc10000 is firmware callback vector stuff */
455 #define ARC_FIRMWARE_VECTORS 0xffffffffbfc80000ULL
456 #define ARC_FIRMWARE_ENTRIES 0xffffffffbfc88000ULL
457 #define ARC_ARGV_START 0xffffffffbfc90000ULL
458 #define ARC_ENV_STRINGS 0xffffffffbfc98000ULL
459 #define ARC_ENV_POINTERS 0xffffffffbfc9d000ULL
460 #define SGI_SYSID_ADDR 0xffffffffbfca1800ULL
461 #define ARC_DSPSTAT_ADDR 0xffffffffbfca1c00ULL
462 #define ARC_MEMDESC_ADDR 0xffffffffbfca1c80ULL
463 #define ARC_CONFIG_DATA_ADDR 0xffffffffbfca2000ULL
464 #define FIRST_ARC_COMPONENT 0xffffffffbfca8000ULL
465 #define ARC_PRIVATE_VECTORS 0xffffffffbfcb0000ULL
466 #define ARC_PRIVATE_ENTRIES 0xffffffffbfcb8000ULL
467
468
469 /* For the automachine system: */
470 struct machine_entry_subtype {
471 int machine_subtype;/* Old-style subtype */
472 const char *name; /* Official name */
473 int n_aliases;
474 char **aliases; /* Aliases */
475 };
476
477 struct machine_entry {
478 struct machine_entry *next;
479
480 /* Machine type: */
481 int arch;
482 int machine_type; /* Old-style type */
483 const char *name; /* Official name */
484 int n_aliases;
485 char **aliases; /* Aliases */
486
487 void (*setup)(struct machine *, struct cpu *);
488 void (*set_default_cpu)(struct machine *);
489 void (*set_default_ram)(struct machine *);
490
491 /* Machine subtypes: */
492 int n_subtypes;
493 struct machine_entry_subtype **subtype;
494 };
495
496 #define MACHINE_SETUP_TYPE(n) void (*n)(struct machine *, struct cpu *)
497 #define MACHINE_SETUP(x) void machine_setup_ ## x(struct machine *machine, \
498 struct cpu *cpu)
499 #define MACHINE_DEFAULT_CPU(x) void machine_default_cpu_ ## x(struct machine *machine)
500 #define MACHINE_DEFAULT_RAM(x) void machine_default_ram_ ## x(struct machine *machine)
501 #define MACHINE_REGISTER(x) void machine_register_ ## x(void)
502 #define MR_DEFAULT(x,name,arch,type,n,m) struct machine_entry \
503 *me = machine_entry_new(name,arch,type,n,m); \
504 me->setup = machine_setup_ ## x; \
505 me->set_default_cpu = machine_default_cpu_ ## x;
506 void automachine_init(void);
507
508
509 /* 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 void (*func)(struct cpu *, void *), void *extra, int clockshift);
515 void machine_register(char *name, MACHINE_SETUP_TYPE(setup));
516 void dump_mem_string(struct cpu *cpu, uint64_t addr);
517 void store_string(struct cpu *cpu, uint64_t addr, char *s);
518 int store_64bit_word(struct cpu *cpu, uint64_t addr, uint64_t data64);
519 int store_32bit_word(struct cpu *cpu, uint64_t addr, uint64_t data32);
520 int store_16bit_word(struct cpu *cpu, uint64_t addr, uint64_t data16);
521 void store_byte(struct cpu *cpu, uint64_t addr, uint8_t data);
522 void store_64bit_word_in_host(struct cpu *cpu, unsigned char *data,
523 uint64_t data32);
524 void store_32bit_word_in_host(struct cpu *cpu, unsigned char *data,
525 uint64_t data32);
526 void store_16bit_word_in_host(struct cpu *cpu, unsigned char *data,
527 uint16_t data16);
528 uint32_t load_32bit_word(struct cpu *cpu, uint64_t addr);
529 uint16_t load_16bit_word(struct cpu *cpu, uint64_t addr);
530 void store_buf(struct cpu *cpu, uint64_t addr, char *s, size_t len);
531 void add_environment_string(struct cpu *cpu, char *s, uint64_t *addr);
532 void add_environment_string_dual(struct cpu *cpu,
533 uint64_t *ptrp, uint64_t *addrp, char *s1, char *s2);
534 void store_pointer_and_advance(struct cpu *cpu, uint64_t *addrp,
535 uint64_t data, int flag64);
536 void machine_setup(struct machine *);
537 void machine_memsize_fix(struct machine *);
538 void machine_default_cputype(struct machine *);
539 void machine_dumpinfo(struct machine *);
540 void machine_bus_register(struct machine *, char *busname,
541 void (*debug_dump)(void *), void *extra);
542 void machine_list_available_types_and_cpus(void);
543 struct machine_entry *machine_entry_new(const char *name,
544 int arch, int oldstyle_type, int n_aliases, int n_subtypes);
545 struct machine_entry_subtype *machine_entry_subtype_new(
546 const char *name, int oldstyle_type, int n_aliases);
547 void machine_entry_add(struct machine_entry *me, int arch);
548 void machine_init(void);
549
550
551 #endif /* MACHINE_H */

  ViewVC Help
Powered by ViewVC 1.1.26