2010-03-29 21:23:52 +02:00
|
|
|
/*
|
|
|
|
* QEMU System Emulator
|
|
|
|
*
|
|
|
|
* Copyright (c) 2003-2008 Fabrice Bellard
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
2016-01-29 18:50:05 +01:00
|
|
|
#include "qemu/osdep.h"
|
2016-03-15 16:58:45 +01:00
|
|
|
#include "qemu-common.h"
|
|
|
|
#include "cpu.h"
|
2012-12-17 18:20:04 +01:00
|
|
|
#include "sysemu/sysemu.h"
|
|
|
|
#include "sysemu/arch_init.h"
|
2012-12-12 13:24:50 +01:00
|
|
|
#include "hw/pci/pci.h"
|
2017-05-08 22:57:35 +02:00
|
|
|
#include "hw/audio/soundhw.h"
|
2018-02-27 00:13:27 +01:00
|
|
|
#include "qapi/qapi-commands-misc.h"
|
2018-04-27 21:28:50 +02:00
|
|
|
#include "qapi/error.h"
|
2012-12-17 18:20:00 +01:00
|
|
|
#include "qemu/config-file.h"
|
2014-03-19 19:32:31 +01:00
|
|
|
#include "qemu/error-report.h"
|
2013-04-15 08:19:22 +02:00
|
|
|
#include "hw/acpi/acpi.h"
|
2016-03-20 18:16:19 +01:00
|
|
|
#include "qemu/help_option.h"
|
2010-03-29 21:23:52 +02:00
|
|
|
|
|
|
|
#ifdef TARGET_SPARC
|
|
|
|
int graphic_width = 1024;
|
|
|
|
int graphic_height = 768;
|
|
|
|
int graphic_depth = 8;
|
|
|
|
#else
|
|
|
|
int graphic_width = 800;
|
|
|
|
int graphic_height = 600;
|
2013-06-20 14:06:27 +02:00
|
|
|
int graphic_depth = 32;
|
2010-03-29 21:23:52 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(TARGET_ALPHA)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_ALPHA
|
|
|
|
#elif defined(TARGET_ARM)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_ARM
|
|
|
|
#elif defined(TARGET_CRIS)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_CRIS
|
2017-10-01 22:11:45 +02:00
|
|
|
#elif defined(TARGET_HPPA)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_HPPA
|
2018-05-03 21:51:03 +02:00
|
|
|
#elif defined(TARGET_I386)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_I386
|
2011-02-17 23:45:02 +01:00
|
|
|
#elif defined(TARGET_LM32)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_LM32
|
2018-05-03 21:51:03 +02:00
|
|
|
#elif defined(TARGET_M68K)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_M68K
|
2010-03-29 21:23:52 +02:00
|
|
|
#elif defined(TARGET_MICROBLAZE)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_MICROBLAZE
|
|
|
|
#elif defined(TARGET_MIPS)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_MIPS
|
2013-03-18 20:49:25 +01:00
|
|
|
#elif defined(TARGET_MOXIE)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_MOXIE
|
2017-01-18 23:01:46 +01:00
|
|
|
#elif defined(TARGET_NIOS2)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_NIOS2
|
2012-07-20 09:50:39 +02:00
|
|
|
#elif defined(TARGET_OPENRISC)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_OPENRISC
|
2010-03-29 21:23:52 +02:00
|
|
|
#elif defined(TARGET_PPC)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_PPC
|
2018-03-02 13:32:59 +01:00
|
|
|
#elif defined(TARGET_RISCV)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_RISCV
|
2010-03-29 21:23:52 +02:00
|
|
|
#elif defined(TARGET_S390X)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_S390X
|
|
|
|
#elif defined(TARGET_SH4)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_SH4
|
|
|
|
#elif defined(TARGET_SPARC)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_SPARC
|
2014-09-01 13:59:46 +02:00
|
|
|
#elif defined(TARGET_TRICORE)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_TRICORE
|
2018-05-03 21:51:03 +02:00
|
|
|
#elif defined(TARGET_UNICORE32)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_UNICORE32
|
|
|
|
#elif defined(TARGET_XTENSA)
|
|
|
|
#define QEMU_ARCH QEMU_ARCH_XTENSA
|
2010-03-29 21:23:52 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
const uint32_t arch_type = QEMU_ARCH;
|
|
|
|
|
|
|
|
int kvm_available(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_KVM
|
|
|
|
return 1;
|
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
int xen_available(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_XEN
|
|
|
|
return 1;
|
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
2012-08-20 16:31:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
TargetInfo *qmp_query_target(Error **errp)
|
|
|
|
{
|
|
|
|
TargetInfo *info = g_malloc0(sizeof(*info));
|
|
|
|
|
2018-04-27 21:28:50 +02:00
|
|
|
info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
|
|
|
|
&error_abort);
|
2012-08-20 16:31:38 +02:00
|
|
|
|
|
|
|
return info;
|
|
|
|
}
|