blob: 0a1531124c9577f786e04af287f9c0a6fbd37619 [file] [log] [blame]
Blue Swirlad960902010-03-29 19:23:52 +00001/*
2 * QEMU System Emulator
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
Peter Maydelld38ea872016-01-29 17:50:05 +000024#include "qemu/osdep.h"
Paolo Bonzini33c11872016-03-15 16:58:45 +010025#include "cpu.h"
Paolo Bonzini9c17d612012-12-17 18:20:04 +010026#include "sysemu/sysemu.h"
Paolo Bonzini9c17d612012-12-17 18:20:04 +010027#include "sysemu/arch_init.h"
Michael S. Tsirkina2cb15b2012-12-12 14:24:50 +020028#include "hw/pci/pci.h"
Eduardo Habkost8a824e42017-05-08 17:57:35 -030029#include "hw/audio/soundhw.h"
Markus Armbruster112ed242018-02-26 17:13:27 -060030#include "qapi/qapi-commands-misc.h"
Laszlo Ersekb47aa7b2018-04-27 21:28:50 +020031#include "qapi/error.h"
Paolo Bonzini1de7afc2012-12-17 18:20:00 +010032#include "qemu/config-file.h"
Dr. David Alan Gilbertd97326e2014-03-19 18:32:31 +000033#include "qemu/error-report.h"
Michael S. Tsirkin04452592013-04-15 09:19:22 +030034#include "hw/acpi/acpi.h"
Veronia Bahaaf348b6d2016-03-20 19:16:19 +020035#include "qemu/help_option.h"
Blue Swirlad960902010-03-29 19:23:52 +000036
37#ifdef TARGET_SPARC
38int graphic_width = 1024;
39int graphic_height = 768;
40int graphic_depth = 8;
41#else
42int graphic_width = 800;
43int graphic_height = 600;
Alexander Graff1ff0e82013-06-20 14:06:27 +020044int graphic_depth = 32;
Blue Swirlad960902010-03-29 19:23:52 +000045#endif
46
Blue Swirlad960902010-03-29 19:23:52 +000047
48#if defined(TARGET_ALPHA)
49#define QEMU_ARCH QEMU_ARCH_ALPHA
50#elif defined(TARGET_ARM)
51#define QEMU_ARCH QEMU_ARCH_ARM
52#elif defined(TARGET_CRIS)
53#define QEMU_ARCH QEMU_ARCH_CRIS
Helge Deller813dff12017-10-01 22:11:45 +020054#elif defined(TARGET_HPPA)
55#define QEMU_ARCH QEMU_ARCH_HPPA
Michael S. Tsirkind35ea392018-05-03 22:51:03 +030056#elif defined(TARGET_I386)
57#define QEMU_ARCH QEMU_ARCH_I386
Michael Walle81ea0e12011-02-17 23:45:02 +010058#elif defined(TARGET_LM32)
59#define QEMU_ARCH QEMU_ARCH_LM32
Michael S. Tsirkind35ea392018-05-03 22:51:03 +030060#elif defined(TARGET_M68K)
61#define QEMU_ARCH QEMU_ARCH_M68K
Blue Swirlad960902010-03-29 19:23:52 +000062#elif defined(TARGET_MICROBLAZE)
63#define QEMU_ARCH QEMU_ARCH_MICROBLAZE
64#elif defined(TARGET_MIPS)
65#define QEMU_ARCH QEMU_ARCH_MIPS
Anthony Greend15a9c22013-03-18 15:49:25 -040066#elif defined(TARGET_MOXIE)
67#define QEMU_ARCH QEMU_ARCH_MOXIE
Marek Vasute6717112017-01-18 23:01:46 +010068#elif defined(TARGET_NIOS2)
69#define QEMU_ARCH QEMU_ARCH_NIOS2
Jia Liue67db062012-07-20 15:50:39 +080070#elif defined(TARGET_OPENRISC)
71#define QEMU_ARCH QEMU_ARCH_OPENRISC
Blue Swirlad960902010-03-29 19:23:52 +000072#elif defined(TARGET_PPC)
73#define QEMU_ARCH QEMU_ARCH_PPC
Michael Clark25fa1942018-03-03 01:32:59 +130074#elif defined(TARGET_RISCV)
75#define QEMU_ARCH QEMU_ARCH_RISCV
Blue Swirlad960902010-03-29 19:23:52 +000076#elif defined(TARGET_S390X)
77#define QEMU_ARCH QEMU_ARCH_S390X
78#elif defined(TARGET_SH4)
79#define QEMU_ARCH QEMU_ARCH_SH4
80#elif defined(TARGET_SPARC)
81#define QEMU_ARCH QEMU_ARCH_SPARC
Bastian Koppelmann48e06fe2014-09-01 12:59:46 +010082#elif defined(TARGET_TRICORE)
83#define QEMU_ARCH QEMU_ARCH_TRICORE
Michael S. Tsirkind35ea392018-05-03 22:51:03 +030084#elif defined(TARGET_UNICORE32)
85#define QEMU_ARCH QEMU_ARCH_UNICORE32
86#elif defined(TARGET_XTENSA)
87#define QEMU_ARCH QEMU_ARCH_XTENSA
Blue Swirlad960902010-03-29 19:23:52 +000088#endif
89
90const uint32_t arch_type = QEMU_ARCH;
Blue Swirlad960902010-03-29 19:23:52 +000091
Blue Swirlad960902010-03-29 19:23:52 +000092int kvm_available(void)
93{
94#ifdef CONFIG_KVM
95 return 1;
96#else
97 return 0;
98#endif
99}
100
101int xen_available(void)
102{
103#ifdef CONFIG_XEN
104 return 1;
105#else
106 return 0;
107#endif
108}