2011-06-16 20:05:17 +04:00
|
|
|
/*
|
|
|
|
* XEN platform pci device, formerly known as the event channel device
|
|
|
|
*
|
|
|
|
* Copyright (c) 2003-2004 Intel Corp.
|
|
|
|
* Copyright (c) 2006 XenSource
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include "hw.h"
|
|
|
|
#include "pc.h"
|
2012-12-12 16:24:50 +04:00
|
|
|
#include "pci/pci.h"
|
2011-06-16 20:05:17 +04:00
|
|
|
#include "irq.h"
|
|
|
|
#include "xen_common.h"
|
|
|
|
#include "xen_backend.h"
|
|
|
|
#include "trace.h"
|
2012-12-17 21:19:49 +04:00
|
|
|
#include "exec/address-spaces.h"
|
2011-06-16 20:05:17 +04:00
|
|
|
|
|
|
|
#include <xenguest.h>
|
|
|
|
|
|
|
|
//#define DEBUG_PLATFORM
|
|
|
|
|
|
|
|
#ifdef DEBUG_PLATFORM
|
|
|
|
#define DPRINTF(fmt, ...) do { \
|
|
|
|
fprintf(stderr, "xen_platform: " fmt, ## __VA_ARGS__); \
|
|
|
|
} while (0)
|
|
|
|
#else
|
|
|
|
#define DPRINTF(fmt, ...) do { } while (0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define PFFLAG_ROM_LOCK 1 /* Sets whether ROM memory area is RW or RO */
|
|
|
|
|
|
|
|
typedef struct PCIXenPlatformState {
|
|
|
|
PCIDevice pci_dev;
|
2011-08-08 17:09:25 +04:00
|
|
|
MemoryRegion fixed_io;
|
|
|
|
MemoryRegion bar;
|
|
|
|
MemoryRegion mmio_bar;
|
2011-06-16 20:05:17 +04:00
|
|
|
uint8_t flags; /* used only for version_id == 2 */
|
|
|
|
int drivers_blacklisted;
|
|
|
|
uint16_t driver_product_version;
|
|
|
|
|
|
|
|
/* Log from guest drivers */
|
|
|
|
char log_buffer[4096];
|
|
|
|
int log_buffer_off;
|
|
|
|
} PCIXenPlatformState;
|
|
|
|
|
|
|
|
#define XEN_PLATFORM_IOPORT 0x10
|
|
|
|
|
|
|
|
/* Send bytes to syslog */
|
|
|
|
static void log_writeb(PCIXenPlatformState *s, char val)
|
|
|
|
{
|
|
|
|
if (val == '\n' || s->log_buffer_off == sizeof(s->log_buffer) - 1) {
|
|
|
|
/* Flush buffer */
|
|
|
|
s->log_buffer[s->log_buffer_off] = 0;
|
|
|
|
trace_xen_platform_log(s->log_buffer);
|
|
|
|
s->log_buffer_off = 0;
|
|
|
|
} else {
|
|
|
|
s->log_buffer[s->log_buffer_off++] = val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Xen Platform, Fixed IOPort */
|
2011-07-18 10:07:02 +04:00
|
|
|
#define UNPLUG_ALL_IDE_DISKS 1
|
|
|
|
#define UNPLUG_ALL_NICS 2
|
|
|
|
#define UNPLUG_AUX_IDE_DISKS 4
|
|
|
|
|
2012-06-21 19:35:28 +04:00
|
|
|
static void unplug_nic(PCIBus *b, PCIDevice *d, void *o)
|
2011-07-18 10:07:02 +04:00
|
|
|
{
|
2012-10-03 17:45:24 +04:00
|
|
|
/* We have to ignore passthrough devices */
|
2011-07-18 10:07:02 +04:00
|
|
|
if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
|
2012-10-03 17:45:24 +04:00
|
|
|
PCI_CLASS_NETWORK_ETHERNET
|
|
|
|
&& strcmp(d->name, "xen-pci-passthrough") != 0) {
|
2012-05-16 21:50:10 +04:00
|
|
|
qdev_free(&d->qdev);
|
2011-07-18 10:07:02 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void pci_unplug_nics(PCIBus *bus)
|
|
|
|
{
|
2012-06-21 19:35:28 +04:00
|
|
|
pci_for_each_device(bus, 0, unplug_nic, NULL);
|
2011-07-18 10:07:02 +04:00
|
|
|
}
|
|
|
|
|
2012-06-21 19:35:28 +04:00
|
|
|
static void unplug_disks(PCIBus *b, PCIDevice *d, void *o)
|
2011-07-18 10:07:02 +04:00
|
|
|
{
|
2012-10-03 17:45:24 +04:00
|
|
|
/* We have to ignore passthrough devices */
|
2011-07-18 10:07:02 +04:00
|
|
|
if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
|
2012-10-03 17:45:24 +04:00
|
|
|
PCI_CLASS_STORAGE_IDE
|
|
|
|
&& strcmp(d->name, "xen-pci-passthrough") != 0) {
|
2012-03-15 00:37:38 +04:00
|
|
|
qdev_unplug(&(d->qdev), NULL);
|
2011-07-18 10:07:02 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void pci_unplug_disks(PCIBus *bus)
|
|
|
|
{
|
2012-06-21 19:35:28 +04:00
|
|
|
pci_for_each_device(bus, 0, unplug_disks, NULL);
|
2011-07-18 10:07:02 +04:00
|
|
|
}
|
2011-06-16 20:05:17 +04:00
|
|
|
|
|
|
|
static void platform_fixed_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
|
|
|
|
{
|
|
|
|
PCIXenPlatformState *s = opaque;
|
|
|
|
|
2011-11-04 19:35:11 +04:00
|
|
|
switch (addr) {
|
2011-06-16 20:05:17 +04:00
|
|
|
case 0:
|
|
|
|
/* Unplug devices. Value is a bitmask of which devices to
|
|
|
|
unplug, with bit 0 the IDE devices, bit 1 the network
|
|
|
|
devices, and bit 2 the non-primary-master IDE devices. */
|
2011-07-18 10:07:02 +04:00
|
|
|
if (val & UNPLUG_ALL_IDE_DISKS) {
|
|
|
|
DPRINTF("unplug disks\n");
|
2011-11-30 16:23:43 +04:00
|
|
|
bdrv_drain_all();
|
2011-07-18 10:07:02 +04:00
|
|
|
bdrv_flush_all();
|
|
|
|
pci_unplug_disks(s->pci_dev.bus);
|
|
|
|
}
|
|
|
|
if (val & UNPLUG_ALL_NICS) {
|
|
|
|
DPRINTF("unplug nics\n");
|
|
|
|
pci_unplug_nics(s->pci_dev.bus);
|
|
|
|
}
|
|
|
|
if (val & UNPLUG_AUX_IDE_DISKS) {
|
|
|
|
DPRINTF("unplug auxiliary disks not supported\n");
|
|
|
|
}
|
2011-06-16 20:05:17 +04:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
switch (val) {
|
|
|
|
case 1:
|
|
|
|
DPRINTF("Citrix Windows PV drivers loaded in guest\n");
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
DPRINTF("Guest claimed to be running PV product 0?\n");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
DPRINTF("Unknown PV product %d loaded in guest\n", val);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
s->driver_product_version = val;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void platform_fixed_ioport_writel(void *opaque, uint32_t addr,
|
|
|
|
uint32_t val)
|
|
|
|
{
|
2011-11-04 19:35:11 +04:00
|
|
|
switch (addr) {
|
2011-06-16 20:05:17 +04:00
|
|
|
case 0:
|
|
|
|
/* PV driver version */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void platform_fixed_ioport_writeb(void *opaque, uint32_t addr, uint32_t val)
|
|
|
|
{
|
|
|
|
PCIXenPlatformState *s = opaque;
|
|
|
|
|
2011-11-04 19:35:11 +04:00
|
|
|
switch (addr) {
|
2011-06-16 20:05:17 +04:00
|
|
|
case 0: /* Platform flags */ {
|
|
|
|
hvmmem_type_t mem_type = (val & PFFLAG_ROM_LOCK) ?
|
|
|
|
HVMMEM_ram_ro : HVMMEM_ram_rw;
|
|
|
|
if (xc_hvm_set_mem_type(xen_xc, xen_domid, mem_type, 0xc0, 0x40)) {
|
|
|
|
DPRINTF("unable to change ro/rw state of ROM memory area!\n");
|
|
|
|
} else {
|
|
|
|
s->flags = val & PFFLAG_ROM_LOCK;
|
|
|
|
DPRINTF("changed ro/rw state of ROM memory area. now is %s state.\n",
|
|
|
|
(mem_type == HVMMEM_ram_ro ? "ro":"rw"));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
log_writeb(s, val);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint32_t platform_fixed_ioport_readw(void *opaque, uint32_t addr)
|
|
|
|
{
|
|
|
|
PCIXenPlatformState *s = opaque;
|
|
|
|
|
2011-11-04 19:35:11 +04:00
|
|
|
switch (addr) {
|
2011-06-16 20:05:17 +04:00
|
|
|
case 0:
|
|
|
|
if (s->drivers_blacklisted) {
|
|
|
|
/* The drivers will recognise this magic number and refuse
|
|
|
|
* to do anything. */
|
|
|
|
return 0xd249;
|
|
|
|
} else {
|
|
|
|
/* Magic value so that you can identify the interface. */
|
|
|
|
return 0x49d2;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
return 0xffff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint32_t platform_fixed_ioport_readb(void *opaque, uint32_t addr)
|
|
|
|
{
|
|
|
|
PCIXenPlatformState *s = opaque;
|
|
|
|
|
2011-11-04 19:35:11 +04:00
|
|
|
switch (addr) {
|
2011-06-16 20:05:17 +04:00
|
|
|
case 0:
|
|
|
|
/* Platform flags */
|
|
|
|
return s->flags;
|
|
|
|
case 2:
|
|
|
|
/* Version number */
|
|
|
|
return 1;
|
|
|
|
default:
|
|
|
|
return 0xff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void platform_fixed_ioport_reset(void *opaque)
|
|
|
|
{
|
|
|
|
PCIXenPlatformState *s = opaque;
|
|
|
|
|
2011-11-04 19:35:11 +04:00
|
|
|
platform_fixed_ioport_writeb(s, 0, 0);
|
2011-06-16 20:05:17 +04:00
|
|
|
}
|
|
|
|
|
2012-10-08 15:47:30 +04:00
|
|
|
static uint64_t platform_fixed_ioport_read(void *opaque,
|
|
|
|
hwaddr addr,
|
|
|
|
unsigned size)
|
|
|
|
{
|
|
|
|
switch (size) {
|
|
|
|
case 1:
|
|
|
|
return platform_fixed_ioport_readb(opaque, addr);
|
|
|
|
case 2:
|
|
|
|
return platform_fixed_ioport_readw(opaque, addr);
|
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void platform_fixed_ioport_write(void *opaque, hwaddr addr,
|
|
|
|
|
|
|
|
uint64_t val, unsigned size)
|
|
|
|
{
|
|
|
|
switch (size) {
|
|
|
|
case 1:
|
|
|
|
platform_fixed_ioport_writeb(opaque, addr, val);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
platform_fixed_ioport_writew(opaque, addr, val);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
platform_fixed_ioport_writel(opaque, addr, val);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-08 17:09:25 +04:00
|
|
|
|
|
|
|
static const MemoryRegionOps platform_fixed_io_ops = {
|
2012-10-08 15:47:30 +04:00
|
|
|
.read = platform_fixed_ioport_read,
|
|
|
|
.write = platform_fixed_ioport_write,
|
|
|
|
.impl = {
|
|
|
|
.min_access_size = 1,
|
|
|
|
.max_access_size = 4,
|
|
|
|
},
|
|
|
|
.endianness = DEVICE_LITTLE_ENDIAN,
|
2011-08-08 17:09:25 +04:00
|
|
|
};
|
|
|
|
|
2011-06-16 20:05:17 +04:00
|
|
|
static void platform_fixed_ioport_init(PCIXenPlatformState* s)
|
|
|
|
{
|
2011-08-08 17:09:25 +04:00
|
|
|
memory_region_init_io(&s->fixed_io, &platform_fixed_io_ops, s,
|
|
|
|
"xen-fixed", 16);
|
|
|
|
memory_region_add_subregion(get_system_io(), XEN_PLATFORM_IOPORT,
|
|
|
|
&s->fixed_io);
|
2011-06-16 20:05:17 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Xen Platform PCI Device */
|
|
|
|
|
|
|
|
static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr)
|
|
|
|
{
|
|
|
|
if (addr == 0) {
|
2011-11-04 19:35:11 +04:00
|
|
|
return platform_fixed_ioport_readb(opaque, 0);
|
2011-06-16 20:05:17 +04:00
|
|
|
} else {
|
|
|
|
return ~0u;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void xen_platform_ioport_writeb(void *opaque, uint32_t addr, uint32_t val)
|
|
|
|
{
|
|
|
|
PCIXenPlatformState *s = opaque;
|
|
|
|
|
|
|
|
switch (addr) {
|
|
|
|
case 0: /* Platform flags */
|
2011-11-04 19:35:11 +04:00
|
|
|
platform_fixed_ioport_writeb(opaque, 0, val);
|
2011-06-16 20:05:17 +04:00
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
log_writeb(s, val);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-08 17:09:25 +04:00
|
|
|
static MemoryRegionPortio xen_pci_portio[] = {
|
|
|
|
{ 0, 0x100, 1, .read = xen_platform_ioport_readb, },
|
|
|
|
{ 0, 0x100, 1, .write = xen_platform_ioport_writeb, },
|
|
|
|
PORTIO_END_OF_LIST()
|
|
|
|
};
|
|
|
|
|
|
|
|
static const MemoryRegionOps xen_pci_io_ops = {
|
|
|
|
.old_portio = xen_pci_portio,
|
|
|
|
};
|
2011-06-16 20:05:17 +04:00
|
|
|
|
2011-08-08 17:09:25 +04:00
|
|
|
static void platform_ioport_bar_setup(PCIXenPlatformState *d)
|
|
|
|
{
|
|
|
|
memory_region_init_io(&d->bar, &xen_pci_io_ops, d, "xen-pci", 0x100);
|
2011-06-16 20:05:17 +04:00
|
|
|
}
|
|
|
|
|
2012-10-23 14:30:10 +04:00
|
|
|
static uint64_t platform_mmio_read(void *opaque, hwaddr addr,
|
2011-08-08 17:09:25 +04:00
|
|
|
unsigned size)
|
2011-06-16 20:05:17 +04:00
|
|
|
{
|
|
|
|
DPRINTF("Warning: attempted read from physical address "
|
|
|
|
"0x" TARGET_FMT_plx " in xen platform mmio space\n", addr);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-10-23 14:30:10 +04:00
|
|
|
static void platform_mmio_write(void *opaque, hwaddr addr,
|
2011-08-08 17:09:25 +04:00
|
|
|
uint64_t val, unsigned size)
|
2011-06-16 20:05:17 +04:00
|
|
|
{
|
2011-08-08 17:09:25 +04:00
|
|
|
DPRINTF("Warning: attempted write of 0x%"PRIx64" to physical "
|
2011-06-16 20:05:17 +04:00
|
|
|
"address 0x" TARGET_FMT_plx " in xen platform mmio space\n",
|
|
|
|
val, addr);
|
|
|
|
}
|
|
|
|
|
2011-08-08 17:09:25 +04:00
|
|
|
static const MemoryRegionOps platform_mmio_handler = {
|
2011-06-16 20:05:17 +04:00
|
|
|
.read = &platform_mmio_read,
|
|
|
|
.write = &platform_mmio_write,
|
2011-08-08 17:09:25 +04:00
|
|
|
.endianness = DEVICE_NATIVE_ENDIAN,
|
2011-06-16 20:05:17 +04:00
|
|
|
};
|
|
|
|
|
2011-08-08 17:09:25 +04:00
|
|
|
static void platform_mmio_setup(PCIXenPlatformState *d)
|
2011-06-16 20:05:17 +04:00
|
|
|
{
|
2011-08-08 17:09:25 +04:00
|
|
|
memory_region_init_io(&d->mmio_bar, &platform_mmio_handler, d,
|
|
|
|
"xen-mmio", 0x1000000);
|
2011-06-16 20:05:17 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static int xen_platform_post_load(void *opaque, int version_id)
|
|
|
|
{
|
|
|
|
PCIXenPlatformState *s = opaque;
|
|
|
|
|
2011-11-04 19:35:11 +04:00
|
|
|
platform_fixed_ioport_writeb(s, 0, s->flags);
|
2011-06-16 20:05:17 +04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const VMStateDescription vmstate_xen_platform = {
|
|
|
|
.name = "platform",
|
|
|
|
.version_id = 4,
|
|
|
|
.minimum_version_id = 4,
|
|
|
|
.minimum_version_id_old = 4,
|
|
|
|
.post_load = xen_platform_post_load,
|
|
|
|
.fields = (VMStateField []) {
|
|
|
|
VMSTATE_PCI_DEVICE(pci_dev, PCIXenPlatformState),
|
|
|
|
VMSTATE_UINT8(flags, PCIXenPlatformState),
|
|
|
|
VMSTATE_END_OF_LIST()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static int xen_platform_initfn(PCIDevice *dev)
|
|
|
|
{
|
|
|
|
PCIXenPlatformState *d = DO_UPCAST(PCIXenPlatformState, pci_dev, dev);
|
|
|
|
uint8_t *pci_conf;
|
|
|
|
|
|
|
|
pci_conf = d->pci_dev.config;
|
|
|
|
|
|
|
|
pci_set_word(pci_conf + PCI_COMMAND, PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
|
|
|
|
|
|
|
|
pci_config_set_prog_interface(pci_conf, 0);
|
|
|
|
|
|
|
|
pci_conf[PCI_INTERRUPT_PIN] = 1;
|
|
|
|
|
2011-08-08 17:09:25 +04:00
|
|
|
platform_ioport_bar_setup(d);
|
2011-08-08 17:09:31 +04:00
|
|
|
pci_register_bar(&d->pci_dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &d->bar);
|
2011-06-16 20:05:17 +04:00
|
|
|
|
|
|
|
/* reserve 16MB mmio address for share memory*/
|
2011-08-08 17:09:25 +04:00
|
|
|
platform_mmio_setup(d);
|
2011-08-08 17:09:31 +04:00
|
|
|
pci_register_bar(&d->pci_dev, 1, PCI_BASE_ADDRESS_MEM_PREFETCH,
|
|
|
|
&d->mmio_bar);
|
2011-06-16 20:05:17 +04:00
|
|
|
|
|
|
|
platform_fixed_ioport_init(d);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void platform_reset(DeviceState *dev)
|
|
|
|
{
|
|
|
|
PCIXenPlatformState *s = DO_UPCAST(PCIXenPlatformState, pci_dev.qdev, dev);
|
|
|
|
|
|
|
|
platform_fixed_ioport_reset(s);
|
|
|
|
}
|
|
|
|
|
2011-12-04 22:22:06 +04:00
|
|
|
static void xen_platform_class_init(ObjectClass *klass, void *data)
|
|
|
|
{
|
2011-12-08 07:34:16 +04:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
2011-12-04 22:22:06 +04:00
|
|
|
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
|
|
|
|
|
|
|
k->init = xen_platform_initfn;
|
|
|
|
k->vendor_id = PCI_VENDOR_ID_XEN;
|
|
|
|
k->device_id = PCI_DEVICE_ID_XEN_PLATFORM;
|
|
|
|
k->class_id = PCI_CLASS_OTHERS << 8 | 0x80;
|
|
|
|
k->subsystem_vendor_id = PCI_VENDOR_ID_XEN;
|
|
|
|
k->subsystem_id = PCI_DEVICE_ID_XEN_PLATFORM;
|
|
|
|
k->revision = 1;
|
2011-12-08 07:34:16 +04:00
|
|
|
dc->desc = "XEN platform pci device";
|
|
|
|
dc->reset = platform_reset;
|
|
|
|
dc->vmsd = &vmstate_xen_platform;
|
2011-12-04 22:22:06 +04:00
|
|
|
}
|
|
|
|
|
2011-12-08 07:34:16 +04:00
|
|
|
static TypeInfo xen_platform_info = {
|
|
|
|
.name = "xen-platform",
|
|
|
|
.parent = TYPE_PCI_DEVICE,
|
|
|
|
.instance_size = sizeof(PCIXenPlatformState),
|
|
|
|
.class_init = xen_platform_class_init,
|
2011-06-16 20:05:17 +04:00
|
|
|
};
|
|
|
|
|
2012-02-09 18:20:55 +04:00
|
|
|
static void xen_platform_register_types(void)
|
2011-06-16 20:05:17 +04:00
|
|
|
{
|
2011-12-08 07:34:16 +04:00
|
|
|
type_register_static(&xen_platform_info);
|
2011-06-16 20:05:17 +04:00
|
|
|
}
|
|
|
|
|
2012-02-09 18:20:55 +04:00
|
|
|
type_init(xen_platform_register_types)
|