i386/pc: move vmport.c to hw/i386/
It's a x86-only device, so it does not make sense to keep it in the shared misc folder. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
0d5d8a3a90
commit
323d7d1d99
|
@ -5,6 +5,7 @@ obj-y += pc_sysfw.o
|
||||||
obj-y += x86-iommu.o intel_iommu.o
|
obj-y += x86-iommu.o intel_iommu.o
|
||||||
obj-y += amd_iommu.o
|
obj-y += amd_iommu.o
|
||||||
obj-$(CONFIG_XEN) += ../xenpv/ xen/
|
obj-$(CONFIG_XEN) += ../xenpv/ xen/
|
||||||
|
obj-$(CONFIG_VMPORT) += vmport.o
|
||||||
|
|
||||||
obj-y += kvmvapic.o
|
obj-y += kvmvapic.o
|
||||||
obj-y += acpi-build.o
|
obj-y += acpi-build.o
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "sysemu/hw_accel.h"
|
#include "sysemu/hw_accel.h"
|
||||||
#include "hw/qdev.h"
|
#include "hw/qdev.h"
|
||||||
|
|
||||||
//#define VMPORT_DEBUG
|
/* #define VMPORT_DEBUG */
|
||||||
|
|
||||||
#define VMPORT_CMD_GETVERSION 0x0a
|
#define VMPORT_CMD_GETVERSION 0x0a
|
||||||
#define VMPORT_CMD_GETRAMSIZE 0x14
|
#define VMPORT_CMD_GETRAMSIZE 0x14
|
||||||
|
@ -38,8 +38,7 @@
|
||||||
|
|
||||||
#define VMPORT(obj) OBJECT_CHECK(VMPortState, (obj), TYPE_VMPORT)
|
#define VMPORT(obj) OBJECT_CHECK(VMPortState, (obj), TYPE_VMPORT)
|
||||||
|
|
||||||
typedef struct VMPortState
|
typedef struct VMPortState {
|
||||||
{
|
|
||||||
ISADevice parent_obj;
|
ISADevice parent_obj;
|
||||||
|
|
||||||
MemoryRegion io;
|
MemoryRegion io;
|
||||||
|
@ -51,8 +50,9 @@ static VMPortState *port_state;
|
||||||
|
|
||||||
void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque)
|
void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque)
|
||||||
{
|
{
|
||||||
if (command >= VMPORT_ENTRIES)
|
if (command >= VMPORT_ENTRIES) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
port_state->func[command] = func;
|
port_state->func[command] = func;
|
||||||
port_state->opaque[command] = opaque;
|
port_state->opaque[command] = opaque;
|
||||||
|
@ -71,14 +71,15 @@ static uint64_t vmport_ioport_read(void *opaque, hwaddr addr,
|
||||||
cpu_synchronize_state(cs);
|
cpu_synchronize_state(cs);
|
||||||
|
|
||||||
eax = env->regs[R_EAX];
|
eax = env->regs[R_EAX];
|
||||||
if (eax != VMPORT_MAGIC)
|
if (eax != VMPORT_MAGIC) {
|
||||||
return eax;
|
return eax;
|
||||||
|
}
|
||||||
|
|
||||||
command = env->regs[R_ECX];
|
command = env->regs[R_ECX];
|
||||||
if (command >= VMPORT_ENTRIES)
|
if (command >= VMPORT_ENTRIES) {
|
||||||
return eax;
|
return eax;
|
||||||
if (!s->func[command])
|
}
|
||||||
{
|
if (!s->func[command]) {
|
||||||
#ifdef VMPORT_DEBUG
|
#ifdef VMPORT_DEBUG
|
||||||
fprintf(stderr, "vmport: unknown command %x\n", command);
|
fprintf(stderr, "vmport: unknown command %x\n", command);
|
||||||
#endif
|
#endif
|
|
@ -11,8 +11,6 @@ common-obj-$(CONFIG_EDU) += edu.o
|
||||||
common-obj-y += unimp.o
|
common-obj-y += unimp.o
|
||||||
common-obj-$(CONFIG_FW_CFG_DMA) += vmcoreinfo.o
|
common-obj-$(CONFIG_FW_CFG_DMA) += vmcoreinfo.o
|
||||||
|
|
||||||
obj-$(CONFIG_VMPORT) += vmport.o
|
|
||||||
|
|
||||||
# ARM devices
|
# ARM devices
|
||||||
common-obj-$(CONFIG_PL310) += arm_l2x0.o
|
common-obj-$(CONFIG_PL310) += arm_l2x0.o
|
||||||
common-obj-$(CONFIG_INTEGRATOR_DEBUG) += arm_integrator_debug.o
|
common-obj-$(CONFIG_INTEGRATOR_DEBUG) += arm_integrator_debug.o
|
||||||
|
|
Loading…
Reference in a new issue