target-i386: Introduce ICC bus/device/bridge
[qemu/ar7.git] / include / hw / cpu / icc_bus.h
blobd728a7de3edacc85a8e31bb6030ae96a07e7d2d5
1 /* icc_bus.h
2 * emulate x86 ICC (Interrupt Controller Communications) bus
4 * Copyright (c) 2013 Red Hat, Inc
6 * Authors:
7 * Igor Mammedov <imammedo@redhat.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, see <http://www.gnu.org/licenses/>
22 #ifndef ICC_BUS_H
23 #define ICC_BUS_H
25 #include "hw/qdev-core.h"
27 #define TYPE_ICC_BUS "icc-bus"
29 #ifndef CONFIG_USER_ONLY
31 /**
32 * ICCBus:
34 * ICC bus
36 typedef struct ICCBus {
37 /*< private >*/
38 BusState parent_obj;
39 /*< public >*/
40 } ICCBus;
42 #define ICC_BUS(obj) OBJECT_CHECK(ICCBus, (obj), TYPE_ICC_BUS)
44 /**
45 * ICCDevice:
47 * ICC device
49 typedef struct ICCDevice {
50 /*< private >*/
51 DeviceState qdev;
52 /*< public >*/
53 } ICCDevice;
55 /**
56 * ICCDeviceClass:
57 * @init: Initialization callback for derived classes.
59 * ICC device class
61 typedef struct ICCDeviceClass {
62 /*< private >*/
63 DeviceClass parent_class;
64 /*< public >*/
66 int (*init)(ICCDevice *dev); /* TODO replace with QOM realize */
67 } ICCDeviceClass;
69 #define TYPE_ICC_DEVICE "icc-device"
70 #define ICC_DEVICE(obj) OBJECT_CHECK(ICCDevice, (obj), TYPE_ICC_DEVICE)
71 #define ICC_DEVICE_CLASS(klass) \
72 OBJECT_CLASS_CHECK(ICCDeviceClass, (klass), TYPE_ICC_DEVICE)
73 #define ICC_DEVICE_GET_CLASS(obj) \
74 OBJECT_GET_CLASS(ICCDeviceClass, (obj), TYPE_ICC_DEVICE)
76 #define TYPE_ICC_BRIDGE "icc-bridge"
78 #endif /* CONFIG_USER_ONLY */
79 #endif