xref: /qemu/hw/core/null-machine.c (revision fc524567087c2537b5103cdfc1d41e4f442892b6)
1b4a738bfSAnthony Liguori /*
2b4a738bfSAnthony Liguori  * Empty machine
3b4a738bfSAnthony Liguori  *
4b4a738bfSAnthony Liguori  * Copyright IBM, Corp. 2012
5b4a738bfSAnthony Liguori  *
6b4a738bfSAnthony Liguori  * Authors:
7b4a738bfSAnthony Liguori  *  Anthony Liguori   <aliguori@us.ibm.com>
8b4a738bfSAnthony Liguori  *
9b4a738bfSAnthony Liguori  * This work is licensed under the terms of the GNU GPL, version 2 or later.
10b4a738bfSAnthony Liguori  * See the COPYING file in the top-level directory.
11b4a738bfSAnthony Liguori  *
12b4a738bfSAnthony Liguori  */
13b4a738bfSAnthony Liguori 
1418c86e2bSPeter Maydell #include "qemu/osdep.h"
153964ec6cSThomas Huth #include "qemu/error-report.h"
16b4a738bfSAnthony Liguori #include "hw/boards.h"
17*dfc56946SRichard Henderson #include "system/address-spaces.h"
182e5b09fdSMarkus Armbruster #include "hw/core/cpu.h"
19b4a738bfSAnthony Liguori 
machine_none_init(MachineState * mch)203964ec6cSThomas Huth static void machine_none_init(MachineState *mch)
21b4a738bfSAnthony Liguori {
223964ec6cSThomas Huth     CPUState *cpu = NULL;
233964ec6cSThomas Huth 
242278b939SIgor Mammedov     /* Initialize CPU (if user asked for it) */
252278b939SIgor Mammedov     if (mch->cpu_type) {
262278b939SIgor Mammedov         cpu = cpu_create(mch->cpu_type);
273964ec6cSThomas Huth         if (!cpu) {
283964ec6cSThomas Huth             error_report("Unable to initialize CPU");
293964ec6cSThomas Huth             exit(1);
303964ec6cSThomas Huth         }
313964ec6cSThomas Huth     }
323964ec6cSThomas Huth 
333964ec6cSThomas Huth     /* RAM at address zero */
34c74e7190SIgor Mammedov     if (mch->ram) {
35c74e7190SIgor Mammedov         memory_region_add_subregion(get_system_memory(), 0, mch->ram);
363964ec6cSThomas Huth     }
37991db247SThomas Huth 
38991db247SThomas Huth     if (mch->kernel_filename) {
39991db247SThomas Huth         error_report("The -kernel parameter is not supported "
40991db247SThomas Huth                      "(use the generic 'loader' device instead).");
41991db247SThomas Huth         exit(1);
42991db247SThomas Huth     }
43b4a738bfSAnthony Liguori }
44b4a738bfSAnthony Liguori 
machine_none_machine_init(MachineClass * mc)45e264d29dSEduardo Habkost static void machine_none_machine_init(MachineClass *mc)
46b4a738bfSAnthony Liguori {
47e264d29dSEduardo Habkost     mc->desc = "empty machine";
48e264d29dSEduardo Habkost     mc->init = machine_none_init;
493964ec6cSThomas Huth     mc->max_cpus = 1;
503964ec6cSThomas Huth     mc->default_ram_size = 0;
51c74e7190SIgor Mammedov     mc->default_ram_id = "ram";
529e7871b1SPhilippe Mathieu-Daudé     mc->no_serial = 1;
539e7871b1SPhilippe Mathieu-Daudé     mc->no_parallel = 1;
549e7871b1SPhilippe Mathieu-Daudé     mc->no_floppy = 1;
559e7871b1SPhilippe Mathieu-Daudé     mc->no_cdrom = 1;
56b4a738bfSAnthony Liguori }
57b4a738bfSAnthony Liguori 
58e264d29dSEduardo Habkost DEFINE_MACHINE("none", machine_none_machine_init)
59