Revision 00dc738d hw/spapr_vio.c
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 |
|
Also available in: Unified diff