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.67 2005/08/16 05:37:13 debug Exp $ |
* $Id: machine.h,v 1.157 2007/03/15 15:42:58 debug Exp $ |
32 |
*/ |
*/ |
33 |
|
|
34 |
#include <sys/types.h> |
#include <sys/types.h> |
35 |
#include <sys/time.h> |
#include <sys/time.h> |
36 |
|
|
37 |
|
#include "debugger_gdb.h" |
38 |
#include "symbol.h" |
#include "symbol.h" |
39 |
|
|
40 |
#include "arcbios.h" |
#include "machine_arc.h" |
41 |
#include "machine_x86.h" |
#include "machine_pmax.h" |
42 |
|
|
43 |
|
|
44 |
#define MAX_BREAKPOINTS 8 |
#define MAX_BREAKPOINTS 8 |
|
#define BREAKPOINT_FLAG_R 1 |
|
45 |
|
|
46 |
#define MAX_TICK_FUNCTIONS 14 |
#define MAX_TICK_FUNCTIONS 16 |
47 |
|
|
48 |
|
#define MAX_STATISTICS_FIELDS 8 |
49 |
|
|
50 |
struct cpu_family; |
struct cpu_family; |
51 |
struct diskimage; |
struct diskimage; |
52 |
struct emul; |
struct emul; |
53 |
struct fb_window; |
struct fb_window; |
54 |
struct memory; |
struct memory; |
55 |
|
struct of_data; |
56 |
|
struct settings; |
57 |
|
|
58 |
/* Ugly: */ |
|
59 |
struct kn230_csr; |
/* TODO: This should probably go away... */ |
|
struct kn02_csr; |
|
|
struct dec_ioasic_data; |
|
|
struct ps2_data; |
|
|
struct dec5800_data; |
|
|
struct au1x00_ic_data; |
|
|
struct malta_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; |
|
60 |
struct isa_pic_data { |
struct isa_pic_data { |
61 |
struct pic8259_data *pic1; |
struct pic8259_data *pic1; |
62 |
struct pic8259_data *pic2; |
struct pic8259_data *pic2; |
|
}; |
|
63 |
|
|
64 |
|
int *pending_timer_interrupts; |
65 |
|
int last_int; |
66 |
|
}; |
67 |
|
|
|
#define MACHINE_NAME_MAXBUF 200 |
|
68 |
|
|
69 |
struct machine { |
struct machine { |
70 |
/* Pointer back to the emul struct we are in: */ |
/* Pointer back to the emul struct we are in: */ |
71 |
struct emul *emul; |
struct emul *emul; |
72 |
|
|
73 |
|
/* Settings: */ |
74 |
|
struct settings *settings; |
75 |
|
|
76 |
/* Name as choosen by the user: */ |
/* Name as choosen by the user: */ |
77 |
char *name; |
char *name; |
78 |
|
|
79 |
|
/* Full "path" to the machine, e.g. "emul[0].machine[0]": */ |
80 |
|
char *path; |
81 |
|
|
82 |
int arch; /* ARCH_MIPS, ARCH_PPC, .. */ |
int arch; /* ARCH_MIPS, ARCH_PPC, .. */ |
83 |
int machine_type; /* MACHINE_DEC, .. */ |
int machine_type; /* MACHINE_PMAX, .. */ |
84 |
int machine_subtype; /* MACHINE_DEC_3MAX_5000, .. */ |
int machine_subtype; /* MACHINE_DEC_3MAX_5000, .. */ |
85 |
|
|
86 |
|
/* NOTE/TODO: This isn't working yet: */ |
87 |
|
int cycle_accurate; /* Set to non-zero for cycle |
88 |
|
accurate (slow) emulation. */ |
89 |
|
|
90 |
|
/* Name set by code in src/machines/machine_*.c: */ |
91 |
char *machine_name; |
char *machine_name; |
92 |
|
|
93 |
|
int stable; /* startup warning for non-stable |
94 |
|
emulation modes. */ |
95 |
|
|
96 |
/* The serial number is mostly used when emulating multiple machines |
/* 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 |
in a network. nr_of_nics is the current nr of network cards, which |
98 |
is useful when emulating multiple cards in one machine: */ |
is useful when emulating multiple cards in one machine: */ |
99 |
int serial_nr; |
int serial_nr; |
100 |
int nr_of_nics; |
int nr_of_nics; |
101 |
|
|
102 |
|
/* TODO: How about multiple cpu familys in one machine? */ |
103 |
struct cpu_family *cpu_family; |
struct cpu_family *cpu_family; |
104 |
|
|
105 |
/* |
/* |
120 |
int ticks_reset_value[MAX_TICK_FUNCTIONS]; |
int ticks_reset_value[MAX_TICK_FUNCTIONS]; |
121 |
void (*tick_func[MAX_TICK_FUNCTIONS])(struct cpu *, void *); |
void (*tick_func[MAX_TICK_FUNCTIONS])(struct cpu *, void *); |
122 |
void *tick_extra[MAX_TICK_FUNCTIONS]; |
void *tick_extra[MAX_TICK_FUNCTIONS]; |
123 |
|
double tick_hz[MAX_TICK_FUNCTIONS]; |
|
void (*md_interrupt)(struct machine *m, struct cpu *cpu, |
|
|
int irq_nr, int assert); |
|
124 |
|
|
125 |
char *cpu_name; /* TODO: remove this, there could be several |
char *cpu_name; /* TODO: remove this, there could be several |
126 |
cpus with different names in a machine */ |
cpus with different names in a machine */ |
132 |
struct cpu **cpus; |
struct cpu **cpus; |
133 |
|
|
134 |
/* These are used by stuff in cpu.c, mostly: */ |
/* These are used by stuff in cpu.c, mostly: */ |
135 |
int64_t ncycles; |
/* TODO: Move to cpu.h! */ |
136 |
int64_t ncycles_show; |
int64_t ninstrs; |
137 |
int64_t ncycles_flush; |
int64_t ninstrs_show; |
138 |
int64_t ncycles_since_gettimeofday; |
int64_t ninstrs_flush; |
139 |
|
int64_t ninstrs_since_gettimeofday; |
140 |
struct timeval starttime; |
struct timeval starttime; |
|
int a_few_cycles; |
|
|
int a_few_instrs; |
|
141 |
|
|
142 |
struct diskimage *first_diskimage; |
struct diskimage *first_diskimage; |
143 |
|
|
150 |
int register_dump; |
int register_dump; |
151 |
int arch_pagesize; |
int arch_pagesize; |
152 |
|
|
153 |
|
int bootdev_type; |
154 |
|
int bootdev_id; |
155 |
|
char *bootstr; |
156 |
|
char *bootarg; |
157 |
|
|
158 |
|
struct debugger_gdb gdb; |
159 |
|
|
160 |
|
/* Breakpoints: */ |
161 |
int n_breakpoints; |
int n_breakpoints; |
162 |
char *breakpoint_string[MAX_BREAKPOINTS]; |
char *breakpoint_string[MAX_BREAKPOINTS]; |
163 |
uint64_t breakpoint_addr[MAX_BREAKPOINTS]; |
uint64_t breakpoint_addr[MAX_BREAKPOINTS]; |
164 |
int breakpoint_flags[MAX_BREAKPOINTS]; |
int breakpoint_flags[MAX_BREAKPOINTS]; |
165 |
|
|
166 |
/* Cache sizes: (1 << x) x=0 for default values */ |
/* Cache sizes: (1 << x) x=0 for default values */ |
167 |
/* TODO: these are _PER CPU_! */ |
/* TODO: these should be _PER CPU_! */ |
168 |
int cache_picache; |
int cache_picache; |
169 |
int cache_pdcache; |
int cache_pdcache; |
170 |
int cache_secondary; |
int cache_secondary; |
173 |
int cache_secondary_linesize; |
int cache_secondary_linesize; |
174 |
|
|
175 |
int dbe_on_nonexistant_memaccess; |
int dbe_on_nonexistant_memaccess; |
176 |
int dyntrans_alignment_check; |
int halt_on_nonexistant_memaccess; |
|
int bintrans_enable; |
|
|
int old_bintrans_enable; |
|
|
int bintrans_enabled_from_start; |
|
|
int bintrans_size; |
|
177 |
int instruction_trace; |
int instruction_trace; |
|
int single_step_on_bad_addr; |
|
178 |
int show_nr_of_instructions; |
int show_nr_of_instructions; |
179 |
|
int show_trace_tree; |
180 |
int show_symbolic_register_names; |
int show_symbolic_register_names; |
|
int64_t max_instructions; |
|
181 |
int emulated_hz; |
int emulated_hz; |
182 |
int max_random_cycles_per_chunk; |
int allow_instruction_combinations; |
|
int speed_tricks; |
|
183 |
char *userland_emul; /* NULL for no userland emulation */ |
char *userland_emul; /* NULL for no userland emulation */ |
184 |
int force_netboot; |
int force_netboot; |
185 |
int slow_serial_interrupts_hack_for_linux; |
int slow_serial_interrupts_hack_for_linux; |
186 |
uint64_t file_loaded_end_addr; |
uint64_t file_loaded_end_addr; |
187 |
char *boot_kernel_filename; |
char *boot_kernel_filename; |
188 |
char *boot_string_argument; |
char *boot_string_argument; |
|
|
|
|
int automatic_clock_adjustment; |
|
189 |
int exit_without_entering_debugger; |
int exit_without_entering_debugger; |
|
int show_trace_tree; |
|
|
|
|
190 |
int n_gfx_cards; |
int n_gfx_cards; |
191 |
|
|
192 |
|
/* Instruction statistics: */ |
193 |
|
char *statistics_filename; |
194 |
|
FILE *statistics_file; |
195 |
|
int statistics_enabled; |
196 |
|
char *statistics_fields; /* "vpi" etc. */ |
197 |
|
|
198 |
/* Machine-dependent: (PROM stuff, etc.) */ |
/* Machine-dependent: (PROM stuff, etc.) */ |
199 |
union { |
union { |
200 |
struct machine_arcbios arc; |
struct machine_arcbios arc; |
201 |
struct machine_pc pc; |
struct machine_pmax pmax; |
202 |
|
struct of_data *of_data; |
203 |
} md; |
} md; |
204 |
|
|
205 |
/* Machine-dependent interrupt specific structs: */ |
/* Bus-specific interrupt data: */ |
206 |
union { |
/* TODO: Remove! */ |
207 |
struct kn230_csr *kn230_csr; |
struct isa_pic_data isa_pic_data; |
|
struct kn02_csr *kn02_csr; |
|
|
struct dec_ioasic_data *dec_ioasic_data; |
|
|
struct ps2_data *ps2_data; |
|
|
struct dec5800_data *dec5800_csr; |
|
|
struct au1x00_ic_data *au1x00_ic_data; |
|
|
struct vr41xx_data *vr41xx_data; |
|
|
struct jazz_data *jazz_data; |
|
|
struct malta_data *malta_data; |
|
|
struct isa_pic_data isa_pic_data; |
|
|
struct sgi_ip20_data *sgi_ip20_data; |
|
|
struct sgi_ip22_data *sgi_ip22_data; |
|
|
struct sgi_ip30_data *sgi_ip30_data; |
|
|
struct { |
|
|
struct crime_data *crime_data; |
|
|
struct mace_data *mace_data; |
|
|
} ip32; |
|
|
} md_int; |
|
208 |
|
|
209 |
/* X11/framebuffer stuff: */ |
/* X11/framebuffer stuff: */ |
210 |
int use_x11; |
int use_x11; |
211 |
int x11_scaledown; |
int x11_scaledown; |
212 |
|
int x11_scaleup; |
213 |
int x11_n_display_names; |
int x11_n_display_names; |
214 |
char **x11_display_names; |
char **x11_display_names; |
215 |
int x11_current_display_name_nr; /* updated by x11.c */ |
int x11_current_display_name_nr; /* updated by x11.c */ |
219 |
}; |
}; |
220 |
|
|
221 |
|
|
222 |
|
/* Tick function "prototype": */ |
223 |
|
#define DEVICE_TICK(x) void dev_ ## x ## _tick(struct cpu *cpu, void *extra) |
224 |
|
|
225 |
|
|
226 |
/* |
/* |
227 |
* Machine emulation types: |
* Machine emulation types: |
228 |
*/ |
*/ |
232 |
#define ARCH_PPC 2 |
#define ARCH_PPC 2 |
233 |
#define ARCH_SPARC 3 |
#define ARCH_SPARC 3 |
234 |
#define ARCH_ALPHA 4 |
#define ARCH_ALPHA 4 |
235 |
#define ARCH_X86 5 |
#define ARCH_ARM 5 |
236 |
#define ARCH_ARM 6 |
#define ARCH_M68K 6 |
237 |
#define ARCH_IA64 7 |
#define ARCH_SH 7 |
238 |
#define ARCH_M68K 8 |
#define ARCH_AVR 8 |
239 |
|
#define ARCH_TRANSPUTER 9 |
240 |
|
#define ARCH_RCA180X 10 |
241 |
|
|
242 |
/* MIPS: */ |
/* MIPS: */ |
243 |
#define MACHINE_BAREMIPS 1000 |
#define MACHINE_BAREMIPS 1000 |
244 |
#define MACHINE_TESTMIPS 1001 |
#define MACHINE_TESTMIPS 1001 |
245 |
#define MACHINE_DEC 1002 |
#define MACHINE_PMAX 1002 |
246 |
#define MACHINE_COBALT 1003 |
#define MACHINE_COBALT 1003 |
247 |
#define MACHINE_HPCMIPS 1004 |
#define MACHINE_HPCMIPS 1004 |
248 |
#define MACHINE_PS2 1005 |
#define MACHINE_PS2 1005 |
249 |
#define MACHINE_SGI 1006 |
#define MACHINE_SGI 1006 |
250 |
#define MACHINE_ARC 1007 |
#define MACHINE_ARC 1007 |
251 |
#define MACHINE_MESHCUBE 1008 |
#define MACHINE_NETGEAR 1008 |
252 |
#define MACHINE_NETGEAR 1009 |
#define MACHINE_SONYNEWS 1009 |
253 |
#define MACHINE_SONYNEWS 1010 |
#define MACHINE_EVBMIPS 1010 |
254 |
#define MACHINE_EVBMIPS 1011 |
#define MACHINE_PSP 1011 |
255 |
#define MACHINE_PSP 1012 |
#define MACHINE_ALGOR 1012 |
256 |
|
#define MACHINE_QEMU_MIPS 1013 |
257 |
|
|
258 |
/* PPC: */ |
/* PPC: */ |
259 |
#define MACHINE_BAREPPC 2000 |
#define MACHINE_BAREPPC 2000 |
264 |
#define MACHINE_BEBOX 2005 |
#define MACHINE_BEBOX 2005 |
265 |
#define MACHINE_PREP 2006 |
#define MACHINE_PREP 2006 |
266 |
#define MACHINE_MACPPC 2007 |
#define MACHINE_MACPPC 2007 |
267 |
#define MACHINE_DB64360 2008 |
#define MACHINE_MVMEPPC 2008 |
268 |
|
|
269 |
/* SPARC: */ |
/* SPARC: */ |
270 |
#define MACHINE_BARESPARC 3000 |
#define MACHINE_BARESPARC 3000 |
271 |
#define MACHINE_TESTSPARC 3001 |
#define MACHINE_TESTSPARC 3001 |
272 |
#define MACHINE_ULTRA1 3002 |
#define MACHINE_SPARC 3002 |
273 |
|
|
274 |
/* Alpha: */ |
/* Alpha: */ |
275 |
#define MACHINE_BAREALPHA 4000 |
#define MACHINE_BAREALPHA 4000 |
276 |
#define MACHINE_TESTALPHA 4001 |
#define MACHINE_TESTALPHA 4001 |
277 |
#define MACHINE_ALPHA 4002 |
#define MACHINE_ALPHA 4002 |
278 |
|
|
|
/* X86: */ |
|
|
#define MACHINE_BAREX86 5000 |
|
|
#define MACHINE_X86 5001 |
|
|
|
|
279 |
/* ARM: */ |
/* ARM: */ |
280 |
#define MACHINE_BAREARM 6000 |
#define MACHINE_BAREARM 5000 |
281 |
#define MACHINE_TESTARM 6001 |
#define MACHINE_TESTARM 5001 |
282 |
|
#define MACHINE_CATS 5002 |
283 |
/* IA64: */ |
#define MACHINE_HPCARM 5003 |
284 |
#define MACHINE_BAREIA64 7000 |
#define MACHINE_ZAURUS 5004 |
285 |
#define MACHINE_TESTIA64 7001 |
#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 |
|
|
292 |
/* M68K: */ |
/* M68K: */ |
293 |
#define MACHINE_BAREM68K 8000 |
#define MACHINE_BAREM68K 6000 |
294 |
#define MACHINE_TESTM68K 8001 |
#define MACHINE_TESTM68K 6001 |
295 |
|
|
296 |
|
/* SH: */ |
297 |
|
#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 |
|
|
303 |
|
/* AVR: */ |
304 |
|
#define MACHINE_BAREAVR 8000 |
305 |
|
#define MACHINE_AVR_PAL 8001 |
306 |
|
#define MACHINE_AVR_MAHPONG 8002 |
307 |
|
|
308 |
|
/* TRANSPUTER: */ |
309 |
|
#define MACHINE_BARETRANSPUTER 9000 |
310 |
|
|
311 |
|
/* ARCH_RCA180X: */ |
312 |
|
#define MACHINE_BARE180X 10000 |
313 |
|
#define MACHINE_CHIP8 10001 |
314 |
|
|
315 |
/* Other "pseudo"-machines: */ |
/* Other "pseudo"-machines: */ |
316 |
#define MACHINE_NONE 0 |
#define MACHINE_NONE 0 |
344 |
#define MACHINE_HPCMIPS_AGENDA_VR3 7 |
#define MACHINE_HPCMIPS_AGENDA_VR3 7 |
345 |
#define MACHINE_HPCMIPS_IBM_WORKPAD_Z50 8 |
#define MACHINE_HPCMIPS_IBM_WORKPAD_Z50 8 |
346 |
|
|
347 |
/* Playstation 2: */ |
/* HPCarm: */ |
348 |
#define PLAYSTATION2_BDA 0xffffffffa0001000ULL |
#define MACHINE_HPCARM_IPAQ 1 |
349 |
#define PLAYSTATION2_OPTARGS 0xffffffff81fff100ULL |
#define MACHINE_HPCARM_JORNADA720 2 |
350 |
#define PLAYSTATION2_SIFBIOS 0xffffffffbfc10000ULL |
|
351 |
|
/* HPCsh: */ |
352 |
|
#define MACHINE_HPCSH_JORNADA680 1 |
353 |
|
#define MACHINE_HPCSH_JORNADA690 2 |
354 |
|
|
355 |
/* SGI and ARC: */ |
/* SGI and ARC: */ |
356 |
#define MACHINE_ARC_NEC_RD94 1 |
#define MACHINE_ARC_NEC_RD94 1 |
362 |
#define MACHINE_ARC_JAZZ_M700 7 |
#define MACHINE_ARC_JAZZ_M700 7 |
363 |
#define MACHINE_ARC_NEC_R96 8 |
#define MACHINE_ARC_NEC_R96 8 |
364 |
|
|
365 |
|
/* Algor: */ |
366 |
|
#define MACHINE_ALGOR_P4032 4 |
367 |
|
#define MACHINE_ALGOR_P5064 5 |
368 |
|
|
369 |
/* EVBMIPS: */ |
/* EVBMIPS: */ |
370 |
#define MACHINE_EVBMIPS_MALTA 1 |
#define MACHINE_EVBMIPS_MALTA 1 |
371 |
#define MACHINE_EVBMIPS_MALTA_BE 2 |
#define MACHINE_EVBMIPS_MALTA_BE 2 |
372 |
#define MACHINE_EVBMIPS_PB1000 3 |
#define MACHINE_EVBMIPS_MESHCUBE 3 |
373 |
|
#define MACHINE_EVBMIPS_PB1000 4 |
374 |
|
|
375 |
|
/* PReP: */ |
376 |
|
#define MACHINE_PREP_IBM6050 1 |
377 |
|
#define MACHINE_PREP_MVME2400 2 |
378 |
|
|
379 |
|
/* 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 |
|
#define MACHINE_SPARC_SUN4V 5 |
385 |
|
|
386 |
/* MacPPC: TODO: Real model names */ |
/* MacPPC: TODO: Real model names */ |
387 |
#define MACHINE_MACPPC_G4 1 |
#define MACHINE_MACPPC_G3 1 |
388 |
#define MACHINE_MACPPC_G5 2 |
#define MACHINE_MACPPC_G4 2 |
389 |
|
#define MACHINE_MACPPC_G5 3 |
390 |
|
|
391 |
|
/* MVMEPPC */ |
392 |
|
#define MACHINE_MVMEPPC_1600 1 |
393 |
|
#define MACHINE_MVMEPPC_2100 2 |
394 |
|
#define MACHINE_MVMEPPC_5500 3 |
395 |
|
|
396 |
|
|
397 |
|
/* For the automachine system: */ |
398 |
|
struct machine_entry_subtype { |
399 |
|
int machine_subtype;/* Old-style subtype */ |
400 |
|
const char *name; /* Official name */ |
401 |
|
int n_aliases; |
402 |
|
char **aliases; /* Aliases */ |
403 |
|
}; |
404 |
|
|
405 |
/* X86: */ |
struct machine_entry { |
406 |
#define MACHINE_X86_GENERIC 1 |
struct machine_entry *next; |
|
#define MACHINE_X86_XT 2 |
|
407 |
|
|
408 |
|
/* Machine type: */ |
409 |
|
int arch; |
410 |
|
int machine_type; /* Old-style type */ |
411 |
|
const char *name; /* Official name */ |
412 |
|
int n_aliases; |
413 |
|
char **aliases; /* Aliases */ |
414 |
|
|
415 |
|
void (*setup)(struct machine *, struct cpu *); |
416 |
|
void (*set_default_cpu)(struct machine *); |
417 |
|
void (*set_default_ram)(struct machine *); |
418 |
|
|
419 |
|
/* Machine subtypes: */ |
420 |
|
int n_subtypes; |
421 |
|
struct machine_entry_subtype **subtype; |
422 |
|
}; |
423 |
|
|
424 |
/* |
#define MACHINE_SETUP_TYPE(n) void (*n)(struct machine *, struct cpu *) |
425 |
* Problem: kernels seem to be loaded at low addresses in RAM, so |
#define MACHINE_SETUP(x) void machine_setup_ ## x(struct machine *machine, \ |
426 |
* storing environment strings and memory descriptors there is a bad |
struct cpu *cpu) |
427 |
* idea. They are stored at 0xbfc..... instead. The ARC SPB must |
#define MACHINE_DEFAULT_CPU(x) void machine_default_cpu_ ## x(struct machine *machine) |
428 |
* be at physical address 0x1000 though. |
#define MACHINE_DEFAULT_RAM(x) void machine_default_ram_ ## x(struct machine *machine) |
429 |
*/ |
#define MACHINE_REGISTER(x) void machine_register_ ## x(void) |
430 |
#define SGI_SPB_ADDR 0xffffffff80001000ULL |
#define MR_DEFAULT(x,name,arch,type) struct machine_entry \ |
431 |
/* 0xbfc10000 is firmware callback vector stuff */ |
*me = machine_entry_new(name,arch,type); \ |
432 |
#define ARC_FIRMWARE_VECTORS 0xffffffffbfc80000ULL |
me->setup = machine_setup_ ## x; \ |
433 |
#define ARC_FIRMWARE_ENTRIES 0xffffffffbfc88000ULL |
me->set_default_cpu = machine_default_cpu_ ## x; \ |
434 |
#define ARC_ARGV_START 0xffffffffbfc90000ULL |
machine_entry_register(me, arch); |
435 |
#define ARC_ENV_STRINGS 0xffffffffbfc98000ULL |
void automachine_init(void); |
|
#define ARC_ENV_POINTERS 0xffffffffbfc9d000ULL |
|
|
#define SGI_SYSID_ADDR 0xffffffffbfca1800ULL |
|
|
#define ARC_DSPSTAT_ADDR 0xffffffffbfca1c00ULL |
|
|
#define ARC_MEMDESC_ADDR 0xffffffffbfca1c80ULL |
|
|
#define ARC_CONFIG_DATA_ADDR 0xffffffffbfca2000ULL |
|
|
#define FIRST_ARC_COMPONENT 0xffffffffbfca8000ULL |
|
|
#define ARC_PRIVATE_VECTORS 0xffffffffbfcb0000ULL |
|
|
#define ARC_PRIVATE_ENTRIES 0xffffffffbfcb8000ULL |
|
436 |
|
|
437 |
|
|
438 |
/* machine.c: */ |
/* machine.c: */ |
439 |
struct machine *machine_new(char *name, struct emul *emul); |
struct machine *machine_new(char *name, struct emul *emul, int id); |
440 |
|
void machine_destroy(struct machine *machine); |
441 |
int machine_name_to_type(char *stype, char *ssubtype, |
int machine_name_to_type(char *stype, char *ssubtype, |
442 |
int *type, int *subtype, int *arch); |
int *type, int *subtype, int *arch); |
443 |
void machine_add_tickfunction(struct machine *machine, |
void machine_add_tickfunction(struct machine *machine, |
444 |
void (*func)(struct cpu *, void *), void *extra, int clockshift); |
void (*func)(struct cpu *, void *), void *extra, |
445 |
|
int clockshift, double hz); |
446 |
|
void machine_statistics_init(struct machine *, char *fname); |
447 |
|
void machine_register(char *name, MACHINE_SETUP_TYPE(setup)); |
448 |
void dump_mem_string(struct cpu *cpu, uint64_t addr); |
void dump_mem_string(struct cpu *cpu, uint64_t addr); |
449 |
void store_string(struct cpu *cpu, uint64_t addr, char *s); |
void store_string(struct cpu *cpu, uint64_t addr, char *s); |
450 |
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); |
457 |
uint64_t data32); |
uint64_t data32); |
458 |
void store_16bit_word_in_host(struct cpu *cpu, unsigned char *data, |
void store_16bit_word_in_host(struct cpu *cpu, unsigned char *data, |
459 |
uint16_t data16); |
uint16_t data16); |
460 |
|
uint64_t load_64bit_word(struct cpu *cpu, uint64_t addr); |
461 |
uint32_t load_32bit_word(struct cpu *cpu, uint64_t addr); |
uint32_t load_32bit_word(struct cpu *cpu, uint64_t addr); |
462 |
uint16_t load_16bit_word(struct cpu *cpu, uint64_t addr); |
uint16_t load_16bit_word(struct cpu *cpu, uint64_t addr); |
463 |
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); |
464 |
|
void add_environment_string(struct cpu *cpu, char *s, uint64_t *addr); |
465 |
|
void add_environment_string_dual(struct cpu *cpu, |
466 |
|
uint64_t *ptrp, uint64_t *addrp, char *s1, char *s2); |
467 |
|
void store_pointer_and_advance(struct cpu *cpu, uint64_t *addrp, |
468 |
|
uint64_t data, int flag64); |
469 |
void machine_setup(struct machine *); |
void machine_setup(struct machine *); |
470 |
void machine_memsize_fix(struct machine *); |
void machine_memsize_fix(struct machine *); |
471 |
void machine_default_cputype(struct machine *); |
void machine_default_cputype(struct machine *); |
472 |
void machine_dumpinfo(struct machine *); |
void machine_dumpinfo(struct machine *); |
473 |
|
int machine_run(struct machine *machine); |
474 |
void machine_list_available_types_and_cpus(void); |
void machine_list_available_types_and_cpus(void); |
475 |
|
struct machine_entry *machine_entry_new(const char *name, |
476 |
|
int arch, int oldstyle_type); |
477 |
|
void machine_entry_add_alias(struct machine_entry *me, const char *name); |
478 |
|
void machine_entry_add_subtype(struct machine_entry *me, const char *name, |
479 |
|
int oldstyle_subtype, ...); |
480 |
|
void machine_entry_register(struct machine_entry *me, int arch); |
481 |
void machine_init(void); |
void machine_init(void); |
482 |
|
|
483 |
|
|