--- trunk/src/machines/machine_test.c 2007/10/08 16:19:43 23 +++ trunk/src/machines/machine_test.c 2007/10/08 16:19:56 24 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $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 $ * * Various "test" machines (bare machines with just a CPU, or a bare machine * plus some experimental devices). @@ -40,29 +40,35 @@ #include "machine.h" #include "memory.h" #include "misc.h" -#include "mp.h" + +#include "testmachine/dev_cons.h" +#include "testmachine/dev_disk.h" +#include "testmachine/dev_ether.h" +#include "testmachine/dev_fb.h" +#include "testmachine/dev_mp.h" static void default_test(struct machine *machine, struct cpu *cpu) { char tmpstr[1000]; - snprintf(tmpstr, sizeof(tmpstr), "cons addr=0x%llx irq=0", - (long long)DEV_CONS_ADDRESS); + + snprintf(tmpstr, sizeof(tmpstr), "cons addr=0x%"PRIx64" irq=0", + (uint64_t) DEV_CONS_ADDRESS); machine->main_console_handle = (size_t)device_add(machine, tmpstr); - snprintf(tmpstr, sizeof(tmpstr), "mp addr=0x%llx", - (long long)DEV_MP_ADDRESS); + snprintf(tmpstr, sizeof(tmpstr), "mp addr=0x%"PRIx64, + (uint64_t) DEV_MP_ADDRESS); device_add(machine, tmpstr); dev_fb_init(machine, machine->memory, DEV_FB_ADDRESS, VFB_GENERIC, - 640,480, 640,480, 24, "testalpha generic"); + 640,480, 640,480, 24, "generic"); - snprintf(tmpstr, sizeof(tmpstr), "disk addr=0x%llx", - (long long)DEV_DISK_ADDRESS); + snprintf(tmpstr, sizeof(tmpstr), "disk addr=0x%"PRIx64, + (uint64_t) DEV_DISK_ADDRESS); device_add(machine, tmpstr); - snprintf(tmpstr, sizeof(tmpstr), "ether addr=0x%llx irq=0", - (long long)DEV_ETHER_ADDRESS); + snprintf(tmpstr, sizeof(tmpstr), "ether addr=0x%"PRIx64" irq=0", + (uint64_t) DEV_ETHER_ADDRESS); device_add(machine, tmpstr); } @@ -87,13 +93,13 @@ MACHINE_DEFAULT_CPU(barealpha) { - machine->cpu_name = strdup("Alpha"); + machine->cpu_name = strdup("21264"); } MACHINE_DEFAULT_CPU(testalpha) { - machine->cpu_name = strdup("Alpha"); + machine->cpu_name = strdup("21264"); } @@ -175,28 +181,6 @@ -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); -} - - MACHINE_SETUP(barehppa) { machine->machine_name = "Generic \"bare\" HPPA machine"; @@ -418,36 +402,36 @@ machine->stable = 1; cpu->byte_order = EMUL_BIG_ENDIAN; - snprintf(tmpstr, sizeof(tmpstr), "cons addr=0x%llx irq=2", - (long long)DEV_CONS_ADDRESS); + snprintf(tmpstr, sizeof(tmpstr), "cons addr=0x%"PRIx64" irq=2", + (uint64_t) DEV_CONS_ADDRESS); machine->main_console_handle = (size_t)device_add(machine, tmpstr); - snprintf(tmpstr, sizeof(tmpstr), "mp addr=0x%llx", - (long long)DEV_MP_ADDRESS); + snprintf(tmpstr, sizeof(tmpstr), "mp addr=0x%"PRIx64, + (uint64_t) DEV_MP_ADDRESS); device_add(machine, tmpstr); dev_fb_init(machine, machine->memory, DEV_FB_ADDRESS, VFB_GENERIC, 640,480, 640,480, 24, "testmips generic"); - snprintf(tmpstr, sizeof(tmpstr), "disk addr=0x%llx", - (long long)DEV_DISK_ADDRESS); + snprintf(tmpstr, sizeof(tmpstr), "disk addr=0x%"PRIx64, + (uint64_t) DEV_DISK_ADDRESS); device_add(machine, tmpstr); - snprintf(tmpstr, sizeof(tmpstr), "ether addr=0x%llx irq=3", - (long long)DEV_ETHER_ADDRESS); + snprintf(tmpstr, sizeof(tmpstr), "ether addr=0x%"PRIx64" irq=3", + (uint64_t) DEV_ETHER_ADDRESS); device_add(machine, tmpstr); } MACHINE_DEFAULT_CPU(baremips) { - machine->cpu_name = strdup("R4000"); + machine->cpu_name = strdup("5Kc"); } MACHINE_DEFAULT_CPU(testmips) { - machine->cpu_name = strdup("R4000"); + machine->cpu_name = strdup("5Kc"); } @@ -585,13 +569,13 @@ MACHINE_DEFAULT_CPU(baresparc) { - machine->cpu_name = strdup("SPARCv9"); + machine->cpu_name = strdup("UltraSPARC"); } MACHINE_DEFAULT_CPU(testsparc) { - machine->cpu_name = strdup("SPARCv9"); + machine->cpu_name = strdup("UltraSPARC"); }