root / hw / stream.h @ a1e47211
History | View | Annotate | Download (872 Bytes)
1 | 669b4983 | Peter A. G. Crosthwaite | #ifndef STREAM_H
|
---|---|---|---|
2 | 669b4983 | Peter A. G. Crosthwaite | #define STREAM_H 1 |
3 | 669b4983 | Peter A. G. Crosthwaite | |
4 | 669b4983 | Peter A. G. Crosthwaite | #include "qemu-common.h" |
5 | 669b4983 | Peter A. G. Crosthwaite | #include "qemu/object.h" |
6 | 669b4983 | Peter A. G. Crosthwaite | |
7 | 669b4983 | Peter A. G. Crosthwaite | /* stream slave. Used until qdev provides a generic way. */
|
8 | 669b4983 | Peter A. G. Crosthwaite | #define TYPE_STREAM_SLAVE "stream-slave" |
9 | 669b4983 | Peter A. G. Crosthwaite | |
10 | 669b4983 | Peter A. G. Crosthwaite | #define STREAM_SLAVE_CLASS(klass) \
|
11 | 669b4983 | Peter A. G. Crosthwaite | OBJECT_CLASS_CHECK(StreamSlaveClass, (klass), TYPE_STREAM_SLAVE) |
12 | 669b4983 | Peter A. G. Crosthwaite | #define STREAM_SLAVE_GET_CLASS(obj) \
|
13 | 669b4983 | Peter A. G. Crosthwaite | OBJECT_GET_CLASS(StreamSlaveClass, (obj), TYPE_STREAM_SLAVE) |
14 | 669b4983 | Peter A. G. Crosthwaite | #define STREAM_SLAVE(obj) \
|
15 | 669b4983 | Peter A. G. Crosthwaite | INTERFACE_CHECK(StreamSlave, (obj), TYPE_STREAM_SLAVE) |
16 | 669b4983 | Peter A. G. Crosthwaite | |
17 | 669b4983 | Peter A. G. Crosthwaite | typedef struct StreamSlave { |
18 | 669b4983 | Peter A. G. Crosthwaite | Object Parent; |
19 | 669b4983 | Peter A. G. Crosthwaite | } StreamSlave; |
20 | 669b4983 | Peter A. G. Crosthwaite | |
21 | 669b4983 | Peter A. G. Crosthwaite | typedef struct StreamSlaveClass { |
22 | 669b4983 | Peter A. G. Crosthwaite | InterfaceClass parent; |
23 | 669b4983 | Peter A. G. Crosthwaite | |
24 | 669b4983 | Peter A. G. Crosthwaite | void (*push)(StreamSlave *obj, unsigned char *buf, size_t len, |
25 | 669b4983 | Peter A. G. Crosthwaite | uint32_t *app); |
26 | 669b4983 | Peter A. G. Crosthwaite | } StreamSlaveClass; |
27 | 669b4983 | Peter A. G. Crosthwaite | |
28 | 669b4983 | Peter A. G. Crosthwaite | void
|
29 | 669b4983 | Peter A. G. Crosthwaite | stream_push(StreamSlave *sink, uint8_t *buf, size_t len, uint32_t *app); |
30 | 669b4983 | Peter A. G. Crosthwaite | |
31 | 669b4983 | Peter A. G. Crosthwaite | #endif /* STREAM_H */ |