1 /* 2 * Copyright (c) 2018 Citrix Systems Inc. 3 * 4 * This work is licensed under the terms of the GNU GPL, version 2 or later. 5 * See the COPYING file in the top-level directory. 6 */ 7 8 #ifndef HW_XEN_BUS_H 9 #define HW_XEN_BUS_H 10 11 #include "hw/sysbus.h" 12 13 typedef struct XenDevice { 14 DeviceState qdev; 15 } XenDevice; 16 17 typedef void (*XenDeviceRealize)(XenDevice *xendev, Error **errp); 18 typedef void (*XenDeviceUnrealize)(XenDevice *xendev, Error **errp); 19 20 typedef struct XenDeviceClass { 21 /*< private >*/ 22 DeviceClass parent_class; 23 /*< public >*/ 24 XenDeviceRealize realize; 25 XenDeviceUnrealize unrealize; 26 } XenDeviceClass; 27 28 #define TYPE_XEN_DEVICE "xen-device" 29 #define XEN_DEVICE(obj) \ 30 OBJECT_CHECK(XenDevice, (obj), TYPE_XEN_DEVICE) 31 #define XEN_DEVICE_CLASS(class) \ 32 OBJECT_CLASS_CHECK(XenDeviceClass, (class), TYPE_XEN_DEVICE) 33 #define XEN_DEVICE_GET_CLASS(obj) \ 34 OBJECT_GET_CLASS(XenDeviceClass, (obj), TYPE_XEN_DEVICE) 35 36 typedef struct XenBus { 37 BusState qbus; 38 } XenBus; 39 40 typedef struct XenBusClass { 41 /*< private >*/ 42 BusClass parent_class; 43 } XenBusClass; 44 45 #define TYPE_XEN_BUS "xen-bus" 46 #define XEN_BUS(obj) \ 47 OBJECT_CHECK(XenBus, (obj), TYPE_XEN_BUS) 48 #define XEN_BUS_CLASS(class) \ 49 OBJECT_CLASS_CHECK(XenBusClass, (class), TYPE_XEN_BUS) 50 #define XEN_BUS_GET_CLASS(obj) \ 51 OBJECT_GET_CLASS(XenBusClass, (obj), TYPE_XEN_BUS) 52 53 void xen_bus_init(void); 54 55 #endif /* HW_XEN_BUS_H */ 56