Revision 0201e2da

b/hw/spapr.c
262 262
    long pteg_shift = 17;
263 263
    int fdt_size;
264 264
    char *filename;
265
    int irq = 16;
265 266

  
266 267
    spapr = qemu_malloc(sizeof(*spapr));
267 268
    cpu_ppc_hypercall = emulate_spapr_hypercall;
......
325 326
    /* Set up VIO bus */
326 327
    spapr->vio_bus = spapr_vio_bus_init();
327 328

  
328
    for (i = 0; i < MAX_SERIAL_PORTS; i++) {
329
    for (i = 0; i < MAX_SERIAL_PORTS; i++, irq++) {
329 330
        if (serial_hds[i]) {
330
            spapr_vty_create(spapr->vio_bus, i, serial_hds[i]);
331
            spapr_vty_create(spapr->vio_bus, i, serial_hds[i],
332
                             xics_find_qirq(spapr->icp, irq), irq);
331 333
        }
332 334
    }
333 335

  
b/hw/spapr_vio.h
51 51

  
52 52
void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len);
53 53
void spapr_vty_create(VIOsPAPRBus *bus,
54
                      uint32_t reg, CharDriverState *chardev);
54
                      uint32_t reg, CharDriverState *chardev,
55
                      qemu_irq qirq, uint32_t vio_irq_num);
55 56

  
56 57
#endif /* _HW_SPAPR_VIO_H */
b/hw/spapr_vty.c
24 24
    VIOsPAPRVTYDevice *dev = (VIOsPAPRVTYDevice *)opaque;
25 25
    int i;
26 26

  
27
    if ((dev->in == dev->out) && size) {
28
        /* toggle line to simulate edge interrupt */
29
        qemu_irq_pulse(dev->sdev.qirq);
30
    }
27 31
    for (i = 0; i < size; i++) {
28 32
        assert((dev->in - dev->out) < VTERM_BUFSIZE);
29 33
        dev->buf[dev->in++ % VTERM_BUFSIZE] = buf[i];
......
112 116
}
113 117

  
114 118
void spapr_vty_create(VIOsPAPRBus *bus,
115
                      uint32_t reg, CharDriverState *chardev)
119
                      uint32_t reg, CharDriverState *chardev,
120
                      qemu_irq qirq, uint32_t vio_irq_num)
116 121
{
117 122
    DeviceState *dev;
123
    VIOsPAPRDevice *sdev;
118 124

  
119 125
    dev = qdev_create(&bus->bus, "spapr-vty");
120 126
    qdev_prop_set_uint32(dev, "reg", reg);
121 127
    qdev_prop_set_chr(dev, "chardev", chardev);
122 128
    qdev_init_nofail(dev);
129
    sdev = (VIOsPAPRDevice *)dev;
130
    sdev->qirq = qirq;
131
    sdev->vio_irq_num = vio_irq_num;
123 132
}
124 133

  
125 134
static void vty_hcalls(VIOsPAPRBus *bus)

Also available in: Unified diff