25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: machine_test.c,v 1.1 2006/01/01 20:41:25 debug Exp $ |
* $Id: machine_test.c,v 1.13 2006/06/12 10:21:12 debug Exp $ |
29 |
* |
* |
30 |
* Various "test" machines (bare machines with just a CPU, or a bare machine |
* Various "test" machines (bare machines with just a CPU, or a bare machine |
31 |
* plus some experimental devices). |
* plus some experimental devices). |
40 |
#include "machine.h" |
#include "machine.h" |
41 |
#include "memory.h" |
#include "memory.h" |
42 |
#include "misc.h" |
#include "misc.h" |
43 |
#include "mp.h" |
|
44 |
|
#include "testmachine/dev_cons.h" |
45 |
|
#include "testmachine/dev_disk.h" |
46 |
|
#include "testmachine/dev_ether.h" |
47 |
|
#include "testmachine/dev_fb.h" |
48 |
|
#include "testmachine/dev_mp.h" |
49 |
|
|
50 |
|
|
51 |
static void default_test(struct machine *machine, struct cpu *cpu) |
static void default_test(struct machine *machine, struct cpu *cpu) |
52 |
{ |
{ |
53 |
char tmpstr[1000]; |
char tmpstr[1000]; |
54 |
snprintf(tmpstr, sizeof(tmpstr), "cons addr=0x%llx irq=0", |
|
55 |
(long long)DEV_CONS_ADDRESS); |
snprintf(tmpstr, sizeof(tmpstr), "cons addr=0x%"PRIx64" irq=0", |
56 |
|
(uint64_t) DEV_CONS_ADDRESS); |
57 |
machine->main_console_handle = (size_t)device_add(machine, tmpstr); |
machine->main_console_handle = (size_t)device_add(machine, tmpstr); |
58 |
|
|
59 |
snprintf(tmpstr, sizeof(tmpstr), "mp addr=0x%llx", |
snprintf(tmpstr, sizeof(tmpstr), "mp addr=0x%"PRIx64, |
60 |
(long long)DEV_MP_ADDRESS); |
(uint64_t) DEV_MP_ADDRESS); |
61 |
device_add(machine, tmpstr); |
device_add(machine, tmpstr); |
62 |
|
|
63 |
dev_fb_init(machine, machine->memory, DEV_FB_ADDRESS, VFB_GENERIC, |
dev_fb_init(machine, machine->memory, DEV_FB_ADDRESS, VFB_GENERIC, |
64 |
640,480, 640,480, 24, "testalpha generic"); |
640,480, 640,480, 24, "generic"); |
65 |
|
|
66 |
snprintf(tmpstr, sizeof(tmpstr), "disk addr=0x%llx", |
snprintf(tmpstr, sizeof(tmpstr), "disk addr=0x%"PRIx64, |
67 |
(long long)DEV_DISK_ADDRESS); |
(uint64_t) DEV_DISK_ADDRESS); |
68 |
device_add(machine, tmpstr); |
device_add(machine, tmpstr); |
69 |
|
|
70 |
snprintf(tmpstr, sizeof(tmpstr), "ether addr=0x%llx irq=0", |
snprintf(tmpstr, sizeof(tmpstr), "ether addr=0x%"PRIx64" irq=0", |
71 |
(long long)DEV_ETHER_ADDRESS); |
(uint64_t) DEV_ETHER_ADDRESS); |
72 |
device_add(machine, tmpstr); |
device_add(machine, tmpstr); |
73 |
} |
} |
74 |
|
|
93 |
|
|
94 |
MACHINE_DEFAULT_CPU(barealpha) |
MACHINE_DEFAULT_CPU(barealpha) |
95 |
{ |
{ |
96 |
machine->cpu_name = strdup("Alpha"); |
machine->cpu_name = strdup("21264"); |
97 |
} |
} |
98 |
|
|
99 |
|
|
100 |
MACHINE_DEFAULT_CPU(testalpha) |
MACHINE_DEFAULT_CPU(testalpha) |
101 |
{ |
{ |
102 |
machine->cpu_name = strdup("Alpha"); |
machine->cpu_name = strdup("21264"); |
103 |
} |
} |
104 |
|
|
105 |
|
|
181 |
|
|
182 |
|
|
183 |
|
|
|
MACHINE_SETUP(bareavr) |
|
|
{ |
|
|
machine->machine_name = "Generic \"bare\" AVR machine"; |
|
|
machine->stable = 1; |
|
|
} |
|
|
|
|
|
|
|
|
MACHINE_DEFAULT_CPU(bareavr) |
|
|
{ |
|
|
machine->cpu_name = strdup("AVR"); |
|
|
} |
|
|
|
|
|
|
|
|
MACHINE_REGISTER(bareavr) |
|
|
{ |
|
|
MR_DEFAULT(bareavr, "Generic \"bare\" AVR machine", |
|
|
ARCH_AVR, MACHINE_BAREAVR, 1, 0); |
|
|
me->aliases[0] = "bareavr"; |
|
|
machine_entry_add(me, ARCH_AVR); |
|
|
} |
|
|
|
|
|
|
|
184 |
MACHINE_SETUP(barehppa) |
MACHINE_SETUP(barehppa) |
185 |
{ |
{ |
186 |
machine->machine_name = "Generic \"bare\" HPPA machine"; |
machine->machine_name = "Generic \"bare\" HPPA machine"; |
402 |
machine->stable = 1; |
machine->stable = 1; |
403 |
cpu->byte_order = EMUL_BIG_ENDIAN; |
cpu->byte_order = EMUL_BIG_ENDIAN; |
404 |
|
|
405 |
snprintf(tmpstr, sizeof(tmpstr), "cons addr=0x%llx irq=2", |
snprintf(tmpstr, sizeof(tmpstr), "cons addr=0x%"PRIx64" irq=2", |
406 |
(long long)DEV_CONS_ADDRESS); |
(uint64_t) DEV_CONS_ADDRESS); |
407 |
machine->main_console_handle = (size_t)device_add(machine, tmpstr); |
machine->main_console_handle = (size_t)device_add(machine, tmpstr); |
408 |
|
|
409 |
snprintf(tmpstr, sizeof(tmpstr), "mp addr=0x%llx", |
snprintf(tmpstr, sizeof(tmpstr), "mp addr=0x%"PRIx64, |
410 |
(long long)DEV_MP_ADDRESS); |
(uint64_t) DEV_MP_ADDRESS); |
411 |
device_add(machine, tmpstr); |
device_add(machine, tmpstr); |
412 |
|
|
413 |
dev_fb_init(machine, machine->memory, DEV_FB_ADDRESS, VFB_GENERIC, |
dev_fb_init(machine, machine->memory, DEV_FB_ADDRESS, VFB_GENERIC, |
414 |
640,480, 640,480, 24, "testmips generic"); |
640,480, 640,480, 24, "testmips generic"); |
415 |
|
|
416 |
snprintf(tmpstr, sizeof(tmpstr), "disk addr=0x%llx", |
snprintf(tmpstr, sizeof(tmpstr), "disk addr=0x%"PRIx64, |
417 |
(long long)DEV_DISK_ADDRESS); |
(uint64_t) DEV_DISK_ADDRESS); |
418 |
device_add(machine, tmpstr); |
device_add(machine, tmpstr); |
419 |
|
|
420 |
snprintf(tmpstr, sizeof(tmpstr), "ether addr=0x%llx irq=3", |
snprintf(tmpstr, sizeof(tmpstr), "ether addr=0x%"PRIx64" irq=3", |
421 |
(long long)DEV_ETHER_ADDRESS); |
(uint64_t) DEV_ETHER_ADDRESS); |
422 |
device_add(machine, tmpstr); |
device_add(machine, tmpstr); |
423 |
} |
} |
424 |
|
|
425 |
|
|
426 |
MACHINE_DEFAULT_CPU(baremips) |
MACHINE_DEFAULT_CPU(baremips) |
427 |
{ |
{ |
428 |
machine->cpu_name = strdup("R4000"); |
machine->cpu_name = strdup("5Kc"); |
429 |
} |
} |
430 |
|
|
431 |
|
|
432 |
MACHINE_DEFAULT_CPU(testmips) |
MACHINE_DEFAULT_CPU(testmips) |
433 |
{ |
{ |
434 |
machine->cpu_name = strdup("R4000"); |
machine->cpu_name = strdup("5Kc"); |
435 |
} |
} |
436 |
|
|
437 |
|
|
569 |
|
|
570 |
MACHINE_DEFAULT_CPU(baresparc) |
MACHINE_DEFAULT_CPU(baresparc) |
571 |
{ |
{ |
572 |
machine->cpu_name = strdup("SPARCv9"); |
machine->cpu_name = strdup("UltraSPARC"); |
573 |
} |
} |
574 |
|
|
575 |
|
|
576 |
MACHINE_DEFAULT_CPU(testsparc) |
MACHINE_DEFAULT_CPU(testsparc) |
577 |
{ |
{ |
578 |
machine->cpu_name = strdup("SPARCv9"); |
machine->cpu_name = strdup("UltraSPARC"); |
579 |
} |
} |
580 |
|
|
581 |
|
|