xref: /openbmc/qemu/include/hw/vfio/vfio-platform.h (revision 0ea2730b)
1 /*
2  * vfio based device assignment support - platform devices
3  *
4  * Copyright Linaro Limited, 2014
5  *
6  * Authors:
7  *  Kim Phillips <kim.phillips@linaro.org>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2.  See
10  * the COPYING file in the top-level directory.
11  *
12  * Based on vfio based PCI device assignment support:
13  *  Copyright Red Hat, Inc. 2012
14  */
15 
16 #ifndef HW_VFIO_VFIO_PLATFORM_H
17 #define HW_VFIO_VFIO_PLATFORM_H
18 
19 #include "hw/sysbus.h"
20 #include "hw/vfio/vfio-common.h"
21 
22 #define TYPE_VFIO_PLATFORM "vfio-platform"
23 
24 typedef struct VFIOPlatformDevice {
25     SysBusDevice sbdev;
26     VFIODevice vbasedev; /* not a QOM object */
27     VFIORegion **regions;
28     char *compat; /* compatibility string */
29 } VFIOPlatformDevice;
30 
31 typedef struct VFIOPlatformDeviceClass {
32     /*< private >*/
33     SysBusDeviceClass parent_class;
34     /*< public >*/
35 } VFIOPlatformDeviceClass;
36 
37 #define VFIO_PLATFORM_DEVICE(obj) \
38      OBJECT_CHECK(VFIOPlatformDevice, (obj), TYPE_VFIO_PLATFORM)
39 #define VFIO_PLATFORM_DEVICE_CLASS(klass) \
40      OBJECT_CLASS_CHECK(VFIOPlatformDeviceClass, (klass), TYPE_VFIO_PLATFORM)
41 #define VFIO_PLATFORM_DEVICE_GET_CLASS(obj) \
42      OBJECT_GET_CLASS(VFIOPlatformDeviceClass, (obj), TYPE_VFIO_PLATFORM)
43 
44 #endif /*HW_VFIO_VFIO_PLATFORM_H*/
45