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