Revision 10c4c98a hw/qdev.h
b/hw/qdev.h | ||
---|---|---|
10 | 10 |
|
11 | 11 |
typedef struct BusState BusState; |
12 | 12 |
|
13 |
typedef struct BusInfo BusInfo; |
|
14 |
|
|
13 | 15 |
/* This structure should not be accessed directly. We declare it here |
14 | 16 |
so that it can be embedded in individual device state structures. */ |
15 | 17 |
struct DeviceState { |
... | ... | |
25 | 27 |
LIST_ENTRY(DeviceState) sibling; |
26 | 28 |
}; |
27 | 29 |
|
28 |
typedef enum { |
|
29 |
BUS_TYPE_SYSTEM, |
|
30 |
BUS_TYPE_PCI, |
|
31 |
BUS_TYPE_SCSI, |
|
32 |
BUS_TYPE_I2C, |
|
33 |
BUS_TYPE_SSI |
|
34 |
} BusType; |
|
30 |
typedef void (*bus_dev_printfn)(Monitor *mon, DeviceState *dev, int indent); |
|
31 |
struct BusInfo { |
|
32 |
const char *name; |
|
33 |
size_t size; |
|
34 |
bus_dev_printfn print_dev; |
|
35 |
}; |
|
35 | 36 |
|
36 | 37 |
struct BusState { |
37 | 38 |
DeviceState *parent; |
39 |
BusInfo *info; |
|
38 | 40 |
const char *name; |
39 |
BusType type; |
|
40 | 41 |
LIST_HEAD(, DeviceState) children; |
41 | 42 |
LIST_ENTRY(BusState) sibling; |
42 | 43 |
}; |
... | ... | |
84 | 85 |
|
85 | 86 |
/* Private to qdev / bus. */ |
86 | 87 |
qdev_initfn init; |
87 |
BusType bus_type;
|
|
88 |
BusInfo *bus_info;
|
|
88 | 89 |
}; |
89 | 90 |
|
90 | 91 |
void qdev_register(DeviceInfo *info); |
... | ... | |
116 | 117 |
|
117 | 118 |
/*** BUS API. ***/ |
118 | 119 |
|
119 |
BusState *qbus_create(BusType type, size_t size, |
|
120 |
DeviceState *parent, const char *name); |
|
120 |
BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name); |
|
121 | 121 |
|
122 | 122 |
#define FROM_QBUS(type, dev) DO_UPCAST(type, qbus, dev) |
123 | 123 |
|
124 | 124 |
/*** monitor commands ***/ |
125 | 125 |
|
126 | 126 |
void do_info_qtree(Monitor *mon); |
127 |
void sysbus_dev_print(Monitor *mon, DeviceState *dev, int indent); |
|
128 | 127 |
|
129 | 128 |
#endif |
Also available in: Unified diff