2 |
#define MACHINE_H |
#define MACHINE_H |
3 |
|
|
4 |
/* |
/* |
5 |
* Copyright (C) 2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2005-2007 Anders Gavare. All rights reserved. |
6 |
* |
* |
7 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
8 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: machine.h,v 1.46 2005/04/16 02:02:28 debug Exp $ |
* $Id: machine.h,v 1.162 2007/04/19 15:18:16 debug Exp $ |
32 |
*/ |
*/ |
33 |
|
|
34 |
#include <sys/types.h> |
#include <sys/types.h> |
36 |
|
|
37 |
#include "symbol.h" |
#include "symbol.h" |
38 |
|
|
39 |
|
#include "machine_arc.h" |
40 |
|
#include "machine_pmax.h" |
41 |
|
|
42 |
|
|
43 |
#define MAX_BREAKPOINTS 8 |
#define MAX_BREAKPOINTS 8 |
|
#define BREAKPOINT_FLAG_R 1 |
|
44 |
|
|
45 |
#define MAX_TICK_FUNCTIONS 14 |
#define MAX_TICK_FUNCTIONS 16 |
46 |
|
|
47 |
|
#define MAX_STATISTICS_FIELDS 8 |
48 |
|
|
49 |
struct cpu_family; |
struct cpu_family; |
50 |
struct diskimage; |
struct diskimage; |
51 |
struct emul; |
struct emul; |
52 |
struct fb_window; |
struct fb_window; |
53 |
struct memory; |
struct memory; |
54 |
|
struct of_data; |
55 |
|
struct settings; |
56 |
|
|
57 |
|
|
58 |
|
/* TODO: This should probably go away... */ |
59 |
|
struct isa_pic_data { |
60 |
|
struct pic8259_data *pic1; |
61 |
|
struct pic8259_data *pic2; |
62 |
|
|
63 |
|
int *pending_timer_interrupts; |
64 |
|
int last_int; |
65 |
|
}; |
66 |
|
|
|
/* Ugly: */ |
|
|
struct kn230_csr; |
|
|
struct kn02_csr; |
|
|
struct dec_ioasic_data; |
|
|
struct ps2_data; |
|
|
struct dec5800_data; |
|
|
struct au1x00_ic_data; |
|
|
struct vr41xx_data; |
|
|
struct jazz_data; |
|
|
struct crime_data; |
|
|
struct mace_data; |
|
|
struct sgi_ip20_data; |
|
|
struct sgi_ip22_data; |
|
|
struct sgi_ip30_data; |
|
67 |
|
|
68 |
struct machine { |
struct machine { |
69 |
/* Pointer back to the emul struct we are in: */ |
/* Pointer back to the emul struct we are in: */ |
70 |
struct emul *emul; |
struct emul *emul; |
71 |
|
|
72 |
|
/* Settings: */ |
73 |
|
struct settings *settings; |
74 |
|
|
75 |
/* Name as choosen by the user: */ |
/* Name as choosen by the user: */ |
76 |
char *name; |
char *name; |
77 |
|
|
78 |
|
/* Full "path" to the machine, e.g. "emul[0].machine[0]": */ |
79 |
|
char *path; |
80 |
|
|
81 |
int arch; /* ARCH_MIPS, ARCH_PPC, .. */ |
int arch; /* ARCH_MIPS, ARCH_PPC, .. */ |
82 |
int machine_type; /* MACHINE_DEC, .. */ |
int machine_type; /* MACHINE_PMAX, .. */ |
83 |
int machine_subtype; /* MACHINE_DEC_3MAX_5000, .. */ |
int machine_subtype; /* MACHINE_DEC_3MAX_5000, .. */ |
84 |
|
|
85 |
|
/* NOTE/TODO: This isn't working yet: */ |
86 |
|
int cycle_accurate; /* Set to non-zero for cycle |
87 |
|
accurate (slow) emulation. */ |
88 |
|
|
89 |
|
/* Name set by code in src/machines/machine_*.c: */ |
90 |
char *machine_name; |
char *machine_name; |
91 |
|
|
92 |
|
int stable; /* startup warning for non-stable |
93 |
|
emulation modes. */ |
94 |
|
|
95 |
/* The serial number is mostly used when emulating multiple machines |
/* The serial number is mostly used when emulating multiple machines |
96 |
in a network. nr_of_nics is the current nr of network cards, which |
in a network. nr_of_nics is the current nr of network cards, which |
97 |
is useful when emulating multiple cards in one machine: */ |
is useful when emulating multiple cards in one machine: */ |
98 |
int serial_nr; |
int serial_nr; |
99 |
int nr_of_nics; |
int nr_of_nics; |
100 |
|
|
101 |
|
/* TODO: How about multiple cpu familys in one machine? */ |
102 |
struct cpu_family *cpu_family; |
struct cpu_family *cpu_family; |
103 |
|
|
104 |
/* |
/* |
119 |
int ticks_reset_value[MAX_TICK_FUNCTIONS]; |
int ticks_reset_value[MAX_TICK_FUNCTIONS]; |
120 |
void (*tick_func[MAX_TICK_FUNCTIONS])(struct cpu *, void *); |
void (*tick_func[MAX_TICK_FUNCTIONS])(struct cpu *, void *); |
121 |
void *tick_extra[MAX_TICK_FUNCTIONS]; |
void *tick_extra[MAX_TICK_FUNCTIONS]; |
122 |
|
double tick_hz[MAX_TICK_FUNCTIONS]; |
|
void (*md_interrupt)(struct machine *m, struct cpu *cpu, |
|
|
int irq_nr, int assert); |
|
123 |
|
|
124 |
char *cpu_name; /* TODO: remove this, there could be several |
char *cpu_name; /* TODO: remove this, there could be several |
125 |
cpus with different names in a machine */ |
cpus with different names in a machine */ |
131 |
struct cpu **cpus; |
struct cpu **cpus; |
132 |
|
|
133 |
/* These are used by stuff in cpu.c, mostly: */ |
/* These are used by stuff in cpu.c, mostly: */ |
134 |
|
/* TODO: Move to cpu.h! */ |
135 |
|
int64_t ninstrs; |
136 |
|
int64_t ninstrs_show; |
137 |
|
int64_t ninstrs_flush; |
138 |
|
int64_t ninstrs_since_gettimeofday; |
139 |
struct timeval starttime; |
struct timeval starttime; |
|
int64_t ncycles; |
|
|
int64_t ncycles_show; |
|
|
int64_t ncycles_flush; |
|
|
int a_few_cycles; |
|
|
int a_few_instrs; |
|
140 |
|
|
141 |
struct diskimage *first_diskimage; |
struct diskimage *first_diskimage; |
142 |
|
|
147 |
int memory_offset_in_mb; |
int memory_offset_in_mb; |
148 |
int prom_emulation; |
int prom_emulation; |
149 |
int register_dump; |
int register_dump; |
150 |
|
int arch_pagesize; |
151 |
|
|
152 |
|
int bootdev_type; |
153 |
|
int bootdev_id; |
154 |
|
char *bootstr; |
155 |
|
char *bootarg; |
156 |
|
|
157 |
|
/* Breakpoints: */ |
158 |
int n_breakpoints; |
int n_breakpoints; |
159 |
char *breakpoint_string[MAX_BREAKPOINTS]; |
char *breakpoint_string[MAX_BREAKPOINTS]; |
160 |
uint64_t breakpoint_addr[MAX_BREAKPOINTS]; |
uint64_t breakpoint_addr[MAX_BREAKPOINTS]; |
161 |
int breakpoint_flags[MAX_BREAKPOINTS]; |
int breakpoint_flags[MAX_BREAKPOINTS]; |
162 |
|
|
163 |
/* Cache sizes: (1 << x) x=0 for default values */ |
/* Cache sizes: (1 << x) x=0 for default values */ |
164 |
/* TODO: these are _PER CPU_! */ |
/* TODO: these should be _PER CPU_! */ |
165 |
int cache_picache; |
int cache_picache; |
166 |
int cache_pdcache; |
int cache_pdcache; |
167 |
int cache_secondary; |
int cache_secondary; |
170 |
int cache_secondary_linesize; |
int cache_secondary_linesize; |
171 |
|
|
172 |
int dbe_on_nonexistant_memaccess; |
int dbe_on_nonexistant_memaccess; |
173 |
int bintrans_enable; |
int halt_on_nonexistant_memaccess; |
|
int old_bintrans_enable; |
|
|
int bintrans_enabled_from_start; |
|
|
int bintrans_size; |
|
174 |
int instruction_trace; |
int instruction_trace; |
|
int single_step_on_bad_addr; |
|
175 |
int show_nr_of_instructions; |
int show_nr_of_instructions; |
176 |
|
int show_trace_tree; |
177 |
int show_symbolic_register_names; |
int show_symbolic_register_names; |
|
int64_t max_instructions; |
|
178 |
int emulated_hz; |
int emulated_hz; |
179 |
int max_random_cycles_per_chunk; |
int allow_instruction_combinations; |
|
int speed_tricks; |
|
180 |
char *userland_emul; /* NULL for no userland emulation */ |
char *userland_emul; /* NULL for no userland emulation */ |
181 |
int force_netboot; |
int force_netboot; |
182 |
int slow_serial_interrupts_hack_for_linux; |
int slow_serial_interrupts_hack_for_linux; |
183 |
uint64_t file_loaded_end_addr; |
uint64_t file_loaded_end_addr; |
184 |
char *boot_kernel_filename; |
char *boot_kernel_filename; |
185 |
char *boot_string_argument; |
char *boot_string_argument; |
|
|
|
|
int automatic_clock_adjustment; |
|
186 |
int exit_without_entering_debugger; |
int exit_without_entering_debugger; |
|
int show_trace_tree; |
|
|
|
|
187 |
int n_gfx_cards; |
int n_gfx_cards; |
188 |
|
|
189 |
/* Yuck, this is ugly: */ |
/* Instruction statistics: */ |
190 |
struct kn230_csr *kn230_csr; |
char *statistics_filename; |
191 |
struct kn02_csr *kn02_csr; |
FILE *statistics_file; |
192 |
struct dec_ioasic_data *dec_ioasic_data; |
int statistics_enabled; |
193 |
struct ps2_data *ps2_data; |
char *statistics_fields; /* "vpi" etc. */ |
194 |
struct dec5800_data *dec5800_csr; |
|
195 |
struct au1x00_ic_data *au1x00_ic_data; |
/* Machine-dependent: (PROM stuff, etc.) */ |
196 |
struct vr41xx_data *vr41xx_data; |
union { |
197 |
struct jazz_data *jazz_data; |
struct machine_arcbios arc; |
198 |
struct crime_data *crime_data; |
struct machine_pmax pmax; |
199 |
struct mace_data *mace_data; |
struct of_data *of_data; |
200 |
struct sgi_ip20_data *sgi_ip20_data; |
} md; |
201 |
struct sgi_ip22_data *sgi_ip22_data; |
|
202 |
struct sgi_ip30_data *sgi_ip30_data; |
/* Bus-specific interrupt data: */ |
203 |
|
/* TODO: Remove! */ |
204 |
|
struct isa_pic_data isa_pic_data; |
205 |
|
|
206 |
/* X11/framebuffer stuff: */ |
/* X11/framebuffer stuff: */ |
207 |
int use_x11; |
int use_x11; |
208 |
int x11_scaledown; |
int x11_scaledown; |
209 |
|
int x11_scaleup; |
210 |
int x11_n_display_names; |
int x11_n_display_names; |
211 |
char **x11_display_names; |
char **x11_display_names; |
212 |
int x11_current_display_name_nr; /* updated by x11.c */ |
int x11_current_display_name_nr; /* updated by x11.c */ |
216 |
}; |
}; |
217 |
|
|
218 |
|
|
219 |
|
/* Tick function "prototype": */ |
220 |
|
#define DEVICE_TICK(x) void dev_ ## x ## _tick(struct cpu *cpu, void *extra) |
221 |
|
|
222 |
|
|
223 |
/* |
/* |
224 |
* Machine emulation types: |
* Machine emulation types: |
225 |
*/ |
*/ |
228 |
#define ARCH_MIPS 1 |
#define ARCH_MIPS 1 |
229 |
#define ARCH_PPC 2 |
#define ARCH_PPC 2 |
230 |
#define ARCH_SPARC 3 |
#define ARCH_SPARC 3 |
231 |
#define ARCH_URISC 4 |
#define ARCH_ALPHA 4 |
232 |
#define ARCH_HPPA 5 |
#define ARCH_ARM 5 |
233 |
#define ARCH_ALPHA 6 |
#define ARCH_SH 6 |
234 |
#define ARCH_X86 7 |
#define ARCH_AVR 7 |
235 |
|
#define ARCH_M88K 8 |
236 |
|
|
237 |
/* MIPS: */ |
/* MIPS: */ |
238 |
#define MACHINE_BAREMIPS 1000 |
#define MACHINE_BAREMIPS 1000 |
239 |
#define MACHINE_TESTMIPS 1001 |
#define MACHINE_TESTMIPS 1001 |
240 |
#define MACHINE_DEC 1002 |
#define MACHINE_PMAX 1002 |
241 |
#define MACHINE_COBALT 1003 |
#define MACHINE_COBALT 1003 |
242 |
#define MACHINE_HPCMIPS 1004 |
#define MACHINE_HPCMIPS 1004 |
243 |
#define MACHINE_PS2 1005 |
#define MACHINE_PS2 1005 |
244 |
#define MACHINE_SGI 1006 |
#define MACHINE_SGI 1006 |
245 |
#define MACHINE_ARC 1007 |
#define MACHINE_ARC 1007 |
246 |
#define MACHINE_MESHCUBE 1008 |
#define MACHINE_NETGEAR 1008 |
247 |
#define MACHINE_NETGEAR 1009 |
#define MACHINE_SONYNEWS 1009 |
248 |
#define MACHINE_WRT54G 1010 |
#define MACHINE_EVBMIPS 1010 |
249 |
#define MACHINE_SONYNEWS 1011 |
#define MACHINE_PSP 1011 |
250 |
|
#define MACHINE_ALGOR 1012 |
251 |
|
#define MACHINE_QEMU_MIPS 1013 |
252 |
|
|
253 |
/* PPC: */ |
/* PPC: */ |
254 |
#define MACHINE_BAREPPC 2000 |
#define MACHINE_BAREPPC 2000 |
255 |
#define MACHINE_TESTPPC 2001 |
#define MACHINE_TESTPPC 2001 |
256 |
#define MACHINE_WALNUT 2002 |
#define MACHINE_PMPPC 2002 |
257 |
#define MACHINE_PMPPC 2003 |
#define MACHINE_SANDPOINT 2003 |
258 |
#define MACHINE_SANDPOINT 2004 |
#define MACHINE_BEBOX 2004 |
259 |
#define MACHINE_BEBOX 2005 |
#define MACHINE_PREP 2005 |
260 |
#define MACHINE_PREP 2006 |
#define MACHINE_MACPPC 2006 |
261 |
#define MACHINE_MACPPC 2007 |
#define MACHINE_MVMEPPC 2007 |
|
#define MACHINE_DB64360 2008 |
|
262 |
|
|
263 |
/* SPARC: */ |
/* SPARC: */ |
264 |
#define MACHINE_BARESPARC 3000 |
#define MACHINE_BARESPARC 3000 |
265 |
#define MACHINE_ULTRA1 3001 |
#define MACHINE_TESTSPARC 3001 |
266 |
|
#define MACHINE_SPARC 3002 |
|
/* URISC: */ |
|
|
#define MACHINE_BAREURISC 4000 |
|
|
#define MACHINE_TESTURISC 4001 |
|
|
|
|
|
/* HPPA: */ |
|
|
#define MACHINE_BAREHPPA 5000 |
|
|
#define MACHINE_TESTHPPA 5001 |
|
267 |
|
|
268 |
/* Alpha: */ |
/* Alpha: */ |
269 |
#define MACHINE_BAREALPHA 6000 |
#define MACHINE_BAREALPHA 4000 |
270 |
#define MACHINE_TESTALPHA 6001 |
#define MACHINE_TESTALPHA 4001 |
271 |
|
#define MACHINE_ALPHA 4002 |
272 |
/* X86: */ |
|
273 |
#define MACHINE_BAREX86 7000 |
/* ARM: */ |
274 |
#define MACHINE_X86 7001 |
#define MACHINE_BAREARM 5000 |
275 |
|
#define MACHINE_TESTARM 5001 |
276 |
|
#define MACHINE_CATS 5002 |
277 |
|
#define MACHINE_HPCARM 5003 |
278 |
|
#define MACHINE_ZAURUS 5004 |
279 |
|
#define MACHINE_NETWINDER 5005 |
280 |
|
#define MACHINE_SHARK 5006 |
281 |
|
#define MACHINE_IQ80321 5007 |
282 |
|
#define MACHINE_IYONIX 5008 |
283 |
|
#define MACHINE_QEMU_ARM 5009 |
284 |
|
|
285 |
|
/* SH: */ |
286 |
|
#define MACHINE_BARESH 6000 |
287 |
|
#define MACHINE_TESTSH 6001 |
288 |
|
#define MACHINE_HPCSH 6002 |
289 |
|
#define MACHINE_DREAMCAST 6003 |
290 |
|
#define MACHINE_LANDISK 6004 |
291 |
|
|
292 |
|
/* AVR: */ |
293 |
|
#define MACHINE_BAREAVR 7000 |
294 |
|
#define MACHINE_AVR_PAL 7001 |
295 |
|
#define MACHINE_AVR_MAHPONG 7002 |
296 |
|
|
297 |
|
/* M88K: */ |
298 |
|
#define MACHINE_BAREM88K 8000 |
299 |
|
#define MACHINE_TESTM88K 8001 |
300 |
|
|
301 |
/* Other "pseudo"-machines: */ |
/* Other "pseudo"-machines: */ |
302 |
#define MACHINE_NONE 0 |
#define MACHINE_NONE 0 |
320 |
#define DEC_PROM_TCINFO 0xffffffffbfc2c000ULL |
#define DEC_PROM_TCINFO 0xffffffffbfc2c000ULL |
321 |
#define DEC_MEMMAP_ADDR 0xffffffffbfc30000ULL |
#define DEC_MEMMAP_ADDR 0xffffffffbfc30000ULL |
322 |
|
|
|
|
|
323 |
/* HPCmips: */ |
/* HPCmips: */ |
|
/* Machine types: */ |
|
324 |
#define MACHINE_HPCMIPS_CASIO_BE300 1 |
#define MACHINE_HPCMIPS_CASIO_BE300 1 |
325 |
#define MACHINE_HPCMIPS_CASIO_E105 2 |
#define MACHINE_HPCMIPS_CASIO_E105 2 |
326 |
#define MACHINE_HPCMIPS_NEC_MOBILEPRO_770 3 |
#define MACHINE_HPCMIPS_NEC_MOBILEPRO_770 3 |
330 |
#define MACHINE_HPCMIPS_AGENDA_VR3 7 |
#define MACHINE_HPCMIPS_AGENDA_VR3 7 |
331 |
#define MACHINE_HPCMIPS_IBM_WORKPAD_Z50 8 |
#define MACHINE_HPCMIPS_IBM_WORKPAD_Z50 8 |
332 |
|
|
333 |
/* Playstation 2: */ |
/* HPCarm: */ |
334 |
#define PLAYSTATION2_BDA 0xffffffffa0001000ULL |
#define MACHINE_HPCARM_IPAQ 1 |
335 |
#define PLAYSTATION2_OPTARGS 0xffffffff81fff100ULL |
#define MACHINE_HPCARM_JORNADA720 2 |
336 |
#define PLAYSTATION2_SIFBIOS 0xffffffffbfc10000ULL |
|
337 |
|
/* HPCsh: */ |
338 |
|
#define MACHINE_HPCSH_JORNADA680 1 |
339 |
|
#define MACHINE_HPCSH_JORNADA690 2 |
340 |
|
|
341 |
/* SGI and ARC: */ |
/* SGI and ARC: */ |
342 |
#define MACHINE_ARC_NEC_RD94 1 |
#define MACHINE_ARC_NEC_RD94 1 |
348 |
#define MACHINE_ARC_JAZZ_M700 7 |
#define MACHINE_ARC_JAZZ_M700 7 |
349 |
#define MACHINE_ARC_NEC_R96 8 |
#define MACHINE_ARC_NEC_R96 8 |
350 |
|
|
351 |
|
/* Algor: */ |
352 |
|
#define MACHINE_ALGOR_P4032 4 |
353 |
|
#define MACHINE_ALGOR_P5064 5 |
354 |
|
|
355 |
|
/* EVBMIPS: */ |
356 |
|
#define MACHINE_EVBMIPS_MALTA 1 |
357 |
|
#define MACHINE_EVBMIPS_MALTA_BE 2 |
358 |
|
|
359 |
|
/* PReP: */ |
360 |
|
#define MACHINE_PREP_IBM6050 1 |
361 |
|
#define MACHINE_PREP_MVME2400 2 |
362 |
|
|
363 |
|
/* Sun SPARC: */ |
364 |
|
#define MACHINE_SPARC_SS5 1 |
365 |
|
#define MACHINE_SPARC_SS20 2 |
366 |
|
#define MACHINE_SPARC_ULTRA1 3 |
367 |
|
#define MACHINE_SPARC_ULTRA60 4 |
368 |
|
#define MACHINE_SPARC_SUN4V 5 |
369 |
|
|
370 |
/* MacPPC: TODO: Real model names */ |
/* MacPPC: TODO: Real model names */ |
371 |
#define MACHINE_MACPPC_G4 1 |
#define MACHINE_MACPPC_G3 1 |
372 |
#define MACHINE_MACPPC_G5 2 |
#define MACHINE_MACPPC_G4 2 |
373 |
|
#define MACHINE_MACPPC_G5 3 |
374 |
|
|
375 |
|
/* MVMEPPC */ |
376 |
|
#define MACHINE_MVMEPPC_1600 1 |
377 |
|
#define MACHINE_MVMEPPC_2100 2 |
378 |
|
#define MACHINE_MVMEPPC_5500 3 |
379 |
|
|
380 |
|
|
381 |
|
/* For the automachine system: */ |
382 |
|
struct machine_entry_subtype { |
383 |
|
int machine_subtype;/* Old-style subtype */ |
384 |
|
const char *name; /* Official name */ |
385 |
|
int n_aliases; |
386 |
|
char **aliases; /* Aliases */ |
387 |
|
}; |
388 |
|
|
389 |
|
struct machine_entry { |
390 |
|
struct machine_entry *next; |
391 |
|
|
392 |
/* |
/* Machine type: */ |
393 |
* Problem: kernels seem to be loaded at low addresses in RAM, so |
int arch; |
394 |
* storing environment strings and memory descriptors there is a bad |
int machine_type; /* Old-style type */ |
395 |
* idea. They are stored at 0xbfc..... instead. The ARC SPB must |
const char *name; /* Official name */ |
396 |
* be at physical address 0x1000 though. |
int n_aliases; |
397 |
*/ |
char **aliases; /* Aliases */ |
398 |
#define SGI_SPB_ADDR 0xffffffff80001000ULL |
|
399 |
/* 0xbfc10000 is firmware callback vector stuff */ |
void (*setup)(struct machine *, struct cpu *); |
400 |
#define ARC_FIRMWARE_VECTORS 0xffffffffbfc80000ULL |
void (*set_default_cpu)(struct machine *); |
401 |
#define ARC_FIRMWARE_ENTRIES 0xffffffffbfc88000ULL |
void (*set_default_ram)(struct machine *); |
402 |
#define ARC_ARGV_START 0xffffffffbfc90000ULL |
|
403 |
#define ARC_ENV_STRINGS 0xffffffffbfc98000ULL |
/* Machine subtypes: */ |
404 |
#define ARC_ENV_POINTERS 0xffffffffbfc9d000ULL |
int n_subtypes; |
405 |
#define SGI_SYSID_ADDR 0xffffffffbfca1800ULL |
struct machine_entry_subtype **subtype; |
406 |
#define ARC_DSPSTAT_ADDR 0xffffffffbfca1c00ULL |
}; |
407 |
#define ARC_MEMDESC_ADDR 0xffffffffbfca1c80ULL |
|
408 |
#define ARC_CONFIG_DATA_ADDR 0xffffffffbfca2000ULL |
#define MACHINE_SETUP_TYPE(n) void (*n)(struct machine *, struct cpu *) |
409 |
#define FIRST_ARC_COMPONENT 0xffffffffbfca8000ULL |
#define MACHINE_SETUP(x) void machine_setup_ ## x(struct machine *machine, \ |
410 |
#define ARC_PRIVATE_VECTORS 0xffffffffbfcb0000ULL |
struct cpu *cpu) |
411 |
#define ARC_PRIVATE_ENTRIES 0xffffffffbfcb8000ULL |
#define MACHINE_DEFAULT_CPU(x) void machine_default_cpu_ ## x(struct machine *machine) |
412 |
|
#define MACHINE_DEFAULT_RAM(x) void machine_default_ram_ ## x(struct machine *machine) |
413 |
|
#define MACHINE_REGISTER(x) void machine_register_ ## x(void) |
414 |
|
#define MR_DEFAULT(x,name,arch,type) struct machine_entry \ |
415 |
|
*me = machine_entry_new(name,arch,type); \ |
416 |
|
me->setup = machine_setup_ ## x; \ |
417 |
|
me->set_default_cpu = machine_default_cpu_ ## x; \ |
418 |
|
machine_entry_register(me, arch); |
419 |
|
void automachine_init(void); |
420 |
|
|
421 |
|
|
422 |
/* machine.c: */ |
/* machine.c: */ |
423 |
struct machine *machine_new(char *name, struct emul *emul); |
struct machine *machine_new(char *name, struct emul *emul, int id); |
424 |
|
void machine_destroy(struct machine *machine); |
425 |
int machine_name_to_type(char *stype, char *ssubtype, |
int machine_name_to_type(char *stype, char *ssubtype, |
426 |
int *type, int *subtype, int *arch); |
int *type, int *subtype, int *arch); |
427 |
void machine_add_tickfunction(struct machine *machine, |
void machine_add_tickfunction(struct machine *machine, |
428 |
void (*func)(struct cpu *, void *), void *extra, int clockshift); |
void (*func)(struct cpu *, void *), void *extra, |
429 |
|
int clockshift, double hz); |
430 |
|
void machine_statistics_init(struct machine *, char *fname); |
431 |
|
void machine_register(char *name, MACHINE_SETUP_TYPE(setup)); |
432 |
void dump_mem_string(struct cpu *cpu, uint64_t addr); |
void dump_mem_string(struct cpu *cpu, uint64_t addr); |
433 |
void store_string(struct cpu *cpu, uint64_t addr, char *s); |
void store_string(struct cpu *cpu, uint64_t addr, char *s); |
434 |
int store_64bit_word(struct cpu *cpu, uint64_t addr, uint64_t data64); |
int store_64bit_word(struct cpu *cpu, uint64_t addr, uint64_t data64); |
435 |
int store_32bit_word(struct cpu *cpu, uint64_t addr, uint64_t data32); |
int store_32bit_word(struct cpu *cpu, uint64_t addr, uint64_t data32); |
436 |
int store_16bit_word(struct cpu *cpu, uint64_t addr, uint64_t data16); |
int store_16bit_word(struct cpu *cpu, uint64_t addr, uint64_t data16); |
437 |
|
void store_byte(struct cpu *cpu, uint64_t addr, uint8_t data); |
438 |
void store_64bit_word_in_host(struct cpu *cpu, unsigned char *data, |
void store_64bit_word_in_host(struct cpu *cpu, unsigned char *data, |
439 |
uint64_t data32); |
uint64_t data32); |
440 |
void store_32bit_word_in_host(struct cpu *cpu, unsigned char *data, |
void store_32bit_word_in_host(struct cpu *cpu, unsigned char *data, |
441 |
uint64_t data32); |
uint64_t data32); |
442 |
void store_16bit_word_in_host(struct cpu *cpu, unsigned char *data, |
void store_16bit_word_in_host(struct cpu *cpu, unsigned char *data, |
443 |
uint16_t data16); |
uint16_t data16); |
444 |
|
uint64_t load_64bit_word(struct cpu *cpu, uint64_t addr); |
445 |
uint32_t load_32bit_word(struct cpu *cpu, uint64_t addr); |
uint32_t load_32bit_word(struct cpu *cpu, uint64_t addr); |
446 |
uint16_t load_16bit_word(struct cpu *cpu, uint64_t addr); |
uint16_t load_16bit_word(struct cpu *cpu, uint64_t addr); |
447 |
void store_buf(struct cpu *cpu, uint64_t addr, char *s, size_t len); |
void store_buf(struct cpu *cpu, uint64_t addr, char *s, size_t len); |
448 |
|
void add_environment_string(struct cpu *cpu, char *s, uint64_t *addr); |
449 |
|
void add_environment_string_dual(struct cpu *cpu, |
450 |
|
uint64_t *ptrp, uint64_t *addrp, char *s1, char *s2); |
451 |
|
void store_pointer_and_advance(struct cpu *cpu, uint64_t *addrp, |
452 |
|
uint64_t data, int flag64); |
453 |
void machine_setup(struct machine *); |
void machine_setup(struct machine *); |
454 |
void machine_memsize_fix(struct machine *); |
void machine_memsize_fix(struct machine *); |
455 |
void machine_default_cputype(struct machine *); |
void machine_default_cputype(struct machine *); |
456 |
void machine_dumpinfo(struct machine *); |
void machine_dumpinfo(struct machine *); |
457 |
|
int machine_run(struct machine *machine); |
458 |
void machine_list_available_types_and_cpus(void); |
void machine_list_available_types_and_cpus(void); |
459 |
|
struct machine_entry *machine_entry_new(const char *name, |
460 |
|
int arch, int oldstyle_type); |
461 |
|
void machine_entry_add_alias(struct machine_entry *me, const char *name); |
462 |
|
void machine_entry_add_subtype(struct machine_entry *me, const char *name, |
463 |
|
int oldstyle_subtype, ...); |
464 |
|
void machine_entry_register(struct machine_entry *me, int arch); |
465 |
void machine_init(void); |
void machine_init(void); |
466 |
|
|
467 |
|
|