Revision 00dc738d

b/hw/spapr.c
65 65
    uint32_t start_prop = cpu_to_be32(initrd_base);
66 66
    uint32_t end_prop = cpu_to_be32(initrd_base + initrd_size);
67 67
    uint32_t pft_size_prop[] = {0, cpu_to_be32(hash_shift)};
68
    char hypertas_prop[] = "hcall-pft\0hcall-term\0hcall-dabr";
68
    char hypertas_prop[] = "hcall-pft\0hcall-term\0hcall-dabr\0hcall-interrupt";
69 69
    uint32_t interrupt_server_ranges_prop[] = {0, cpu_to_be32(smp_cpus)};
70 70
    int i;
71 71
    char *modelname;
b/hw/spapr_vio.c
105 105
        }
106 106
    }
107 107

  
108
    if (dev->qirq) {
109
        uint32_t ints_prop[] = {cpu_to_be32(dev->vio_irq_num), 0};
110

  
111
        ret = fdt_setprop(fdt, node_off, "interrupts", ints_prop,
112
                          sizeof(ints_prop));
113
        if (ret < 0) {
114
            return ret;
115
        }
116
    }
117

  
108 118
    if (info->devnode) {
109 119
        ret = (info->devnode)(dev, fdt, node_off);
110 120
        if (ret < 0) {
......
140 150
    qdev_register(&info->qdev);
141 151
}
142 152

  
153
static target_ulong h_vio_signal(CPUState *env, sPAPREnvironment *spapr,
154
                                 target_ulong opcode,
155
                                 target_ulong *args)
156
{
157
    target_ulong reg = args[0];
158
    target_ulong mode = args[1];
159
    VIOsPAPRDevice *dev = spapr_vio_find_by_reg(spapr->vio_bus, reg);
160
    VIOsPAPRDeviceInfo *info;
161

  
162
    if (!dev) {
163
        return H_PARAMETER;
164
    }
165

  
166
    info = (VIOsPAPRDeviceInfo *)dev->qdev.info;
167

  
168
    if (mode & ~info->signal_mask) {
169
        return H_PARAMETER;
170
    }
171

  
172
    dev->signal_state = mode;
173

  
174
    return H_SUCCESS;
175
}
176

  
143 177
VIOsPAPRBus *spapr_vio_bus_init(void)
144 178
{
145 179
    VIOsPAPRBus *bus;
......
156 190
    qbus = qbus_create(&spapr_vio_bus_info, dev, "spapr-vio");
157 191
    bus = DO_UPCAST(VIOsPAPRBus, bus, qbus);
158 192

  
193
    /* hcall-vio */
194
    spapr_register_hypercall(H_VIO_SIGNAL, h_vio_signal);
195

  
159 196
    for (qinfo = device_info_list; qinfo; qinfo = qinfo->next) {
160 197
        VIOsPAPRDeviceInfo *info = (VIOsPAPRDeviceInfo *)qinfo;
161 198

  
b/hw/spapr_vio.h
24 24
typedef struct VIOsPAPRDevice {
25 25
    DeviceState qdev;
26 26
    uint32_t reg;
27
    qemu_irq qirq;
28
    uint32_t vio_irq_num;
29
    target_ulong signal_state;
27 30
} VIOsPAPRDevice;
28 31

  
29 32
typedef struct VIOsPAPRBus {
......
33 36
typedef struct {
34 37
    DeviceInfo qdev;
35 38
    const char *dt_name, *dt_type, *dt_compatible;
39
    target_ulong signal_mask;
36 40
    int (*init)(VIOsPAPRDevice *dev);
37 41
    void (*hcalls)(VIOsPAPRBus *bus);
38 42
    int (*devnode)(VIOsPAPRDevice *dev, void *fdt, int node_off);
......
43 47
extern void spapr_vio_bus_register_withprop(VIOsPAPRDeviceInfo *info);
44 48
extern int spapr_populate_vdevice(VIOsPAPRBus *bus, void *fdt);
45 49

  
50
extern int spapr_vio_signal(VIOsPAPRDevice *dev, target_ulong mode);
51

  
46 52
void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len);
47 53
void spapr_vty_create(VIOsPAPRBus *bus,
48 54
                      uint32_t reg, CharDriverState *chardev);

Also available in: Unified diff