Revision 0beb4942
b/hw/etraxfs_ser.c | ||
---|---|---|
216 | 216 |
memory_region_init_io(&s->mmio, &ser_ops, s, "etraxfs-serial", R_MAX * 4); |
217 | 217 |
sysbus_init_mmio(dev, &s->mmio); |
218 | 218 |
|
219 |
s->chr = qdev_init_chardev(&dev->qdev);
|
|
219 |
s->chr = qemu_char_get_next_serial();
|
|
220 | 220 |
if (s->chr) |
221 | 221 |
qemu_chr_add_handlers(s->chr, |
222 | 222 |
serial_can_receive, serial_receive, |
b/hw/lm32_juart.c | ||
---|---|---|
114 | 114 |
{ |
115 | 115 |
LM32JuartState *s = FROM_SYSBUS(typeof(*s), dev); |
116 | 116 |
|
117 |
s->chr = qdev_init_chardev(&dev->qdev);
|
|
117 |
s->chr = qemu_char_get_next_serial();
|
|
118 | 118 |
if (s->chr) { |
119 | 119 |
qemu_chr_add_handlers(s->chr, juart_can_rx, juart_rx, juart_event, s); |
120 | 120 |
} |
b/hw/lm32_uart.c | ||
---|---|---|
252 | 252 |
memory_region_init_io(&s->iomem, &uart_ops, s, "uart", R_MAX * 4); |
253 | 253 |
sysbus_init_mmio(dev, &s->iomem); |
254 | 254 |
|
255 |
s->chr = qdev_init_chardev(&dev->qdev);
|
|
255 |
s->chr = qemu_char_get_next_serial();
|
|
256 | 256 |
if (s->chr) { |
257 | 257 |
qemu_chr_add_handlers(s->chr, uart_can_rx, uart_rx, uart_event, s); |
258 | 258 |
} |
b/hw/milkymist-uart.c | ||
---|---|---|
199 | 199 |
"milkymist-uart", R_MAX * 4); |
200 | 200 |
sysbus_init_mmio(dev, &s->regs_region); |
201 | 201 |
|
202 |
s->chr = qdev_init_chardev(&dev->qdev);
|
|
202 |
s->chr = qemu_char_get_next_serial();
|
|
203 | 203 |
if (s->chr) { |
204 | 204 |
qemu_chr_add_handlers(s->chr, uart_can_rx, uart_rx, uart_event, s); |
205 | 205 |
} |
b/hw/pl011.c | ||
---|---|---|
264 | 264 |
sysbus_init_mmio(dev, &s->iomem); |
265 | 265 |
sysbus_init_irq(dev, &s->irq); |
266 | 266 |
s->id = id; |
267 |
s->chr = qdev_init_chardev(&dev->qdev);
|
|
267 |
s->chr = qemu_char_get_next_serial();
|
|
268 | 268 |
|
269 | 269 |
s->read_trigger = 1; |
270 | 270 |
s->ifl = 0x12; |
b/hw/qdev.c | ||
---|---|---|
336 | 336 |
return qdev_hot_added || qdev_hot_removed; |
337 | 337 |
} |
338 | 338 |
|
339 |
/* Get a character (serial) device interface. */ |
|
340 |
CharDriverState *qdev_init_chardev(DeviceState *dev) |
|
341 |
{ |
|
342 |
static int next_serial; |
|
343 |
|
|
344 |
/* FIXME: This function needs to go away: use chardev properties! */ |
|
345 |
return serial_hds[next_serial++]; |
|
346 |
} |
|
347 |
|
|
348 | 339 |
BusState *qdev_get_parent_bus(DeviceState *dev) |
349 | 340 |
{ |
350 | 341 |
return dev->parent_bus; |
b/hw/qdev.h | ||
---|---|---|
235 | 235 |
void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n); |
236 | 236 |
void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n); |
237 | 237 |
|
238 |
CharDriverState *qdev_init_chardev(DeviceState *dev); |
|
239 |
|
|
240 | 238 |
BusState *qdev_get_parent_bus(DeviceState *dev); |
241 | 239 |
|
242 | 240 |
/*** BUS API. ***/ |
b/hw/xilinx_uartlite.c | ||
---|---|---|
205 | 205 |
memory_region_init_io(&s->mmio, &uart_ops, s, "xilinx-uartlite", R_MAX * 4); |
206 | 206 |
sysbus_init_mmio(dev, &s->mmio); |
207 | 207 |
|
208 |
s->chr = qdev_init_chardev(&dev->qdev);
|
|
208 |
s->chr = qemu_char_get_next_serial();
|
|
209 | 209 |
if (s->chr) |
210 | 210 |
qemu_chr_add_handlers(s->chr, uart_can_rx, uart_rx, uart_event, s); |
211 | 211 |
return 0; |
b/qemu-char.c | ||
---|---|---|
2903 | 2903 |
} |
2904 | 2904 |
return NULL; |
2905 | 2905 |
} |
2906 |
|
|
2907 |
/* Get a character (serial) device interface. */ |
|
2908 |
CharDriverState *qemu_char_get_next_serial(void) |
|
2909 |
{ |
|
2910 |
static int next_serial; |
|
2911 |
|
|
2912 |
/* FIXME: This function needs to go away: use chardev properties! */ |
|
2913 |
return serial_hds[next_serial++]; |
|
2914 |
} |
|
2915 |
|
b/qemu-char.h | ||
---|---|---|
248 | 248 |
QString *qemu_chr_mem_to_qs(CharDriverState *chr); |
249 | 249 |
size_t qemu_chr_mem_osize(const CharDriverState *chr); |
250 | 250 |
|
251 |
CharDriverState *qemu_char_get_next_serial(void); |
|
252 |
|
|
251 | 253 |
#endif |
Also available in: Unified diff